/* ================================
   CUSTOM STYLES - Modern Tuition Centre
   ================================ */

/* --- Preloader --- */
.loader {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.dark .loader {
  border-color: #334155;
  border-top-color: #60a5fa;
}

/* --- Hero Shapes --- */
.hero-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
}
.shape-1 {
  width: 500px; height: 500px;
  background: #3b82f6;
  top: -200px; right: -200px;
  animation: float 8s ease-in-out infinite;
}
.shape-2 {
  width: 400px; height: 400px;
  background: #10b981;
  bottom: -150px; left: -150px;
  animation: float 10s ease-in-out infinite reverse;
}
.shape-3 {
  width: 300px; height: 300px;
  background: #8b5cf6;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: float 7s ease-in-out infinite 1s;
}
.dark .hero-shape { opacity: 0.1; }

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); }
  33% { transform: translateY(-30px) translateX(20px); }
  66% { transform: translateY(20px) translateX(-20px); }
}

/* --- Navigation --- */
.nav-link {
  position: relative;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563;
  transition: color 0.2s;
  border-radius: 0.5rem;
}
.dark .nav-link { color: #94a3b8; }
.nav-link:hover,
.nav-link.active { color: #2563eb; }
.dark .nav-link:hover,
.dark .nav-link.active { color: #60a5fa; }
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: #3b82f6;
  transition: all 0.3s;
  transform: translateX(-50%);
  border-radius: 1px;
}
.nav-link:hover::after,
.nav-link.active::after { width: 60%; }

/* Header scrolled state */
#header.scrolled {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.dark #header.scrolled {
  background: rgba(15,23,42,0.95);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Mobile menu links */
.mobile-link {
  display: block;
  padding: 0.75rem 1rem;
  font-weight: 500;
  color: #374151;
  border-radius: 0.5rem;
  transition: all 0.2s;
}
.dark .mobile-link { color: #cbd5e1; }
.mobile-link:hover {
  background: #f3f4f6;
  color: #2563eb;
}
.dark .mobile-link:hover {
  background: rgba(59,130,246,0.1);
  color: #60a5fa;
}

/* --- Smooth animations --- */
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Selection --- */
::selection {
  background: #3b82f6;
  color: white;
}
.dark ::selection {
  background: #60a5fa;
  color: #0f172a;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
.dark ::-webkit-scrollbar-track { background: #1e293b; }
::-webkit-scrollbar-thumb { background: #93c5fd; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #60a5fa; }
.dark ::-webkit-scrollbar-thumb { background: #334155; }
.dark ::-webkit-scrollbar-thumb:hover { background: #475569; }

/* --- Form Inputs --- */
input:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px white inset !important;
}
.dark input:-webkit-autofill,
.dark textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px #1e293b inset !important;
  -webkit-text-fill-color: #e2e8f0 !important;
}

/* --- WhatsApp Pulse --- */
#whatsappBtn {
  animation: whatsappPulse 2s ease-in-out infinite;
}
@keyframes whatsappPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50% { box-shadow: 0 0 0 14px rgba(34,197,94,0); }
}

/* --- Results Row --- */
.results-table tbody tr {
  transition: background 0.2s;
}

/* --- Back to top visibility --- */
#backToTop.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
