/* ============================================================
   CodeNest Studios — Shared Design System v2
   Premium Glassmorphism Dark UI for all websites
   ============================================================ */

/* ─── Google Fonts ─── */

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { 
    scroll-behavior: smooth;
    font-size: clamp(14px, 1.2vw + 10px, 18px); /* Fluid typography */
}

/* ─── CSS Custom Properties ─── */
:root {
    --primary:          #8b5cf6;
    --accent:           #f43f5e;
    --primary-dim:      rgba(139, 92, 246, 0.15);
    --accent-dim:       rgba(244, 63, 94, 0.12);
    --bg-dark:          #050b18;
    --bg-card:          rgba(255, 255, 255, 0.028);
    --bg-card-hover:    rgba(255, 255, 255, 0.055);
    --bg-glass:         rgba(15, 23, 42, 0.7);
    --border-subtle:    rgba(255, 255, 255, 0.065);
    --border-glow:      rgba(139, 92, 246, 0.4);
    --text-light:       #f1f5f9;
    --text-muted:       #94a3b8;
    --text-dim:         #475569;
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    --gradient-dark:    linear-gradient(135deg, #0f172a 0%, #050b18 100%);
    --shadow-sm:        0 2px 8px rgba(0,0,0,0.3);
    --shadow-card:      0 8px 32px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.04) inset;
    --shadow-hover:     0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px var(--border-glow);
    --shadow-btn:       0 8px 24px rgba(139,92,246,0.4);
    --radius-sm:        10px;
    --radius-card:      20px;
    --radius-lg:        28px;
    --radius-btn:       50px;
    --radius-icon:      16px;
    --transition:       all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast:  all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow:  all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Base ─── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(139,92,246,0.07) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 110%, rgba(244,63,94,0.06) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

body > * { position: relative; z-index: 1; }

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139,92,246,0.55); }

/* ─── Selection ─── */
::selection { background: rgba(139,92,246,0.35); color: #fff; }

/* ─── Navbar ─── */
.navbar {
    padding: 0 2rem;
    height: 64px;
    background: rgba(5, 11, 24, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    position: sticky;
    top: 0;
    z-index: 200;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* Navbar gradient line accent */
.navbar::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.35;
}

.navbar-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    letter-spacing: -0.03em;
    flex-shrink: 0;
}

.navbar-brand .brand-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--gradient-primary);
    box-shadow: 0 0 12px var(--primary);
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    font-weight: 500;
    font-size: 0.88rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-muted);
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    transition: var(--transition-fast);
    white-space: nowrap;
}
.nav-links a:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}
.nav-links a.active {
    color: var(--primary);
    background: var(--primary-dim);
}

/* ─── Hero ─── */
.hero {
    position: relative;
    padding: 6rem 1.5rem 4rem;
    text-align: center;
    overflow: hidden;
}

/* Animated orbs */
.hero::before {
    content: '';
    position: absolute;
    top: -20%; left: -5%;
    width: 55%; height: 120%;
    background: var(--primary);
    filter: blur(120px);
    opacity: 0.1;
    z-index: 0;
    border-radius: 50%;
    animation: floatOrb 8s ease-in-out infinite alternate;
}
.hero::after {
    content: '';
    position: absolute;
    top: 10%; right: -5%;
    width: 45%; height: 100%;
    background: var(--accent);
    filter: blur(120px);
    opacity: 0.09;
    z-index: 0;
    border-radius: 50%;
    animation: floatOrb 10s ease-in-out infinite alternate-reverse;
}

@keyframes floatOrb {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(3%, 5%) scale(1.08); }
}

.hero > * { position: relative; z-index: 1; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-dim);
    border: 1px solid rgba(139,92,246,0.25);
    color: #a78bfa;
    padding: 0.45rem 1.1rem;
    border-radius: 99px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 1.8rem;
    text-transform: uppercase;
}

