/**
 * WindsMind Pro - Modern Educational & Abacus Design System
 * Supports Light & Dark Modes (White Default), Tamil & English Typography, 
 * Luxury Serif Typography, and Advanced Analytical Visualizations.
 */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,600;0,700;0,800;0,900;1,600&family=Manrope:wght@400;500;600;700;800&family=Noto+Serif+Tamil:wght@500;600;700;800;900&family=Hind+Madurai:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    /* Primary Brand Palettes */
    --brand-primary: #2563eb;
    --brand-primary-light: #3b82f6;
    --brand-primary-dark: #1d4ed8;
    --brand-primary-glow: rgba(37, 99, 235, 0.15);
    
    --brand-indigo: #4f46e5;
    --brand-indigo-light: #6366f1;
    --brand-emerald: #059669;
    
    /* Light Theme Tokens (DEFAULT) */
    --bg-main: #ffffff;
    --bg-warm: #f8fafc;
    --bg-surface: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-elevated: #ffffff;
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border-light: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-subtle: #f1f5f9;
    /* Six rules in visual.css ask for --border-color. It was never
       declared, so those borders were invalid at computed-value time
       and collapsed to no border at all - which is why the Copy
       buttons read as plain text. */
    --border-color: #cbd5e1;
    
    
    --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    --shadow-elevated: 0 20px 35px -8px rgba(37, 99, 235, 0.12), 0 10px 15px -4px rgba(15, 23, 42, 0.04);
    
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme Overrides */
html.dark, body.dark {
    --bg-main: #090d16;
    --bg-warm: #0f172a;
    --bg-surface: #131b2e;
    --bg-card: #0f172a;
    --bg-card-hover: #162038;
    --bg-elevated: #1e293b;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    
    --border-light: #1e293b;
    --border-hover: #334155;
    --border-subtle: #1e293b;
    --border-color: #334155;
    
    
    --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 2px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-elevated: 0 20px 35px -8px rgba(59, 130, 246, 0.2), 0 10px 15px -4px rgba(0, 0, 0, 0.4);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-main);
    overflow-x: hidden;
    line-height: 1.6;
    min-height: 100vh;
}

/* Tamil Typography Enhancement */
.lang-tamil body,
body.lang-tamil {
    font-family: 'Hind Madurai', 'Manrope', sans-serif;
}

/*
 * Headings use the heavy sans so the page reads bold and friendly to
 * parents. The serif is kept for the brand wordmark only.
 */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    word-break: break-word;
}

.brand-font {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    word-break: break-word;
}

body.lang-tamil h1, 
body.lang-tamil h2, 
body.lang-tamil h3, 
body.lang-tamil h4, 
body.lang-tamil h5, 
body.lang-tamil h6 {
    font-family: 'Hind Madurai', 'Noto Serif Tamil', sans-serif;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: normal;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-warm);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Scroll Reveal Motion Engine */
.scroll-reveal {
    opacity: 0;
    transform: translateY(32px) scale(0.98);
    filter: blur(4px);
    transition: opacity 0.75s var(--ease-spring),
                transform 0.75s var(--ease-spring),
                filter 0.75s var(--ease-spring);
    will-change: opacity, transform, filter;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.stagger-1 { transition-delay: 0.08s; }
.stagger-2 { transition-delay: 0.16s; }
.stagger-3 { transition-delay: 0.24s; }
.stagger-4 { transition-delay: 0.32s; }

/* Subtle Ambient Gradient Background Matrix */
.hero-gradient-mesh {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 15% 15%, rgba(37, 99, 235, 0.08) 0px, transparent 50%),
        radial-gradient(at 85% 20%, rgba(99, 102, 241, 0.07) 0px, transparent 50%),
        radial-gradient(at 50% 80%, rgba(245, 158, 11, 0.06) 0px, transparent 50%),
        radial-gradient(var(--border-light) 1.2px, transparent 1.2px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 28px 28px;
}

.dark .hero-gradient-mesh {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 15% 15%, rgba(59, 130, 246, 0.14) 0px, transparent 50%),
        radial-gradient(at 85% 20%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 50% 80%, rgba(245, 158, 11, 0.1) 0px, transparent 50%),
        radial-gradient(rgba(255, 255, 255, 0.05) 1.2px, transparent 1.2px);
}

