/* ================================================================
 * STYLESHEET SPPG SOATALOARA II
 * Satuan Pelayanan Pemenuhan Gizi Soataloara II
 * Color Palette: Deep Emerald (#059669), Vibrant Teal (#0d9488),
 * Mint Highlight (#10b981, #34d399), Slate Navy (#0f172a, #1e293b),
 * Warm Amber Gold (#f59e0b, #d97706)
 * ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Brand Primary Colors */
  --primary: #059669;
  --primary-dark: #047857;
  --primary-deep: #064e3b;
  --primary-light: #10b981;
  --primary-subtle: #ecfdf5;
  --primary-glow: rgba(5, 150, 105, 0.25);

  /* Secondary & Accents */
  --secondary: #0d9488;
  --secondary-light: #14b8a6;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-subtle: #fffbeb;

  /* Neutrals & Dark Palette */
  --dark: #0f172a;
  --dark-light: #1e293b;
  --dark-subtle: #334155;
  --light-bg: #f8fafc;
  --light-surface: #ffffff;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* Typography Colors */
  --text-main: #1e293b;
  --text-body: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Fonts & Shadows */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 6px -1px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 25px -4px rgba(15, 23, 42, 0.07), 0 4px 8px -2px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 20px 40px -8px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 15px 35px -5px rgba(5, 150, 105, 0.2);
}

/* ================================================================
 * 1. BASE & TYPOGRAPHY
 * ================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  color: var(--text-body);
  background-color: var(--light-bg);
  overflow-x: hidden;
  line-height: 1.7;
  font-size: 0.975rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--dark);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}

/* Helper Utilities */
.text-emerald { color: var(--primary) !important; }
.text-emerald-light { color: #6ee7b7 !important; }
.bg-emerald { background-color: var(--primary) !important; }
.bg-emerald-subtle { background-color: var(--primary-subtle) !important; }
.border-emerald { border-color: var(--primary) !important; }
.text-amber { color: var(--accent) !important; }

/* ================================================================
 * 2. PRELOADER ANIMATION
 * ================================================================ */
#preloader {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #064e3b 0%, #047857 45%, #0f172a 100%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s ease;
}

#preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loader-spinner {
  width: 68px;
  height: 68px;
  border: 3.5px solid rgba(255, 255, 255, 0.12);
  border-top: 3.5px solid #34d399;
  border-right: 3.5px solid #fbbf24;
  border-radius: 50%;
  animation: spinLoader 0.9s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
  margin-bottom: 22px;
  filter: drop-shadow(0 0 12px rgba(52, 211, 153, 0.4));
}

@keyframes spinLoader {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-text {
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.loader-subtext {
  color: #a7f3d0;
  font-size: 0.85rem;
  margin-top: 6px;
  font-weight: 500;
  letter-spacing: 0.5px;
  animation: pulseSubtext 1.8s ease-in-out infinite alternate;
}

@keyframes pulseSubtext {
  0% { opacity: 0.6; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}

/* ================================================================
 * 3. TOPBAR & NAVBAR
 * ================================================================ */
.sppg-topbar {
  background: #091322;
  color: #94a3b8;
  font-size: 0.825rem;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sppg-topbar a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.sppg-topbar a:hover {
  color: #34d399;
}

.navbar-custom {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 16px 0;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  transition: var(--transition);
}

.navbar-custom.scrolled {
  padding: 10px 0;
  box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.98);
}

.navbar-brand-logo {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
  transition: var(--transition);
}

.navbar-brand:hover .navbar-brand-logo {
  transform: rotate(-6deg) scale(1.05);
}

.navbar-brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--dark);
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.navbar-brand-text small {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: block;
}

.navbar-nav .nav-link {
  font-size: 0.935rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 8px 16px !important;
  border-radius: 10px;
  transition: var(--transition);
  position: relative;
}

.navbar-nav .nav-link:hover {
  color: var(--primary) !important;
  background: rgba(5, 150, 105, 0.08);
}

.navbar-nav .nav-link.active {
  color: var(--primary) !important;
  background: rgba(5, 150, 105, 0.1);
  font-weight: 700;
}

.dropdown-menu {
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  margin-top: 10px;
  animation: dropdownFadeIn 0.22s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-main);
  transition: var(--transition);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--primary-subtle);
  color: var(--primary);
  transform: translateX(4px);
}