.hero h1 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.2rem, 5.5vw, 4rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, #fff 20%, #c4b5fd 60%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--text-muted);
    max-width: 100%;
    margin: 0 auto 2.8rem;
    line-height: 1.7;
    font-weight: 400;
}

/* ─── Buttons ─── */
.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-main {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-primary);
    color: #fff;
    padding: 0.9rem 2.2rem;
    border-radius: var(--radius-btn);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.97rem;
    letter-spacing: 0.01em;
    box-shadow: var(--shadow-btn);
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}
.btn-main::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.25s;
}
.btn-main:hover::before { opacity: 1; }
.btn-main:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(139,92,246,0.5);
}
.btn-main:active { transform: translateY(-1px); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-light);
    padding: 0.9rem 2.2rem;
    border-radius: var(--radius-btn);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.97rem;
    transition: var(--transition);
    cursor: pointer;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(139,92,246,0.5);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-subtle);
    color: var(--text-light);
    padding: 0.7rem 1.6rem;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 0.88rem;
    transition: var(--transition);
    cursor: pointer;
}
.btn-outline:hover {
    border-color: rgba(139,92,246,0.45);
    background: var(--primary-dim);
    transform: translateY(-2px);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-btn);
    transition: var(--transition-fast);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-subtle);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}
.btn-back:hover {
    color: #fff;
    background: rgba(255,255,255,0.07);
    transform: translateY(-2px);
    border-color: rgba(139,92,246,0.35);
}

/* ─── Section Layout ─── */
.section-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary);
    margin-bottom: 0.8rem;
    padding: 0.3rem 0.9rem;
    background: var(--primary-dim);
    border-radius: 99px;
    border: 1px solid rgba(139,92,246,0.2);
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 0.6rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 100%;
    margin: 0 auto;
    line-height: 1.65;
}

/* Section divider */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139,92,246,0.2), transparent);
    margin: 0 2rem;
}

/* ─── Stats Cards ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1.2rem;
    max-width: 100%;
    margin: 0 auto;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: 1.6rem 1.4rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
}
.stat-card:hover {
    border-color: rgba(139,92,246,0.25);
    transform: translateY(-5px);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-card);
}
.stat-card:hover::before { opacity: 1; }

.stat-val {
    font-family: 'Outfit', sans-serif;
    font-size: 2.4rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
    line-height: 1;
    letter-spacing: -0.02em;
}
.stat-lbl {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ─── Feature Cards Grid ─── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.4rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 1.8rem;
    border-radius: var(--radius-card);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* Card shimmer on hover */
.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255,255,255,0.035), transparent);
    transition: left 0.5s ease;
}
.feature-card:hover::before { left: 150%; }

/* Card top border accent */
.feature-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
}
.feature-card:hover::after { opacity: 1; }

.feature-card:hover {
    transform: translateY(-7px);
    border-color: rgba(139,92,246,0.3);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(244,63,94,0.08));
    border: 1px solid rgba(139,92,246,0.12);
    width: 58px; height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-icon);
    flex-shrink: 0;
    transition: var(--transition);
}
.feature-card:hover .card-icon {
    background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(244,63,94,0.12));
    border-color: rgba(139,92,246,0.25);
    transform: scale(1.05);
}

.card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.55;
    flex: 1;
}

.card-action {
    margin-top: 0.4rem;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: var(--transition-fast);
}
.feature-card:hover .card-action {
    gap: 0.65rem;
    color: #a78bfa;
}

/* Card meta tags */
.card-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.card-tag {
    font-size: 0.73rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ─── Banner Card ─── */
.banner-card {
    background:
        linear-gradient(135deg, rgba(139,92,246,0.08) 0%, rgba(244,63,94,0.06) 100%),
        var(--bg-card);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: var(--radius-lg);
    padding: 3.5rem 2.5rem;
    text-align: center;
    margin: 1.5rem 0;
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.banner-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-lg) + 2px);
    background: var(--gradient-primary);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s;
}
.banner-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}
.banner-card:hover::before { opacity: 0.15; }