/* Keyframe Animations */
@keyframes floatSlow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(0.4deg); }
}

@keyframes floatReverse {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(6px) rotate(-0.4deg); }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

@keyframes shimmerSweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

@keyframes beadPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

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

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

.animate-pulse-glow {
    animation: pulseGlow 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Institutional Clean Cards */
.school-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-soft);
    transition: all 0.35s var(--ease-spring);
    position: relative;
    overflow: hidden;
}

.school-card:hover {
    transform: translateY(-5px);
    border-color: #93c5fd;
    box-shadow: var(--shadow-elevated);
}

.dark .school-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 20px 35px -8px rgba(59, 130, 246, 0.25);
}

/* Workflow Tab Switcher */
.workflow-tab-btn {
    transition: all 0.25s var(--ease-spring);
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
    color: var(--text-secondary);
}

.workflow-tab-btn:hover {
    color: var(--brand-primary);
    border-color: #bfdbfe;
}

.workflow-tab-btn.active {
    background: var(--bg-card) !important;
    color: var(--brand-primary) !important;
    border-color: var(--brand-primary-light) !important;
    box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.18), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

/* Buttons */
.btn-school-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.25s var(--ease-spring);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.btn-school-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: skewX(-20deg);
}

.btn-school-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.38);
}

.btn-school-primary:hover::after {
    animation: shimmerSweep 0.9s ease;
}

.btn-school-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1.5px solid var(--border-light);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: all 0.25s var(--ease-spring);
    cursor: pointer;
}