/* ================================================================
 * 4. HERO SECTION (VIDEO / IMAGE BACKGROUND)
 * ================================================================ */
.hero-wrapper {
  position: relative;
  min-height: 86vh;
  display: flex;
  align-items: center;
  color: #ffffff;
  overflow: hidden;
  background: #064e3b;
}

.hero-media-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-video,
.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.62) saturate(1.1);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.92) 0%, rgba(13, 148, 136, 0.8) 50%, rgba(15, 23, 42, 0.88) 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: 110px 0 90px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 7px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #a7f3d0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  margin-bottom: 22px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 22px;
  letter-spacing: -0.035em;
  color: #ffffff;
}

.hero-title span {
  background: linear-gradient(135deg, #34d399 0%, #6ee7b7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-desc {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: #e2e8f0;
  max-width: 660px;
  margin-bottom: 38px;
  line-height: 1.75;
  font-weight: 400;
}

/* ================================================================
 * 5. STATISTIC COUNTER CARDS
 * ================================================================ */
.stat-card {
  background: var(--light-surface);
  border-radius: 18px;
  padding: 26px 22px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-7px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(5, 150, 105, 0.25);
}

.stat-card:hover::after {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.stat-icon.icon-green {
  background: #ecfdf5;
  color: #059669;
}

.stat-icon.icon-blue {
  background: #eff6ff;
  color: #0284c7;
}

.stat-icon.icon-amber {
  background: #fffbeb;
  color: #d97706;
}

.stat-icon.icon-purple {
  background: #faf5ff;
  color: #7c3aed;
}

.stat-value {
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 800;
  color: var(--dark);
  line-height: 1.1;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

/* ================================================================
 * 6. SECTION HEADINGS & BADGES
 * ================================================================ */
.section-title {
  text-align: center;
  margin-bottom: 48px;
}

.section-tag {
  display: inline-block;
  background: #ecfdf5;
  color: var(--primary);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 6px 18px;
  border-radius: 50px;
  margin-bottom: 14px;
  border: 1px solid rgba(5, 150, 105, 0.15);
}

.section-heading {
  font-size: clamp(1.75rem, 3.5vw, 2.45rem);
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.custom-card {
  background: var(--light-surface);
  border-radius: 18px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.custom-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(5, 150, 105, 0.3);
}

/* Porsi Badges */
.badge-porsi-kecil {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 8px;
  border: 1px solid #bae6fd;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-porsi-besar {
  background: #fef3c7;
  color: #b45309;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 8px;
  border: 1px solid #fde68a;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ================================================================
 * 7. STRUKTUR ORGANISASI CARDS
 * ================================================================ */
.org-card {
  text-align: center;
  padding: 34px 22px;
  background: var(--light-surface);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
}

.org-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-glow);
}

.org-avatar-wrapper {
  width: 124px;
  height: 124px;
  margin: 0 auto 22px;
  position: relative;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.2);
}

.org-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: #e2e8f0;
  border: 3.5px solid #ffffff;
}

.org-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
  line-height: 1.3;
}

.org-role {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.885rem;
  letter-spacing: -0.01em;
}

/* Multi-Column Grid Responsive Utilities (Struktur Organisasi) */
@media (min-width: 1200px) {
  .row-cols-xl-5 > * {
    flex: 0 0 auto;
    width: 20%;
  }
  .row-cols-xl-6 > * {
    flex: 0 0 auto;
    width: 16.666667%;
  }
}

@media (min-width: 1400px) {
  .row-cols-xxl-8 > * {
    flex: 0 0 auto;
    width: 12.5%;
  }
}

/* Compact Org Card for Barisan 3 (Hingga 8 Card) */
.org-card-sm {
  padding: 16px 10px;
  border-radius: 14px;
}
.org-card-sm .org-avatar-wrapper {
  width: 68px;
  height: 68px;
  margin-bottom: 10px;
  padding: 2.5px;
}
.org-card-sm .org-name {
  font-size: 0.82rem;
  margin-bottom: 3px;
  line-height: 1.25;
}
.org-card-sm .org-role {
  font-size: 0.72rem;
  line-height: 1.2;
}

/* Tiered Structure Badges & Borders */
.border-pimpinan {
  border: 2px solid var(--primary) !important;
}
.border-mitra {
  border: 2px solid #0284c7 !important;
}

