/* ==========================================================================
   Masjid Al-Hikmah PCV - Official Website Stylesheet
   Theme: Krem - Hijau - Emas (Harmoni Iman, Ilmu, dan Amal)
   Matching app.alhikmah-pcv.org Design System
   ========================================================================== */

:root {
  /* Surface Tokens (Krem Nuance) */
  --surface: #fcf9f2;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f6f3ec;
  --surface-container: #f1eee7;
  --surface-container-high: #ebe8e1;
  --surface-container-highest: #e5e2db;
  --surface-variant: #e5e2db;
  --surface-dim: #dcdad3;
  --surface-bright: #fcf9f2;

  /* Primary Tokens (Hijau Tua Islami) */
  --primary: #003626;
  --on-primary: #ffffff;
  --primary-container: #164e3b;
  --on-primary-container: #87bea6;
  --primary-fixed: #b6efd4;
  --primary-fixed-dim: #9bd2b9;
  --on-primary-fixed: #002116;
  --on-primary-fixed-variant: #18503d;

  /* Secondary Tokens (Emas Elegan) */
  --secondary: #775a19;
  --on-secondary: #ffffff;
  --secondary-container: #fed488;
  --on-secondary-container: #785a1a;
  --secondary-fixed: #ffdea5;
  --secondary-fixed-dim: #e9c176;
  --on-secondary-fixed: #261900;
  --on-secondary-fixed-variant: #5d4201;

  /* Tertiary & Neutral Tokens */
  --tertiary: #1c3328;
  --on-tertiary: #ffffff;
  --tertiary-container: #324a3e;
  --on-tertiary-container: #9eb9a9;
  --on-surface: #1c1c18;
  --on-surface-variant: #404944;
  --outline: #707974;
  --outline-variant: #c0c9c2;

  /* Status Tokens */
  --error: #ba1a1a;
  --error-container: #ffdad6;
  --on-error: #ffffff;
  --on-error-container: #93000a;
  --success: #1b6d4f;
  --success-container: #d2f4e3;

  /* Fonts */
  --font-serif: 'Noto Serif', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-arabic: 'Amiri', 'Noto Serif', serif;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Header Height */
  --app-bar-height: 4.25rem;
}

/* Base Styles */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--app-bar-height) + 1.25rem);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--on-surface);
  background-color: var(--surface);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Material Symbols Outlined */
.material-symbols-outlined,
.material-symbols-rounded {
  font-family: 'Material Symbols Outlined' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

/* Accessibility skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--primary);
  color: var(--on-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  z-index: 100;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--surface-container);
}
::-webkit-scrollbar-thumb {
  background: var(--outline-variant);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--outline);
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Header & Sticky App Bar */
.app-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--app-bar-height);
  z-index: 50;
  background: rgba(252, 249, 242, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(229, 226, 219, 0.7);
  transition: all 0.3s ease;
}
.app-bar.scrolled {
  background: rgba(252, 249, 242, 0.96);
  box-shadow: 0 4px 20px -4px rgba(0, 54, 38, 0.08);
  border-bottom-color: rgba(208, 201, 194, 0.9);
}

/* ==========================================================================
   Desktop Navigation Dropdowns
   ========================================================================== */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 16.5rem;
  background-color: var(--surface-container-lowest);
  border: 1px solid var(--surface-container-high);
  border-radius: var(--radius-xl);
  box-shadow: 0 14px 34px -4px rgba(0, 54, 38, 0.12), 0 4px 14px -2px rgba(0, 54, 38, 0.06);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.2s;
  z-index: 60;
}

