/* ==========================================================================
   HOMEPAGE STYLES - GAPKINDO SUMUT
   
   TABLE OF CONTENTS:
   
   1. CSS Variables & Theme .................... Line 25
   2. Dark Mode Support ........................ Line 45
   3. Base Styles & Accessibility .............. Line 70
   4. Carousel (Homepage Only) ................. Line 110
   5. Date & Running Text (Reusable) ........... Line 385
   6. Section Cards (Reusable) ................. Line 460
   7. Modern Cards with Animations (Reusable) .. Line 520
   8. News Badge & Utilities ................... Line 620
   9. Responsive Styles ........................ Line 660
   
   USAGE:
   - ✅ REUSABLE: Sections marked can be used in other pages
   - ❌ PAGE-SPECIFIC: Homepage only
   
   File Size: ~750 lines
   Created: 2025-01-XX
   Last Updated: 2025-01-XX
   ========================================================================== */

/* ==========================================================================
   1. CSS VARIABLES & THEME
   
   PURPOSE: Global theme colors and design tokens
   USED IN: All pages (homepage, harga, statistik, etc)
   REUSABLE: YES ✅
   
   NOTE: These variables should be consistent across the entire website
   ========================================================================== */

:root {
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-card: #dcd6ee;
  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --accent-primary: #667eea;
  --accent-secondary: #764ba2;
  --border-color: #e2e8f0;
  --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   2. DARK MODE SUPPORT
   
   PURPOSE: Automatic dark mode based on system preference
   USED IN: All pages
   REUSABLE: YES ✅
   
   TRIGGER: @media (prefers-color-scheme: dark)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-card: #374151;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #cbd5e0;
    --border-color: #4a5568;
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.5);
  }
}

/* ==========================================================================
   3. BASE STYLES & ACCESSIBILITY
   
   PURPOSE: Global body styles and accessibility features
   USED IN: All pages
   REUSABLE: YES ✅
   ========================================================================== */

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.content-wrapper {
  margin: 0 1%;
}

/* Skip to content link for screen readers and keyboard navigation */
.skip-to-content {
  position: absolute;
  top: -50px;
  left: 10px;
  background: var(--accent-primary);
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 5px;
  z-index: 10000;
  font-weight: 600;
  transition: top 0.3s ease;
}

.skip-to-content:focus {
  top: 10px;
  outline: 3px solid white;
  outline-offset: 2px;
}

/* ==========================================================================
   4. CAROUSEL (HOMEPAGE ONLY)
   
   PURPOSE: Hero carousel/slideshow on homepage
   USED IN: index.php only
   REUSABLE: NO ❌
   LINES: ~275 lines
   DEPENDENCIES: Bootstrap 5 carousel component
   
   SECTIONS:
   - Carousel caption (glassmorphism design)
   - Carousel indicators
   - Carousel controls (prev/next buttons)
   - Modern ribbon badges
   - Responsive breakpoints
   
   NOTE: If needed on other pages, consider creating carousel.css
   ========================================================================== */