/* ================================================================
 * 8. LEAFLET MAPS & GEOLOCATION
 * ================================================================ */
#mapPenerima {
  height: 530px;
  width: 100%;
  border-radius: 16px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  z-index: 10;
}

.map-popup-custom {
  font-family: var(--font-main);
  padding: 4px;
  min-width: 200px;
}

.map-popup-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 5px;
  line-height: 1.25;
}

.map-popup-address {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ================================================================
 * 9. BUTTONS & FORMS
 * ================================================================ */
.btn {
  font-weight: 700;
  border-radius: 12px;
  padding: 10px 22px;
  transition: var(--transition);
  letter-spacing: -0.01em;
}

.btn-success {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.btn-success:hover,
.btn-success:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.35);
}

.btn-outline-success {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-success:hover,
.btn-outline-success:focus {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.25);
}

.btn-warning {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-warning:hover {
  background-color: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #ffffff;
  transform: translateY(-2px);
}

.form-control, .form-select {
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 11px 16px;
  font-size: 0.95rem;
  color: var(--text-main);
  background-color: #ffffff;
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px var(--primary-glow);
  outline: none;
}

/* ================================================================
 * 10. PAGE HEADER BANNERS (HIGH CONTRAST & HARMONY)
 * ================================================================ */
.page-header-banner {
  background: linear-gradient(135deg, #064e3b 0%, #0d4a3b 45%, #0f172a 100%);
  padding: clamp(55px, 7vw, 75px) 0 clamp(45px, 6vw, 65px);
  position: relative;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.page-header-tag {
  display: inline-block;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399 !important; /* Bright mint highlight on dark green/navy */
  font-weight: 800;
  font-size: 0.8rem;
  padding: 6px 18px;
  border-radius: 50px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  margin-bottom: 14px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.page-header-title {
  color: #ffffff !important;
  font-size: clamp(2rem, 4.2vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  line-height: 1.2;
}

.page-header-desc {
  color: #e2e8f0 !important; /* Crisp high-contrast readable luminous slate */
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  max-width: 660px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0;
  line-height: 1.75;
  font-weight: 400;
}

/* ================================================================
 * 11. FOOTER (HIGH CONTRAST TEXT)
 * ================================================================ */
.sppg-footer {
  background: #091322;
  color: #cbd5e1;
  padding: 75px 0 28px;
  border-top: 4px solid var(--primary);
}

.sppg-footer p,
.sppg-footer .text-secondary,
.sppg-footer .footer-text {
  color: #cbd5e1 !important; /* Always luminous and perfectly readable */
  line-height: 1.7;
}

.footer-brand h4 {
  color: #ffffff !important;
  font-weight: 800;
  font-size: 1.4rem;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.footer-heading {
  color: #ffffff !important;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 22px;
  position: relative;
  padding-bottom: 10px;
}

.footer-heading::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36px;
  height: 3px;
  background: var(--primary-light);
  border-radius: 2px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: #cbd5e1 !important;
  text-decoration: none;
  transition: var(--transition);
  font-size: 0.915rem;
  font-weight: 500;
}

.footer-links a:hover {
  color: #34d399 !important;
  transform: translateX(4px);
  display: inline-block;
}

.footer-bottom {
  margin-top: 55px;
  padding-top: 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: #94a3b8 !important;
}

.footer-bottom .text-secondary {
  color: #94a3b8 !important;
}

/* ================================================================
 * 11. RESPONSIVE BREAKPOINTS (MOBILE & TABLET EXCELLENCE)
 * ================================================================ */
@media (max-width: 991.98px) {
  .hero-wrapper {
    min-height: 72vh;
  }
  .hero-content {
    padding: 70px 0 50px;
    text-align: center;
  }
  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-badge {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-content .d-flex {
    justify-content: center;
  }
  #mapPenerima {
    height: 420px;
  }
  .sppg-footer {
    padding: 55px 0 25px;
  }
}

@media (max-width: 575.98px) {
  body {
    font-size: 0.925rem;
  }
  .stat-card {
    padding: 18px 14px;
  }
  .stat-icon {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
    margin-bottom: 12px;
  }
  .hero-title {
    font-size: 1.95rem;
  }
  #mapPenerima {
    height: 360px;
  }
}