.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-dropdown .dropdown-chevron {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown.open > .nav-dropdown-toggle {
  background-color: var(--surface-container);
  color: var(--primary);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-lg);
  color: var(--on-surface);
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.nav-dropdown-item:hover {
  background-color: rgba(0, 54, 38, 0.06); /* Soft green hover */
  color: var(--primary);
}

.nav-dropdown-item.active {
  background-color: rgba(0, 54, 38, 0.09) !important;
  color: var(--primary) !important;
}

.nav-dropdown-item.active .dropdown-icon-box {
  background-color: var(--primary) !important;
  color: var(--on-primary) !important;
}

/* Nav Active Highlights */
.nav-link.active {
  color: var(--primary) !important;
  font-weight: 600 !important;
  background-color: var(--surface-container) !important;
}

.nav-dropdown-toggle.active-parent {
  color: var(--primary) !important;
  font-weight: 600 !important;
}

.nav-dropdown-toggle.active-parent .dropdown-chevron {
  color: var(--primary) !important;
}

/* ==========================================================================
   Mobile Drawer Accordion
   ========================================================================== */
.drawer-accordion {
  border-radius: var(--radius-xl);
  transition: background-color 0.2s ease;
}

.drawer-accordion-btn {
  transition: background-color 0.2s ease, color 0.2s ease;
}

.drawer-accordion-btn .accordion-chevron {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-accordion.open > .drawer-accordion-btn {
  background-color: var(--surface-container);
  color: var(--primary);
}

.drawer-accordion.open > .drawer-accordion-btn .accordion-chevron {
  transform: rotate(180deg);
}

.drawer-accordion-btn.active-parent {
  color: var(--primary) !important;
  font-weight: 600 !important;
}

.drawer-accordion-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.drawer-accordion.open .drawer-accordion-content {
  opacity: 1;
}

.drawer-link.active {
  color: var(--primary) !important;
  background-color: var(--surface-container) !important;
  font-weight: 600 !important;
}

.drawer-link.active .material-symbols-outlined {
  color: var(--primary) !important;
}

/* Mobile Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 28, 24, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(85vw, 340px);
  background: var(--surface);
  z-index: 70;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 28px rgba(0, 54, 38, 0.15);
}
.mobile-drawer.open {
  transform: translateX(0);
}

/* Reveal on Scroll Animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal.delay-1 {
  transition-delay: 0.12s;
}
.reveal.delay-2 {
  transition-delay: 0.24s;
}
.reveal.delay-3 {
  transition-delay: 0.36s;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Section Header Badge / Kicker */
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-full);
  background-color: rgba(22, 78, 59, 0.08);
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(22, 78, 59, 0.14);
}

/* Section Title Accent */
.section-title-accent {
  display: block;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--secondary-container), var(--primary));
  border-radius: 9999px;
  margin: 0.75rem auto 1.25rem;
}

/* Hero Badge */
.hero-badge-wrap {
  display: inline-flex;
}
.hero-badge-wrap .section-kicker {
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--secondary-fixed);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Prayer Time Cards */
.prayer-card {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.prayer-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -6px rgba(0, 54, 38, 0.12);
}
.prayer-card.current {
  background: linear-gradient(145deg, #003626, #164e3b) !important;
  color: #ffffff !important;
  border-color: #2a6850 !important;
  box-shadow: 0 12px 28px -4px rgba(0, 54, 38, 0.28) !important;
  transform: translateY(-4px) scale(1.02);
}
.prayer-card.current .prayer-icon-wrap {
  background-color: rgba(255, 255, 255, 0.16);
  color: var(--secondary-fixed);
}
.prayer-card.current .prayer-name {
  color: #ffffff;
}
.prayer-card.current .prayer-time {
  color: var(--secondary-fixed);
}
.prayer-card.current .prayer-status-chip {
  background-color: var(--secondary-container);
  color: var(--on-secondary-container);
  font-weight: 700;
}

/* Copy Account Number Button feedback */
.btn-copy.copied {
  background-color: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
}

/* Floating Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px -2px rgba(0, 54, 38, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--primary-container);
  box-shadow: 0 8px 24px rgba(0, 54, 38, 0.4);
  transform: translateY(-2px);
}

/* Agenda & Kegiatan Cards */
.agenda-card {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s ease,
              background-color 0.2s ease;
}
.agenda-card:hover {
  transform: translateY(-3px);
}

/* Line Clamp Utilities */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Print Stylesheet for Laporan Keuangan */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .app-bar,
  .mobile-drawer,
  .drawer-backdrop,
  .back-to-top,
  .no-print {
    display: none !important;
  }
  main {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  .print-page-break {
    page-break-before: always;
  }
  .shadow-sm, .shadow, .shadow-md, .shadow-lg, .shadow-xl {
    box-shadow: none !important;
    border: 1px solid #dcdad3 !important;
  }
}