.banner-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 800;
    margin-bottom: 0.9rem;
    color: #fff;
    letter-spacing: -0.02em;
}
.banner-card p {
    color: var(--text-muted);
    max-width: 100%;
    margin: 0 auto 2rem;
    font-size: 1.02rem;
    line-height: 1.65;
}

/* Streak badge inside banner */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(251,146,60,0.15), rgba(239,68,68,0.1));
    border: 1px solid rgba(251,146,60,0.25);
    color: #fb923c;
    padding: 0.35rem 1rem;
    border-radius: 99px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─── Notes Body ─── */
.notes-body {
    background: linear-gradient(145deg, rgba(15,23,42,0.9), rgba(17,24,39,0.95));
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius-card);
    padding: clamp(1rem, 3vw, 2.5rem);
    color: #d4dce9;
    font-family: 'Noto Sans Devanagari', 'Inter', sans-serif;
    font-size: 1.1rem;
    line-height: 2;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.05);
    width: 100%;
}

/* ─── Section Headings ─── */
.notes-body h2 {
    font-family: 'Outfit', 'Noto Sans Devanagari', sans-serif;
    font-size: clamp(1.25rem, 2.5vw, 1.6rem);
    font-weight: 800;
    color: #fff;
    margin: 3rem 0 1.2rem;
    padding: 1rem 1.4rem;
    background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(59,130,246,0.08));
    border-left: 4px solid;
    border-image: var(--gradient-primary) 1;
    border-radius: 0 12px 12px 0;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.notes-body h2::before {
    content: '';
    display: inline-block;
    width: 5px; height: 1.2em;
    background: var(--gradient-primary);
    border-radius: 3px;
    flex-shrink: 0;
    display: none;
}
.notes-body h2:first-child { margin-top: 0; }

.notes-body h3 {
    font-family: 'Outfit', 'Noto Sans Devanagari', sans-serif;
    font-size: clamp(1.05rem, 1.8vw, 1.2rem);
    font-weight: 700;
    color: #a78bfa;
    margin: 2rem 0 0.8rem;
    padding-left: 0.9rem;
    border-left: 3px solid rgba(167,139,250,0.5);
    letter-spacing: -0.01em;
    line-height: 1.5;
}

