/* ==========================================================================
   STYLE BERSIH, RAMAH LANSIA & ESTETIK - KBIHU 'AISYIYAH
   ========================================================================== */

:root {
  --hijau-aisyiyah: #006b3f;
  --hijau-tua: #004d2c;
  --hijau-muda: #e8f5ed;
  --emas: #d4af37;
  --emas-terang: #ffd700;
  --emas-muda: #fff9e6;
  --putih: #ffffff;
  --abu-bg: #f4f7f5;
  --abu-kartu: #ffffff;
  --abu-border: #d4ded7;
  --teks-gelap: #111e16;
  --teks-sedang: #475a4f;
  --merah-aksi: #c62828;
  --merah-hover: #b71c1c;
  --wa-green: #25d366;
  
  --shadow-sm: 0 2px 8px rgba(0, 50, 25, 0.06);
  --shadow-md: 0 6px 18px rgba(0, 50, 25, 0.09);
  --shadow-lg: 0 12px 28px rgba(0, 50, 25, 0.15);
  --radius-md: 14px;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--abu-bg);
  color: var(--teks-gelap);
  font-size: 15px;
  line-height: 1.55;
  padding-bottom: 4rem;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   HEADER UTAMA BERSIH & PROPORSIONAL
   ========================================================================== */
.site-header {
  max-width: 760px;
  margin: 1.2rem auto 0.8rem auto;
  padding: 0 16px;
}

.header-content {
  background: var(--putih);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  border-top: 5px solid var(--hijau-aisyiyah);
  border-left: 1.5px solid var(--abu-border);
  border-right: 1.5px solid var(--abu-border);
  border-bottom: 1.5px solid var(--abu-border);
}

.logo-wrapper {
  margin-bottom: 0.5rem;
}

.site-logo {
  height: 62px;
  width: auto;
  display: inline-block;
}

.badge-year {
  display: inline-block;
  background: var(--emas-muda);
  color: #8c6a00;
  border: 1px solid var(--emas);
  padding: 3px 12px;
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  letter-spacing: 0.5px;
}

h1 {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--hijau-aisyiyah);
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--emas);
  margin-bottom: 0.8rem;
}

.instruction-badge {
  background-color: #fffae6;
  color: #2b1f00;
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1.5px solid var(--emas);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
  line-height: 1.35;
}

/* ==========================================================================
   TIMELINE CONTAINER & CARDS
   ========================================================================== */
.main-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  position: relative;
  padding-left: 1.5rem;
  margin-top: 0.8rem;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 18px;
  width: 4px;
  background: #cbdcd1;
  border-radius: 4px;
  z-index: 0;
}

