/* ==========================================================================
   REA Abacus & Tuition Point - Custom Stylesheet
   Modern, Friendly & High-Performance Design System
   ========================================================================== */

:root {
  --primary-blue: #1e40af;
  --primary-blue-dark: #1e3a8a;
  --primary-blue-light: #3b82f6;
  --accent-amber: #f59e0b;
  --accent-amber-light: #fef3c7;
  --accent-orange: #f97316;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --bg-soft: #f8fafc;
  --border-light: #e2e8f0;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Typography Enhancements */
.font-display {
  font-family: 'Outfit', sans-serif;
}

/* Gradient Texts */
.text-gradient-primary {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-amber {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 50%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Floating Animations */
@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

.animate-float-delayed {
  animation: float 5s ease-in-out 2s infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2), 0 0 30px rgba(59, 130, 246, 0.15);
  }
  50% {
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.4), 0 0 45px rgba(59, 130, 246, 0.3);
  }
}

.glow-effect {
  animation: pulseGlow 3s infinite;
}

/* Badge Badges & Tags */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.825rem;
  font-weight: 600;
}

/* Abacus Interactive Simulator Styles */
.abacus-frame {
  background: linear-gradient(145deg, #451a03 0%, #78350f 50%, #451a03 100%);
  border: 12px solid #291205;
  border-radius: 18px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5), inset 0 2px 6px rgba(255, 255, 255, 0.15);
  position: relative;
  user-select: none;
}

.abacus-beam {
  height: 14px;
  background: linear-gradient(180deg, #1c0d02 0%, #381a05 50%, #1c0d02 100%);
  border-top: 2px solid #522504;
  border-bottom: 2px solid #0f0701;
  position: relative;
  z-index: 10;
}

.abacus-rod {
  position: relative;
  background: linear-gradient(90deg, #9ca3af 0%, #e5e7eb 50%, #9ca3af 100%);
  box-shadow: inset 1px 0 2px rgba(0,0,0,0.3);
}

/* Abacus Beads (Bi-conical Soroban shape) */
.abacus-bead {
  position: absolute;
  width: 44px;
  height: 24px;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  transition: top 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.1s ease;
  z-index: 20;
}

.abacus-bead:hover {
  filter: brightness(1.1);
}

.abacus-bead:active {
  transform: translateX(-50%) scale(0.96);
}

.bead-body {
  width: 100%;
  height: 100%;
  border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
  background: radial-gradient(circle at 35% 30%, #fde047 0%, #d97706 70%, #78350f 100%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.6);
  position: relative;
}

/* Reckoning dot on the beam */
.beam-dot {
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 4px #ffffff;
}

/* Modal transition styles */
.modal-backdrop {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  transition: opacity 0.25s ease-out;
}

/* Glass Card */
.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.dark-glass-card {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Custom Checkmark */
.custom-list-item {
  position: relative;
  padding-left: 1.8rem;
}

.custom-list-item::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: #10b981;
  font-weight: 800;
  font-size: 1.1rem;
}

/* Card Hover Lift */
.hover-lift {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Toast Notification */
#toast-notification {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Site Header & Navigation
   Desktop tray from 1024px up; slide-in drawer below that.
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.25);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 80rem;
  height: 4.5rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header__actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.5rem;
}

/* Logo */
.site-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.625rem;
  border-radius: 0.75rem;
}

.site-logo__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

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

.site-logo__mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.site-logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  white-space: nowrap;
}

.site-logo__name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-dark);
}

.site-logo__name { color: #0b2a5b; }

.site-logo__path span:nth-child(1) { color: #e6157a; }
.site-logo__path span:nth-child(2) { color: #f7931e; }
.site-logo__path span:nth-child(3) { color: #3aaa35; }
.site-logo__path span:nth-child(4) { color: #1c8fd8; }

.site-logo__tag {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Desktop link tray */
.site-nav {
  display: none;
  align-items: center;
  gap: 0.125rem;
  padding: 0.25rem;
  border-radius: 9999px;
  background: #f1f5f9;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  padding: 0.5rem 0.8125rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  color: #475569;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav__link:hover {
  color: var(--text-dark);
  background: #e2e8f0;
}

.site-nav__link[aria-current="page"] {
  color: var(--primary-blue);
  background: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

.site-nav__spark {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--accent-amber);
}

/* WhatsApp call to action */
.nav-cta {
  display: none;
  align-items: center;
  gap: 0.4375rem;
  padding: 0.625rem 1rem;
  border-radius: 9999px;
  background: #047857;
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.nav-cta:hover {
  background: #065f46;
}

.nav-cta svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

/* Hamburger and drawer close share one 44px button */
.nav-toggle,
.nav-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  color: var(--text-dark);
  transition: background-color 0.15s ease;
}

.nav-toggle:hover,
.nav-drawer__close:hover {
  background: #f1f5f9;
}

.nav-toggle svg,
.nav-drawer__close svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Drawer: sits above the floating WhatsApp pill (z-50) */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  visibility: hidden;
  transition: visibility 0s linear 0.28s;
}

.nav-drawer.is-open {
  visibility: visible;
  transition-delay: 0s;
}

.nav-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.nav-drawer.is-open .nav-drawer__backdrop {
  opacity: 1;
}

.nav-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(22rem, 86vw);
  padding: 0.875rem 1rem calc(1rem + env(safe-area-inset-bottom));
  background: #ffffff;
  box-shadow: -16px 0 40px -16px rgba(15, 23, 42, 0.4);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-drawer.is-open .nav-drawer__panel {
  transform: translateX(0);
}

.nav-drawer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.nav-drawer__links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0;
}

.nav-drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3rem;
  padding: 0 0.875rem;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  transition: background-color 0.15s ease;
}

.nav-drawer__link:hover {
  background: #f1f5f9;
}

.nav-drawer__link[aria-current="page"] {
  background: #eff6ff;
  color: var(--primary-blue);
  font-weight: 700;
}

.nav-drawer__chip {
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: var(--accent-amber-light);
  color: #92400e;
  font-size: 0.6875rem;
  font-weight: 700;
}

.nav-drawer__contact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border-light);
}

.nav-drawer__action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  border-radius: 0.75rem;
  background: #f1f5f9;
  color: var(--text-dark);
  font-size: 0.875rem;
  font-weight: 700;
}

.nav-drawer__action--whatsapp {
  background: #047857;
  color: #ffffff;
}

.nav-drawer__action svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: currentColor;
}

.site-logo:focus-visible,
.site-nav__link:focus-visible,
.nav-cta:focus-visible,
.nav-toggle:focus-visible,
.nav-drawer__close:focus-visible,
.nav-drawer__link:focus-visible,
.nav-drawer__action:focus-visible {
  outline: 2px solid var(--primary-blue-light);
  outline-offset: 2px;
}

@media (min-width: 640px) {
  .site-header__inner {
    padding: 0 1.5rem;
  }

  .nav-cta {
    display: inline-flex;
  }
}

@media (min-width: 1024px) {
  .site-header__inner {
    padding: 0 2rem;
  }

  .site-nav {
    display: flex;
  }

  .nav-toggle,
  .nav-drawer {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-logo__mark,
  .nav-drawer,
  .nav-drawer__backdrop,
  .nav-drawer__panel {
    transition: none;
  }
}