.notes-body h4 {
    font-family: 'Outfit', 'Noto Sans Devanagari', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #64748b;
    margin: 1.5rem 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ─── Body Text ─── */
.notes-body p {
    margin-bottom: 1.3rem;
    color: #cbd5e1;
    line-height: clamp(1.85, 2vw + 1.4, 2.1);
}

/* ─── Lists ─── */
.notes-body ul, .notes-body ol {
    padding-left: 0;
    margin: 0.8rem 0 1.6rem;
    list-style: none;
}
.notes-body ul li {
    padding: 0.55rem 0 0.55rem 2rem;
    position: relative;
    line-height: 1.9;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: #cbd5e1;
}
.notes-body ul li::before {
    content: '▸';
    position: absolute;
    left: 0.4rem;
    top: 0.55rem;
    color: var(--primary, #22c55e);
    font-size: 0.8rem;
    line-height: 1.9;
}
.notes-body ol {
    counter-reset: notes-counter;
}
.notes-body ol li {
    counter-increment: notes-counter;
    padding: 0.7rem 0 0.7rem 2.8rem;
    position: relative;
    line-height: 1.9;
    margin-bottom: 0.3rem;
    color: #cbd5e1;
    background: rgba(255,255,255,0.015);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}
.notes-body ol li::before {
    content: counter(notes-counter);
    position: absolute;
    left: 0.7rem;
    top: 0.65rem;
    width: 1.5rem; height: 1.5rem;
    background: var(--gradient-primary, linear-gradient(135deg, #22c55e, #3b82f6));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.5rem;
    text-align: center;
}
.notes-body li:last-child { border-bottom: none; }

/* ─── Key Terms (strong) ─── */
.notes-body strong {
    color: #f1f5f9;
    font-weight: 700;
    background: rgba(167,139,250,0.12);
    padding: 0.05em 0.35em;
    border-radius: 5px;
    border: 1px solid rgba(167,139,250,0.18);
    white-space: nowrap;
}

/* ─── Inline Code ─── */
.notes-body code {
    background: rgba(0,0,0,0.5);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    color: #f472b6;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.86em;
    border: 1px solid rgba(244,114,182,0.15);
}

/* ─── Code Blocks ─── */
.notes-body pre {
    background: rgba(0,0,0,0.6);
    border-radius: 14px;
    padding: 1.5rem 1.8rem;
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,0.06);
    margin: 1.6rem 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    line-height: 1.75;
}

/* ─── Blockquote (key notes / tips) ─── */
.notes-body blockquote {
    margin: 1.8rem 0;
    padding: 1.2rem 1.6rem;
    background: linear-gradient(135deg, rgba(34,197,94,0.06), rgba(59,130,246,0.04));
    border-left: 4px solid var(--primary, #22c55e);
    border-radius: 0 14px 14px 0;
    color: #86efac;
    font-style: normal;
    font-size: 1rem;
    line-height: 1.9;
    position: relative;
}
.notes-body blockquote::before {
    content: '💡';
    font-style: normal;
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* ─── Tables ─── */
.notes-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.8rem 0;
    font-size: 0.95rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.07);
}
.notes-body th, .notes-body td {
    padding: 0.9rem 1.2rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    line-height: 1.7;
}
.notes-body th {
    background: linear-gradient(135deg, rgba(139,92,246,0.18), rgba(59,130,246,0.12));
    color: #e2e8f0;
    font-weight: 700;
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.notes-body td { color: #cbd5e1; }
.notes-body tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.notes-body tr:hover td { background: rgba(167,139,250,0.05); transition: background 0.2s; }

/* ─── Formula / Math box ─── */
.formula-box {
    background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(59,130,246,0.08));
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin: 1.8rem 0;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    color: #c4b5fd;
    box-shadow: 0 0 20px rgba(139,92,246,0.08);
}

/* ─── MathJax display equations ─── */
.notes-body .MathJax_Display,
.notes-body mjx-container[display="true"] {
    background: linear-gradient(135deg, rgba(59,130,246,0.06), rgba(139,92,246,0.06));
    border: 1px solid rgba(139,92,246,0.18);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin: 1.4rem 0 !important;
    overflow-x: auto;
}

/* Key point callout */
.key-point {
    background: rgba(34,197,94,0.06);
    border: 1px solid rgba(34,197,94,0.15);
    border-left: 4px solid #22c55e;
    border-radius: 0 14px 14px 0;
    padding: 1rem 1.4rem;
    margin: 1.4rem 0;
    color: #86efac;
    font-size: 0.95rem;
}

/* ─── Quiz Engine ─── */
#quiz-app { max-width: 100%; margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 3rem; }

.question-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: 2.5rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-card);
    transition: var(--transition-slow);
    animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.question-number {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.9rem;
}

.question-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 2rem;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.options-grid { display: grid; gap: 0.8rem; }

.option-btn {
    background: rgba(255,255,255,0.032);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 1.05rem 1.4rem;
    text-align: left;
    cursor: pointer;
    color: #e2e8f0;
    font-size: 0.97rem;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
}
.option-btn .opt-label {
    min-width: 28px; height: 28px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
    font-family: 'Outfit', sans-serif;
    transition: var(--transition-fast);
}

.option-btn:hover:not(.locked) {
    border-color: rgba(139,92,246,0.45);
    background: rgba(139,92,246,0.08);
    transform: translateX(5px);
    box-shadow: 0 0 0 1px rgba(139,92,246,0.15) inset;
}
.option-btn:hover:not(.locked) .opt-label {
    background: var(--primary-dim);
    border-color: rgba(139,92,246,0.4);
    color: #a78bfa;
}

.option-btn.correct {
    background: rgba(34,197,94,0.1);
    border-color: rgba(34,197,94,0.5);
    color: #86efac;
    box-shadow: 0 0 0 1px rgba(34,197,94,0.1) inset;
}
.option-btn.correct .opt-label {
    background: rgba(34,197,94,0.2);
    border-color: #22c55e;
    color: #22c55e;
}

.option-btn.wrong {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.5);
    color: #fca5a5;
    box-shadow: 0 0 0 1px rgba(239,68,68,0.1) inset;
}
.option-btn.wrong .opt-label {
    background: rgba(239,68,68,0.2);
    border-color: #ef4444;
    color: #ef4444;
}
.option-btn.locked { cursor: default; transform: none; }

/* Explanation box */
.explanation-box {
    margin-top: 1.2rem;
    padding: 1rem 1.3rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
    border-left: 3px solid;
    animation: fadeIn 0.3s ease;
}
.explanation-box.correct-ex {
    background: rgba(34,197,94,0.07);
    border-color: #22c55e;
    color: #86efac;
}
.explanation-box.wrong-ex {
    background: rgba(239,68,68,0.07);
    border-color: #ef4444;
    color: #fca5a5;
}

/* Progress bar */
.progress-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}
.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.05);
    border-radius: 99px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 99px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(139,92,246,0.5);
}
.progress-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    font-family: 'Outfit', sans-serif;
}