/* LOADING & EMPTY STATE */
.loading-state, .empty-state {
  background: var(--putih);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  border: 2px solid var(--abu-border);
  box-shadow: var(--shadow-sm);
  margin-left: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: var(--hijau-aisyiyah);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  margin: 0 auto 1rem auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* KARTU AGENDA */
.agenda-card {
  background: var(--abu-kartu);
  border-radius: var(--radius-lg);
  border: 2px solid var(--abu-border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  margin-left: 1.1rem;
  z-index: 1;
  transition: all 0.22s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.agenda-card:hover {
  border-color: var(--hijau-aisyiyah);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-connector-dot {
  position: absolute;
  left: -2.45rem;
  top: 30px;
  width: 24px;
  height: 24px;
  background: #cbdcd1;
  border: 4px solid var(--abu-bg);
  border-radius: 50%;
  z-index: 2;
  transition: all 0.3s ease;
}

.agenda-card.is-viewed {
  border-color: var(--hijau-aisyiyah);
}

.agenda-card.is-viewed .card-connector-dot {
  background: var(--emas);
  border-color: var(--hijau-aisyiyah);
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

/* MEDIA COVER BOX */
.card-media-box {
  position: relative;
  width: 100%;
  height: 240px;
  background: #002817;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1.5px solid var(--abu-border);
}

.card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.agenda-card:hover .card-cover-img {
  transform: scale(1.03);
}

.card-badge-num {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--emas);
  color: #00361c;
  font-size: 0.85rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.card-badge-count {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-badge-date {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 40, 20, 0.92);
  color: #ffd700;
  border: 1.2px solid var(--emas);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

/* KONTEN KARTU */
.card-body {
  padding: 1.1rem 1.2rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--teks-gelap);
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.agenda-card.is-viewed .card-title {
  color: var(--hijau-aisyiyah);
}

.card-desc {
  font-size: 0.92rem;
  color: var(--teks-sedang);
  line-height: 1.55;
  margin-bottom: 1rem;
}

/* TOMBOL BUKA AGENDA BESAR */
.btn-open-agenda {
  background: linear-gradient(135deg, var(--hijau-aisyiyah), var(--hijau-tua));
  color: #ffffff;
  border: 1.5px solid var(--emas);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
  font-weight: 800;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 107, 63, 0.2);
  transition: all 0.2s ease;
  min-height: 44px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.btn-open-agenda:hover {
  background: linear-gradient(135deg, var(--hijau-tua), #00361c);
  color: #ffd700;
  transform: translateY(-2px);
}

.agenda-card.is-viewed .btn-open-agenda {
  background: #254a37;
  border-color: #8bbfa3;
}

/* ==========================================================================
   MODAL POPUP FULL SCREEN (FOTO & VIDEO MAKSIMAL)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  background: #050a07;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: none;
}

/* 1. HEADER FULL SCREEN */
.modal-header {
  background: var(--hijau-aisyiyah);
  padding: 0.9rem 1.4rem;
  border-bottom: 3px solid var(--emas);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  z-index: 20;
}

.modal-header-info {
  flex: 1;
}

.modal-date {
  color: #ffd700;
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.25;
  color: #ffffff;
}

.btn-close-header {
  background: var(--merah-aksi);
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s;
}

.btn-close-header:hover {
  background: var(--merah-hover);
}

/* 2. MEDIA VIEWER FULL SCREEN & TOMBOL GESER */
.modal-media-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.media-viewer {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.media-viewer img,
.media-viewer video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  box-shadow: 0 0 30px rgba(0,0,0,0.8);
  border-radius: 4px;
}

/* TOMBOL SLIDER BESAR DAN JELAS */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #ffd700;
  border: 3px solid var(--emas);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 2.2rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  box-shadow: 0 4px 20px rgba(0,0,0,0.7);
  transition: all 0.2s ease;
}

.slider-btn:hover {
  background: var(--hijau-aisyiyah);
  color: #ffffff;
  transform: translateY(-50%) scale(1.1);
}

.slider-btn.prev { left: 16px; }
.slider-btn.next { right: 16px; }

.slider-counter {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(0, 0, 0, 0.85);
  color: #ffd700;
  border: 1.5px solid var(--emas);
  font-size: 0.95rem;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 20px;
  z-index: 15;
}

/* 3. FOOTER MODAL (KETERANGAN SINGKAT & TOMBOL TUTUP) */
.modal-footer {
  background: #111a13;
  padding: 1rem 1.4rem 1.2rem 1.4rem;
  border-top: 2px solid #233527;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  flex-shrink: 0;
  max-height: 35vh;
  overflow-y: auto;
}

.modal-desc-card {
  background: rgba(255, 255, 255, 0.08);
  border-left: 5px solid var(--emas);
  border-radius: 8px;
  padding: 0.8rem 1.1rem;
}

.modal-desc-text {
  font-size: 1.1rem;
  color: #f1f5f2;
  line-height: 1.55;
  font-weight: 600;
}

/* TOMBOL TUTUP UTAMA BESAR */
.btn-close-main {
  background: var(--merah-aksi);
  color: #ffffff;
  border: 2px solid #ff8a80;
  border-radius: 12px;
  padding: 1rem;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 18px rgba(198, 40, 40, 0.45);
  transition: all 0.2s;
  min-height: 52px;
  text-transform: uppercase;
}

.btn-close-main:hover {
  background: var(--merah-hover);
  transform: translateY(-2px);
}

/* ==========================================================================
   FLOATING ACTIONS (WHATSAPP & SCROLL TOP)
   ========================================================================== */
.floating-actions {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 99;
}

.btn-floating {
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.2s;
}

.btn-floating:hover {
  transform: scale(1.06);
}

.btn-wa {
  background: var(--wa-green);
  color: #ffffff;
  border: 2px solid #ffffff;
  padding: 12px 20px;
  font-size: 1rem;
}

.btn-wa .wa-icon {
  font-size: 1.3rem;
}

.btn-scroll-top {
  background: var(--hijau-aisyiyah);
  color: #ffffff;
  border: 2px solid var(--emas);
  padding: 8px 16px;
  font-size: 0.95rem;
}

/* ==========================================================================
   FOOTER RESMI
   ========================================================================== */
.site-footer {
  background: #002817;
  color: #ffffff;
  padding: 2.5rem 1.5rem 4rem 1.5rem;
  text-align: center;
  margin-top: 3rem;
  border-top: 5px solid var(--emas);
}

.footer-inner {
  max-width: 600px;
  margin: 0 auto;
}

.footer-logo {
  height: 60px;
  margin-bottom: 0.8rem;
}

.footer-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #ffd700;
}

.footer-subtitle {
  font-size: 1rem;
  color: #d1ded7;
  margin-bottom: 1rem;
}

.footer-copy {
  font-size: 0.9rem;
  color: #8ea89a;
}

.footer-admin-link {
  margin-top: 1.2rem;
}

.footer-admin-link a {
  color: #ffd700;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVE SMARTPHONE & TABLET
   ========================================================================== */
@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .site-header {
    margin-top: 0.8rem;
    padding: 0 10px;
  }
  
  .header-content {
    padding: 1.1rem 0.9rem;
  }
  
  .site-logo {
    height: 54px;
  }

  h1 {
    font-size: 1.2rem;
  }

  h2 {
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
  }

  .instruction-badge {
    font-size: 0.82rem;
    padding: 0.4rem 0.8rem;
  }
  
  .timeline-container {
    padding-left: 0.5rem;
    gap: 1.2rem;
  }
  
  .timeline-container::before {
    left: 8px;
  }
  
  .card-connector-dot {
    left: -1.5rem;
    width: 20px;
    height: 20px;
    top: 22px;
  }
  
  .agenda-card {
    margin-left: 0.5rem;
  }
  
  .card-media-box {
    height: 190px;
  }

  .card-body {
    padding: 0.9rem 1rem;
  }

  .card-title {
    font-size: 1.05rem;
  }

  .card-desc {
    font-size: 0.88rem;
  }

  .btn-open-agenda {
    font-size: 0.85rem;
    padding: 0.65rem 0.8rem;
    min-height: 40px;
  }
  
  .modal-media-wrapper {
    flex: 1;
    height: auto;
    min-height: 0;
  }
  
  .slider-btn {
    width: 46px;
    height: 46px;
    font-size: 1.6rem;
  }
  
  .slider-btn.prev { left: 8px; }
  .slider-btn.next { right: 8px; }

  .modal-header {
    padding: 0.7rem 1rem;
  }

  .modal-title {
    font-size: 1.1rem;
  }
  
  .modal-desc-text {
    font-size: 0.92rem;
  }

  .btn-close-main {
    font-size: 1rem;
    padding: 0.8rem;
    min-height: 44px;
  }
}
