/* ============================================
   EduCore — Custom Styles
   Beyond Tailwind: animations, textures, dividers
   ============================================ */

/* ---------- Root variables ---------- */
:root {
  --brand-indigo: #4F46E5;
  --brand-indigo-dark: #3730A3;
  --brand-saffron: #F59E0B;
  --brand-emerald: #10B981;
  --slate-900: #0F172A;
  --slate-50: #F8FAFC;
}

/* ---------- Smooth scroll ---------- */
html {
  scroll-behavior: smooth;
}

/* ---------- Selection colour ---------- */
::selection {
  background: rgba(79, 70, 229, 0.15);
  color: #3730A3;
}

/* ---------- Circuit-board dot pattern ---------- */
.bg-dots {
  background-image: radial-gradient(circle, #cbd5e1 1px, transparent 1px);
  background-size: 24px 24px;
}

.bg-dots-light {
  background-image: radial-gradient(circle, rgba(203, 213, 225, 0.4) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ---------- Gradient orbs (hero backgrounds) ---------- */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.orb-indigo {
  background: var(--brand-indigo);
}

.orb-saffron {
  background: var(--brand-saffron);
}

.orb-emerald {
  background: var(--brand-emerald);
}

/* ---------- Section wave dividers ---------- */
.wave-divider {
  position: relative;
  overflow: hidden;
}

.wave-divider::after {
  content: '';
  display: block;
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 64px;
  background: inherit;
}

.wave-top svg,
.wave-bottom svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Card hover lift ---------- */
.card-lift {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -12px rgba(79, 70, 229, 0.15);
}

/* ---------- Button glow on hover ---------- */
.btn-glow {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--brand-indigo), var(--brand-emerald));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  filter: blur(12px);
}

.btn-glow:hover::after {
  opacity: 0.5;
}

/* ---------- Animated gradient border ---------- */
.gradient-border {
  position: relative;
  background: white;
  border-radius: 1rem;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(1rem + 2px);
  background: linear-gradient(135deg, var(--brand-indigo), var(--brand-saffron), var(--brand-emerald), var(--brand-indigo));
  background-size: 300% 300%;
  animation: gradientShift 6s ease infinite;
  z-index: -1;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---------- Scroll-reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.12s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.19s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.26s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.33s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.40s; }

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Step number styling ---------- */
.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 1rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--brand-indigo), #7C3AED);
  flex-shrink: 0;
}

/* ---------- Comparison table zebra ---------- */
.comparison-row:nth-child(even) {
  background-color: var(--slate-50);
}

/* ---------- FAQ accordion ---------- */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s ease;
  padding-top: 0;
  padding-bottom: 0;
}

.faq-answer.open {
  padding-top: 0.75rem;
  padding-bottom: 1rem;
}

.faq-chevron {
  transition: transform 0.3s ease;
}

.faq-chevron.rotate {
  transform: rotate(180deg);
}

/* ---------- Pricing toggle ---------- */
.pricing-toggle-track {
  width: 56px;
  height: 28px;
  border-radius: 14px;
  background: #CBD5E1;
  position: relative;
  cursor: pointer;
  transition: background 0.3s ease;
}

.pricing-toggle-track.active {
  background: var(--brand-indigo);
}

.pricing-toggle-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.pricing-toggle-track.active .pricing-toggle-thumb {
  left: 31px;
}

/* ---------- Code block styling ---------- */
.code-block {
  background: #1E1B3A;
  border-radius: 0.75rem;
  overflow: hidden;
}

.code-block-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ---------- Floating animation ---------- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

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

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

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

/* ---------- Pulse ring ---------- */
@keyframes pulseRing {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.6); opacity: 0; }
}

.pulse-ring::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid var(--brand-indigo);
  animation: pulseRing 2s ease-out infinite;
}

/* ---------- Nav scroll state ---------- */
.nav-scrolled {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ---------- Mobile menu ---------- */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.open {
  max-height: 400px;
}

/* Give nav a solid background when mobile menu is open */
.nav-mobile-open {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ---------- Tag / badge pill ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* ---------- Feature tab indicator ---------- */
.tab-active {
  position: relative;
}

.tab-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--brand-indigo);
}

/* ---------- Stat counter ---------- */
.stat-value {
  font-variant-numeric: tabular-nums;
}

/* ---------- Form focus ring ---------- */
.form-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  border-color: var(--brand-indigo);
}

/* ---------- Marquee strip ---------- */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.animate-marquee {
  animation: marquee 30s linear infinite;
}

/* ---------- Custom scrollbar ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--slate-50); }
::-webkit-scrollbar-thumb {
  background: #94A3B8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: #64748B; }

/* ---------- Print styles ---------- */
@media print {
  nav, .mobile-menu, footer { display: none !important; }
  .reveal, .reveal-left, .reveal-right, .reveal-stagger > * {
    opacity: 1 !important;
    transform: none !important;
  }
}