/* Timer */
#timer-display {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--accent);
    text-align: center;
    padding: 1rem 1.5rem;
    background: rgba(244,63,94,0.05);
    border: 1px solid rgba(244,63,94,0.15);
    border-radius: 16px;
    margin: 1.5rem 0;
    letter-spacing: 4px;
}

/* Score overlay */
.score-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5,11,24,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(20px);
    animation: fadeIn 0.3s ease;
}
.score-card {
    background: rgba(15,23,42,0.95);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    padding: 3.5rem 3rem;
    text-align: center;
    max-width: 460px;
    width: 92%;
    box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(139,92,246,0.15) inset;
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

.score-circle {
    width: 150px; height: 150px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem auto;
    font-family: 'Outfit', sans-serif;
    font-size: 2.6rem;
    font-weight: 900;
    color: #fff;
    background: rgba(139,92,246,0.08);
    border: 3px solid transparent;
    background-clip: padding-box;
    box-shadow: 0 0 0 3px rgba(139,92,246,0.4), 0 0 50px rgba(139,92,246,0.2);
    letter-spacing: -0.02em;
}

/* Mode selector */
.mode-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1.2rem;
    margin: 2rem 0;
}
.mode-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.mode-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
}
.mode-card:hover {
    border-color: rgba(139,92,246,0.3);
    transform: translateY(-6px);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-hover);
}
.mode-card:hover::after { opacity: 1; }

.mode-card .mode-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}
.mode-card h3 {
    color: #fff;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.mode-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Topic grid */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}
.topic-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: 1.4rem 1.1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.4;
}
.topic-btn:hover {
    border-color: rgba(139,92,246,0.35);
    background: var(--primary-dim);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}
.topic-btn .topic-icon {
    font-size: 1.9rem;
    margin-bottom: 0.7rem;
    display: block;
}

/* Stats panel (quiz page) */
#stats-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
}
#stats-panel h3 {
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.stats-grid-quiz {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
}
.stat-card-quiz {
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 1.1rem;
    text-align: center;
}
.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.9rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
    line-height: 1;
}
.stat-label {
    color: var(--text-muted);
    font-size: 0.73rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Notes panel (inside quiz) */
#notes-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: 2.5rem;
    margin: 1.5rem 0;
    color: #cbd5e1;
    line-height: 1.8;
    box-shadow: var(--shadow-sm);
    font-size: 0.97rem;
}
#notes-panel h3 {
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 1.5rem 0 0.8rem;
}

