:root {
  --primary: #075e54;
  --primary-dark: #054a42;
  --accent: #d4af37;
  --accent-dark: #b8962e;
}
html { scroll-behavior: smooth; }
body { font-family: 'Poppins', system-ui, -apple-system, sans-serif; background: #f8faf9; color: #1e293b; }
.font-amiri { font-family: 'Amiri', serif; }
.text-primary { color: var(--primary); }
.bg-primary { background: var(--primary); }
.bg-primary-dark { background: var(--primary-dark); }
.border-primary { border-color: var(--primary); }
.hover\:bg-primary-dark:hover { background: var(--primary-dark); }
.animate-fadeIn { animation: fadeIn 0.45s ease-out; }
@keyframes fadeIn { from { opacity:0; transform: translateY(8px);} to { opacity:1; transform: translateY(0);} }
.glass { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.skeleton { background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.donation-form { transition: all 0.3s ease; }
.donation-form input:invalid, .donation-form textarea:invalid { border-color: #ef4444; }
.donation-form input:focus, .donation-form textarea:focus { box-shadow: 0 0 0 2px rgba(7,94,84,0.2); }
#qris-grid { align-items: start; }

.wa-float-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}
.wa-float-wrapper .wa-float,
.wa-float-wrapper .wa-copy-bubble {
  pointer-events: auto;
}

.wa-float-group {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  pointer-events: auto;
}

.wa-float {
  width: 60px;
  height: 60px;
  background: #25D366;
  color: #fff;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.wa-float--ambulance {
  background: #25D366;
}

.wa-float--dkm {
  background: var(--primary);
}

.wa-float--dkm::after {
  border-color: var(--primary);
}

.wa-float.hidden {
  display: none !important;
}

.wa-float:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.wa-float:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.wa-float::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 2px solid #25D366;
  animation: wa-pulse 2s infinite;
}

@keyframes wa-pulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.4); opacity: 0; }
}

.wa-tooltip {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 8px;
  background: #1e293b;
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
}

.wa-tooltip--dkm {
  right: auto;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
}
.wa-float--dkm:hover .wa-tooltip--dkm {
  transform: translateX(-50%) translateY(0);
}

.wa-float:hover .wa-tooltip,
.wa-float:focus-within .wa-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.wa-copy-bubble {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  cursor: pointer;
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  white-space: nowrap;
  animation: wa-float-permanent 3s ease-in-out infinite;
  transition: opacity 0.2s, transform 0.2s, background 0.3s;
}
.wa-copy-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 18px;
  border-width: 6px;
  border-style: solid;
  border-color: var(--primary) transparent transparent transparent;
}
.wa-copy-bubble:hover {
  transform: translateY(-1px);
}

@keyframes wa-float-permanent {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.wa-copy-bubble.copied {
  background: var(--primary-dark);
}
.wa-copy-bubble.copied::after {
  border-color: var(--primary-dark) transparent transparent transparent;
}

.wa-copy-bubble.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .wa-float-wrapper {
    bottom: 16px;
    right: 16px;
  }
  .wa-float-group {
    gap: 10px;
  }
  .wa-float {
    width: 56px;
    height: 56px;
  }
  .wa-copy-bubble {
    font-size: 10px;
    padding: 5px 10px;
  }
  .wa-tooltip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wa-float::after {
    animation: none;
  }
  .wa-copy-bubble {
    animation: none;
  }
  .wa-tooltip {
    transition: none;
  }
}