.btn-school-secondary:hover {
    background: var(--bg-warm);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

/* Language Switcher Pill */
.lang-switcher-wrap {
    display: inline-flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 9999px;
    padding: 3px;
    gap: 2px;
}

.lang-btn {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    cursor: pointer;
}

.lang-btn.active-lang {
    background: var(--bg-card);
    color: var(--brand-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.dark .lang-btn.active-lang {
    background: #1e293b;
    color: #60a5fa;
}

/* Theme Switcher Button */
.theme-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(120% 120% at 30% 25%, #ffffff 0%, #eef2f7 100%);
    border: 1px solid var(--border-light);
    color: #d97706;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s ease, color 0.2s ease, background 0.25s ease;
    cursor: pointer;
}
.dark .theme-toggle-btn {
    background: radial-gradient(120% 120% at 30% 25%, #334155 0%, #0f172a 100%);
    border-color: #334155;
    color: #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.theme-toggle-btn:hover {
    transform: translateY(-1px) rotate(18deg) scale(1.06);
    box-shadow: 0 8px 20px -6px rgba(37, 99, 235, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    color: var(--brand-primary);
}
.dark .theme-toggle-btn:hover {
    box-shadow: 0 8px 22px -6px rgba(56, 189, 248, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    color: #7dd3fc;
}
.theme-toggle-btn:active { transform: scale(0.94); }

/* Badges */
.badge-clean {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-brand {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.25);
}

.dark .badge-brand {
    background: rgba(96, 165, 250, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.badge-indigo {
    background: rgba(79, 70, 229, 0.1);
    color: #4f46e5;
    border: 1px solid rgba(79, 70, 229, 0.25);
}

.dark .badge-indigo {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.35);
}

/* Interactive SVG Radar & Speed Curves */
.radar-grid {
    stroke: var(--border-light);
    stroke-dasharray: 4 4;
}

.dark .radar-grid {
    stroke: #334155;
}

/* Toast Alert */
.toast-alert {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    padding: 14px 20px;
    border-radius: 14px;
    background: #0f172a;
    color: #ffffff;
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.35s var(--ease-spring);
}

.dark .toast-alert {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-alert.show {
    transform: translateY(0);
    opacity: 1;
}

/* Modal Overlay */
.modal-backdrop {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
}

/* Indian / Tamil Nadu Cultural & Educational Motif Vectors */
.indian-rangoli-bg {
    opacity: 0.04;
    background-image: radial-gradient(#2563eb 1.5px, transparent 1.5px), radial-gradient(#60a5fa 1.5px, transparent 1.5px);
    background-size: 36px 36px;
    background-position: 0 0, 18px 18px;
}

/* =========================================================
   Navbar fit (toggled by js/main.js when the menu fits)
   ========================================================= */
#main-navbar .desktop-nav { display: none; }
#main-navbar.nav-wide .desktop-nav { display: flex; }
#main-navbar.nav-wide .nav-burger { display: none; }
#main-navbar .desktop-nav { gap: 1.05rem; font-size: 13.5px; }
#main-navbar .desktop-nav a { white-space: nowrap; letter-spacing: 0.01em; }
body.lang-tamil #main-navbar .desktop-nav { font-size: 13px; gap: 0.8rem; }
body.lang-tamil #main-navbar .lang-btn { padding: 4px 8px; }
@media (max-width: 640px) {
    #main-navbar .lang-btn { padding: 4px 7px; }
}
@media (max-width: 380px) {
    #main-navbar .brand-font { font-size: 15px; }
    #main-navbar .brand-logo { width: 32px; height: 32px; }
    #main-navbar .theme-toggle-btn { width: 34px; height: 34px; }
}
/* Very narrow phones: the language switch stays available in the menu drawer */
@media (max-width: 340px) {
    #main-navbar .header-lang { display: none; }
}

/* Tamil serif headline: Tamil words run long, keep the hero title readable */
body.lang-tamil h1 {
    font-size: clamp(1.9rem, 3.3vw, 3.1rem);
    line-height: 1.3;
}

/* =========================================================
   Luxury credentials panel (hero, typography only)
   ========================================================= */
.luxe-panel {
    background: linear-gradient(160deg, #ffffff 0%, #fbf8f1 100%);
    border: 1px solid #eadfc8;
    box-shadow: 0 30px 60px -20px rgba(120, 90, 30, 0.18), 0 2px 6px rgba(15, 23, 42, 0.04);
}
.dark .luxe-panel {
    background: linear-gradient(160deg, #0f172a 0%, #141a2a 100%);
    border-color: #3a3222;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}
.luxe-rule {
    width: 28px;
    height: 1px;
    background: linear-gradient(90deg, #b8860b, #e6c77a);
}
.luxe-item {
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #efe6d3;
}
.dark .luxe-item {
    background: rgba(15, 23, 42, 0.6);
    border-color: #2c2a24;
}
.luxe-item h3 { margin: 0.25rem 0 0.25rem; }
.luxe-num {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1d4ed8;
}
.dark .luxe-num { color: #93c5fd; }

/* ===== Hero: what-is-abacus explainer + heart quote (Oct 2026) ===== */
.hero-explain {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    max-width: 34rem;
    margin: 0 0 1.1rem;
    padding: 0.95rem 1.15rem;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 1rem;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 18px 44px -28px rgba(5, 15, 35, 0.85);
}
.hero-explain__ico {
    flex: none;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 0.75rem;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #7cb6ff, #2563eb);
    box-shadow: 0 10px 22px -10px rgba(37, 99, 235, 0.95);
}
.hero-explain__ico svg { width: 1.55rem; height: 1.55rem; }
.hero-explain__t {
    display: block;
    font-weight: 800;
    color: #fff;
    font-size: 0.96rem;
    margin-bottom: 0.18rem;
}
.hero-explain__d {
    display: block;
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.87rem;
    line-height: 1.52;
    font-weight: 500;
}
.hero-quote {
    position: relative;
    max-width: 30rem;
    margin: 0 0 1.7rem;
    padding: 0.1rem 0 0.1rem 1.1rem;
    border-left: 3px solid rgba(191, 219, 254, 0.75);
    color: #fff;
    font-style: italic;
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.45;
    letter-spacing: 0.005em;
}
.hero-quote b { font-style: normal; font-weight: 800; color: #bfdbfe; }
@media (max-width: 640px) {
    .hero-explain { padding: 0.85rem 0.95rem; gap: 0.75rem; }
    .hero-quote { font-size: 0.98rem; }
}