/* ─── Header Card (notes / practice pages) ─── */
.header-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius-lg);
    padding: 2.8rem 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}
.header-card::before {
    content: '';
    position: absolute;
    top: -50%; left: -20%;
    width: 60%; height: 150%;
    background: var(--primary);
    filter: blur(100px);
    opacity: 0.06;
    border-radius: 50%;
}

.topic-badge {
    font-size: 2.6rem;
    background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(244,63,94,0.08));
    border: 1px solid rgba(139,92,246,0.15);
    width: 80px; height: 80px;
    border-radius: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.2rem;
}

.header-card h1 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 900;
    margin-bottom: 0.7rem;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.header-card p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 100%;
    margin: 0 auto 1.8rem;
    line-height: 1.65;
}
.cta-row {
    display: flex;
    gap: 0.9rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── AdSense Slot ─── */
.adsense-slot {
    background: rgba(255,255,255,0.01);
    border: 1px dashed rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 1rem;
    text-align: center;
    margin: 2rem auto;
    max-width: 100%;
    min-height: 90px;
    color: var(--text-dim);
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.03em;
}

/* ─── Container ─── */
.container { max-width: 100%; margin: 1rem auto; padding: 0 clamp(0.5rem, 2vw, 1.5rem); }

/* ─── Footer ─── */
.footer {
    background: rgba(0,0,0,0.35);
    padding: 2.5rem 2rem;
    text-align: center;
    color: var(--text-dim);
    margin-top: 5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
    position: relative;
}
.footer::before {
    content: '';
    position: absolute;
    top: 0; left: 50%; transform: translateX(-50%);
    width: 200px; height: 1px;
    background: var(--gradient-primary);
    opacity: 0.3;
}
.footer a {
    color: var(--primary);
    font-weight: 600;
    transition: color 0.2s;
}
.footer a:hover { color: #a78bfa; }

/* ─── Utility ─── */
.text-primary { color: var(--primary); }
.text-muted   { color: var(--text-muted); }
.text-center  { text-align: center; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .navbar { padding: 0 1rem; height: 58px; }
    .nav-links { gap: 0; font-size: 0.82rem; }
    .nav-links a { padding: 0.35rem 0.65rem; }
    .hero { padding: 4rem 1rem 2.5rem; }
    .section-container { padding: 2.5rem 1rem; }
    .feature-card { padding: 1.5rem; }
    .score-card { padding: 2.5rem 1.5rem; }
    .notes-body { padding: 1.2rem; font-size: 0.8rem; border-radius: 0; border-left: none; border-right: none; margin: 0 calc(-1 * clamp(0.5rem, 2vw, 1.5rem)); width: auto; }
    .notes-body h2 { font-size: clamp(1.15rem, 5vw, 1.35rem); padding: 0.8rem 1rem; }
    .notes-body h3 { font-size: clamp(1rem, 4vw, 1.1rem); }
    .header-card { padding: 2rem 1.2rem; }
    .banner-card { padding: 2.5rem 1.5rem; }
    .question-card { padding: 1.8rem 1.5rem; }
}

@media (max-width: 480px) {
    .navbar-brand { font-size: 1.05rem; }
    .nav-links a { padding: 0.3rem 0.5rem; font-size: 0.78rem; }
    .btn-main, .btn-secondary { padding: 0.8rem 1.6rem; font-size: 0.92rem; }
    .cards-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .section-title { font-size: 1.65rem; }
    .hero h1 { letter-spacing: -0.02em; }
    .score-card { padding: 2rem 1.2rem; }
    .score-circle { width: 120px; height: 120px; font-size: 2rem; }
    .notes-body { padding: 1.4rem 1rem; font-size: 0.75rem; line-height: 1.9; }
    .notes-body ul li, .notes-body ol li { padding-left: 2rem; }
}