.prayer-active, .prayer-next {
  color: white !important;
}
.prayer-active .text-\[10px\], .prayer-next .text-\[10px\] {
  opacity: 1 !important;
  color: rgba(255,255,255,0.9) !important;
}
.prayer-active .text-sm, .prayer-next .text-sm {
  color: white !important;
}
.prayer-upcoming {
  color: white !important;
}
.prayer-countdown {
  font-variant-numeric: tabular-nums;
}
#wilayah-select {
  backdrop-filter: blur(6px);
}
/* .hero-glass {
  background: rgba(255,255,255,0.10);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.18);
} */
.hero-text-shadow {
  text-shadow: 0 2px 12px rgba(0,0,0,0.45);
}
.hero-select option {
  background: #1e293b;
  color: white;
}
.prayer-tile {
  transition: all 0.3s ease;
}
/* .prayer-single-card {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.prayer-next-single {
  animation: prayerPulse 2s ease-in-out infinite;
}
.prayer-next {
  animation: prayerPulse 2s ease-in-out infinite;
}
@keyframes prayerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251,191,36,0.2); }
  50% { box-shadow: 0 0 12px 4px rgba(251,191,36,0.15); }
} */
.digital-clock {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
#digital-clock {
  color: white;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
/* .ashar-active {
  background: rgba(255,255,255,0.15) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(255,255,255,0.3) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.ashar-passed {
  background: rgba(255,255,255,0.1) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: rgba(255,255,255,0.15) !important;
  opacity: 0.6;
} */
/* @media (max-width: 360px) {
  #prayer-next-card, #digital-clock-wrap {
    min-height: 100px;
  }
} */
.hero-prayer-grid > div { height: 100%; }

.committee-card {
  transition: all 0.2s ease;
}
.committee-card:hover {
  transform: translateY(-2px);
}

.phone-link {
  transition: all 0.2s ease;
}

.wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
}
.wa-btn:hover {
  background: #059669;
  color: #fff;
  border-color: #059669;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Finance donut chart - mobile enlarge */
.finance-chart-wrap {
  width: 100%;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}
#financeChart {
  width: 100% !important;
  height: auto !important;
  max-width: 340px;
  max-height: 340px;
}
@media (max-width: 640px) {
  .finance-chart-wrap {
    max-width: 320px;
  }
  #financeChart {
    max-width: 90vw;
    max-height: 90vw;
  }
}
@media (max-width: 380px) {
  .finance-chart-wrap {
    max-width: 280px;
  }
}

/* Dana Lock badge styles */
.badge-approved {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.badge-rejected {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.badge-pending {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.badge-released {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

/* ============================================================
   HORIZONTAL SWIPE - Geser Kanan Kiri (Mobile)
   Memungkinkan layar/section digeser horizontal via touch/drag
   ============================================================ */
.swipe-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}
.swipe-scroll::-webkit-scrollbar { display: none; }
.swipe-scroll:active { cursor: grabbing; }
.swipe-scroll > * { scroll-snap-align: start; scroll-snap-stop: always; }

/* Global: cegah overflow horizontal yang tidak diinginkan, tapi izinkan swipe di container */
html { overflow-x: hidden; }
body { overscroll-behavior-x: contain; }

/* Indikator swipe */
.swipe-hint {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 8px;
}
.swipe-hint i { font-size: 10px; }

@media (max-width: 768px) {
  .swipe-hint { display: flex; }

  /* Announcements: kartu geser horizontal */
  #announcements-list {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding-bottom: 12px;
    padding-right: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
  }
  #announcements-list::-webkit-scrollbar { display: none; }
  #announcements-list > * {
    flex: 0 0 85% !important;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  /* Galeri: foto geser horizontal */
  #gallery-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding-bottom: 12px;
    padding-right: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
  }
  #gallery-grid::-webkit-scrollbar { display: none; }
  #gallery-grid > * {
    flex: 0 0 85% !important;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  /* Program: 4 kartu geser */
  #programs-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding-bottom: 12px;
    padding-right: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
  }
  #programs-grid::-webkit-scrollbar { display: none; }
  #programs-grid > * {
    flex: 0 0 78% !important;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  /* Pengurus: kartu geser */
  #committees-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding-bottom: 12px;
    padding-right: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
  }
  #committees-grid::-webkit-scrollbar { display: none; }
  #committees-grid > * {
    flex: 0 0 78% !important;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  /* QRIS Donasi: kartu geser */
  #qris-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    padding-bottom: 12px;
    padding-right: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
  }
  #qris-grid::-webkit-scrollbar { display: none; }
  #qris-grid > * {
    flex: 0 0 85% !important;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  /* Tabel finance & ambulance: tetap bisa geser horizontal */
  .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
  }

  /* Tentang 3 pilar juga bisa digeser */
  #tentang .grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding-bottom: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
  }
  #tentang .grid::-webkit-scrollbar { display: none; }
  #tentang .grid > * {
    flex: 0 0 85% !important;
    scroll-snap-align: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .swipe-scroll, #announcements-list, #gallery-grid, #programs-grid, #qris-grid, #committees-grid {
    scroll-behavior: auto;
  }
}