/* Carousel Caption - Modern Glassmorphism Design */
.carousel-caption {
  bottom: 20%;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(1px) saturate(180%);
  -webkit-backdrop-filter: blur(15px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 30px;
  border-radius: 20px;
  max-width: 800px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.carousel-caption .btn {
  color: white !important;
  border: none !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-caption .btn:focus {
  outline: 3px solid white;
  outline-offset: 4px;
}

.carousel-caption h3 {
  font-weight: 600;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
  margin-bottom: 15px;
  font-size: clamp(1rem, 4vw, 2.5rem);
}

.carousel-caption .lead {
  font-size: clamp(0.8rem, 2vw, 1.1rem);
  margin-bottom: 10px;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
}

/* Carousel Indicators - Custom styled dots */
.carousel-indicators {
  bottom: 20px;
}

.carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 0%;
  background-color: rgba(255, 255, 255, 0.5);
  border: 2px solid #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-indicators button:focus {
  outline: 2px solid white;
  outline-offset: 3px;
}

.carousel-indicators .active {
  background-color: #667eea;
  transform: scale(1.3);
}

/* Carousel Controls - Prev/Next Buttons */
.carousel-control-prev,
.carousel-control-next {
  width: 50px;
  height: 50px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-control-prev {
  left: 20px;
}

.carousel-control-next {
  right: 20px;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.1);
}

.carousel-control-prev:focus,
.carousel-control-next:focus {
  outline: 3px solid var(--accent-primary);
  outline-offset: 4px;
}

.carousel-control-prev i,
.carousel-control-next i {
  color: white;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Modern Ribbon Badge on Carousel Items */
.ribbon-modern {
  position: absolute;
  top: 20px !important;
  left: -35px !important;
  z-index: 10;
  width: 150px;
  padding: 8px 0;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  text-align: center;
  transform: rotate(-45deg);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
}

/* Responsive: Tablet Carousel (≤768px) */
@media (max-width: 768px) {
  .carousel-item {
    height: auto;
    min-height: unset;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
  }

  .carousel-item img {
    width: 100%;
    height: auto;
    display: block;
  }

  .carousel-caption {
    bottom: 10%;
    padding: 12px 18px;
    width: 85%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
  }

  .carousel-caption h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    line-height: 1.3;
  }

  .carousel-caption .lead {
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.4;
  }

  .carousel-caption .btn {
    padding: 8px 20px;
    font-size: 0.9rem;
    margin-top: 10px;
  }

  #carouselExampleAutoplaying,
  .carousel-inner {
    margin-bottom: 0 !important;
  }

  /* Position controls closer to caption */
  .carousel-control-prev,
  .carousel-control-next {
    top: 40%;
    width: 45px;
    height: 45px;
  }

  .carousel-control-prev {
    left: 15px;
  }

  .carousel-control-next {
    right: 15px;
  }
}

/* Responsive: Mobile Carousel (≤576px) */
@media (max-width: 576px) {
  .carousel-item {
    height: auto;
    min-height: unset;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
  }

  .carousel-caption {
    bottom: 8%;
    padding: 10px 12px;
    width: 80%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
  }

  .carousel-caption h3 {
    font-size: 0.8rem;
    margin-bottom: 8px;
    line-height: 1.25;
  }

  .carousel-caption .lead {
    font-size: 0.75rem;
    margin-bottom: 8px;
    line-height: 1.35;
  }

  .carousel-caption .btn {
    padding: 6px 16px;
    font-size: 0.85rem;
    margin-top: 8px;
  }

  #carouselExampleAutoplaying,
  .carousel-inner {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  /* Smaller control buttons */
  .carousel-control-prev,
  .carousel-control-next {
    top: 35%;
    width: 40px;
    height: 40px;
  }

  .carousel-control-prev {
    left: 10px;
  }

  .carousel-control-next {
    right: 10px;
  }

  .carousel-control-prev i,
  .carousel-control-next i {
    font-size: 1.5rem;
    top: 35%;
  }
}

@media (max-width: 768px) {
  /* ... existing code ... */

  .carousel-control-next {
    right: 15px;
  }

  /* ✅ JARAK SLIDE INDIKATOR */
  .carousel-indicators {
    bottom: 10px !important;
  }

  .carousel-indicators button {
    width: 20px !important;
    height: 8px !important;
  }
}

/* Responsive: Extra Small Mobile (≤400px) */
@media (max-width: 400px) {
  .carousel-item {
    height: auto;
    min-height: unset;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
  }

  .carousel-caption {
    bottom: 5%;
    padding: 8px 10px;
    width: 90%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
  }

  .carousel-caption h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
    line-height: 1.2;
  }

  .carousel-caption .lead {
    font-size: 0.75rem;
    margin-bottom: 6px;
    line-height: 1.3;
  }

  .carousel-caption .btn {
    padding: 5px 14px;
    font-size: 0.75rem;
    margin-top: 6px;
  }

  #carouselExampleAutoplaying,
  .carousel-inner {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  /* Minimal control buttons */
  .carousel-control-prev,
  .carousel-control-next {
    top: 32%;
    width: 35px;
    height: 35px;
  }

  .carousel-control-prev i,
  .carousel-control-next i {
    font-size: 1.2rem;
  }
}

/* ==========================================================================
   5. DATE & RUNNING TEXT
   
   PURPOSE: DateTime display with scrolling news ticker
   USED IN: index.php, harga.php, statistik.php
   REUSABLE: YES ✅✅✅
   DEPENDENCIES: CSS Variables (--accent-primary)
   
   COMPONENTS:
   - .datetime-container: Main wrapper
   - .date-display: Date/time display
   - .running-text-container: News ticker wrapper
   - .running-text: Scrolling text with animation
   
   TODO: If used in 3+ pages, consider extracting to datetime.css
   ========================================================================== */

.datetime-container {
  background: var(--accent-primary);
  border-radius: 0px;
  padding: 15px 25px;
  color: white;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  margin: 0 0 20px 0 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
}

.date-display {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.running-text-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-width: 250px;
  max-width: 100%;
}

.running-text {
  display: inline-block;
  white-space: nowrap;
  animation: scroll-text 25s linear infinite;
  font-weight: 500;
}

@keyframes scroll-text {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Responsive: DateTime Mobile */
@media (max-width: 768px) {
  .datetime-container {
    flex-direction: column;
    text-align: center;
    padding: 15px;
    gap: 10px;
    margin: 0 0 10px 0 !important;
    position: relative;
  }

  .date-display {
    justify-content: center;
    width: 100%;
  }

  .running-text-container {
    width: 100%;
    min-width: 100%;
  }
}

@media (max-width: 576px) {
  .datetime-container {
    margin: 0 0 10px 0 !important;
    padding-top: 15px;
    position: relative;
  }
}

@media (max-width: 400px) {
  .datetime-container {
    margin: 0 0 10px 0 !important;
    padding-top: 12px;
  }
}

/* ==========================================================================
   6. SECTION CARDS
   
   PURPOSE: Card containers with header and body for content sections
   USED IN: index.php, statistik.php, download.php
   REUSABLE: YES ✅✅✅
   DEPENDENCIES: CSS Variables
   
   STRUCTURE:
   - .section-card: Main container
   - .section-card-header: Title area with icon
   - .section-card-title: Section heading
   - .section-card-body: Content area
   ========================================================================== */

.section-card {
  background: var(--bg-card);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 30px;
}

.section-card:hover {
  box-shadow: var(--shadow-md);
}

.section-card-header {
  background: var(--bg-secondary);
  padding: 12px 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  border-bottom: 3px solid var(--accent-primary);
}

.section-card-header img {
  height: 28px;
  filter: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-card:hover .section-card-header img {
  transform: scale(1.15) rotate(5deg);
}

.section-card-title {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: 0.5px;
}

.section-card-body {
  padding: 12px;
}

.section-card-body .row {
  margin: 0;
}

/* ==========================================================================
   7. MODERN CARDS WITH ANIMATIONS
   
   PURPOSE: Animated cards for news/content display
   USED IN: index.php (berita, galeri sections), berita.php
   REUSABLE: MAYBE ⚠️
   DEPENDENCIES: CSS Variables, fadeInUp animation
   
   FEATURES:
   - Staggered fade-in animation
   - Hover lift effect
   - Image zoom on hover
   - Gradient button
   - News badge
   ========================================================================== */

.modern-card {
  background: var(--bg-secondary);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
}

/* Staggered animation delay for each card */
.modern-card:nth-child(1) {
  animation-delay: 0.1s;
}
.modern-card:nth-child(2) {
  animation-delay: 0.2s;
}
.modern-card:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modern-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.modern-card img {
  width: 100%;
  object-fit: cover;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-card:hover img {
  transform: scale(1.08);
}

.modern-card .card-body {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.modern-card .card-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
}

.modern-card .card-text {
  color: var(--text-secondary);
  line-height: 1.6;
  flex-grow: 1;
  font-size: clamp(0.85rem, 1.5vw, 0.9rem);
}

.modern-card .btn-next {
  background: linear-gradient(
    135deg,
    var(--accent-primary) 0%,
    var(--accent-secondary) 100%
  );
  color: white;
  border: none;
  padding: 7px 18px;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  text-decoration: none;
  font-size: clamp(0.8rem, 1.5vw, 0.85rem);
}

.modern-card .btn-next:hover {
  transform: translateX(5px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
  color: white;
}

.modern-card .btn-next:focus {
  outline: 3px solid var(--accent-primary);
  outline-offset: 4px;
}

.modern-card .card-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 10px 15px;
  font-size: clamp(0.7rem, 1.5vw, 0.75rem);
  color: var(--text-muted);
}

/* ==========================================================================
   8. NEWS BADGE & UTILITIES
   
   PURPOSE: Animated badge and utility styles
   USED IN: News cards, link sections
   REUSABLE: YES ✅
   ========================================================================== */

/* News Badge with Pulse Animation */
.news-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
  z-index: 10;
  animation: pulse-badge-red 2s ease-in-out infinite;
}

/* Badge hanya tampil di card pertama bagian berita */
.section-card .row .col:not(:first-child) .news-badge {
  display: none;
}

@keyframes pulse-badge-red {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

/* Link Terkait Section Header */
.link-terkait-modern {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 800;
  background: linear-gradient(to right, var(--accent-primary), #059669);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 10px 0 5px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   9. RESPONSIVE STYLES & ACCESSIBILITY
   
   PURPOSE: Mobile optimizations and accessibility features
   USED IN: All components above
   ========================================================================== */

/* Responsive: Tablet & Mobile */
@media (max-width: 768px) {
  .content-wrapper {
    margin: 0 0.5%;
  }

  .section-card-header {
    padding: 10px 20px;
  }

  .section-card-header img {
    height: 24px;
  }

  .section-card-body {
    padding: 10px;
  }

  .modern-card img {
    height: 200px;
  }

  .modern-card .card-body {
    padding: 12px;
  }

  .modern-card .card-footer {
    padding: 8px 12px;
  }
}

/* Focus Visible for Better Keyboard Navigation */
*:focus-visible {
  outline: 3px solid var(--accent-primary);
  outline-offset: 2px;
  transition: outline 0.2s ease;
}

/* Reduced Motion Support for Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* ==========================================================================
   CUSTOM BUTTON STYLES - SUSTAINABILITY SECTION
   
   PURPOSE: Custom styling for "KUNJUNGI" button
   USED IN: index.php (sustainability section)
   ========================================================================== */

/* Override default btn-light dengan gradient modern */
.btn-light {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
  border: none !important;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-light:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
  color: white !important;
}

.btn-light:focus {
  outline: 3px solid var(--accent-primary);
  outline-offset: 4px;
}

/* ==========================================================================
   END OF STYLESHEET
   
   MAINTENANCE NOTES:
   - Keep Table of Contents updated when adding new sections
   - Mark REUSABLE sections for potential extraction
   - Use consistent comment formatting
   - Update "Last Modified" date at the top
   - Test on multiple devices and browsers
   
   PERFORMANCE TIPS:
   - Minimize use of expensive properties (box-shadow, filter)
   - Use transform instead of position changes for animations
   - Optimize images referenced in CSS
   - Consider lazy loading for below-fold content
   ========================================================================== */