/* ============================================
   PHYSICS.AI — Kinematics Educational Platform
   Futuristic Scientific Dark Theme
   ============================================ */

:root {
    /* Color Palette */
    --bg-primary: #050814;
    --bg-secondary: #0a1024;
    --bg-tertiary: #0f1830;
    --bg-card: rgba(15, 24, 48, 0.7);
    --bg-card-hover: rgba(20, 32, 62, 0.85);
    
    --accent-primary: #00d4ff;     /* Physics Blue */
    --accent-secondary: #7c3aed;   /* Deep Purple */
    --accent-success: #00ff9d;     /* Vector Green */
    --accent-danger: #ff3366;      /* Vector Red */
    --accent-warning: #ffb800;
    
    --text-primary: #e8edf7;
    --text-secondary: #a9b3cf;
    --text-dim: #6b7494;
    
    --border: rgba(0, 212, 255, 0.15);
    --border-bright: rgba(0, 212, 255, 0.35);
    --glow: 0 0 40px rgba(0, 212, 255, 0.15);
    --glow-strong: 0 0 60px rgba(0, 212, 255, 0.35);
    
    --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ============ BACKGROUND EFFECTS ============ */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

.bg-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-primary);
    opacity: 0.5;
    animation: drift linear infinite;
}

@keyframes drift {
    from { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    to { transform: translate(100px, -100vh); opacity: 0; }
}

body::before {
    content: '';
    position: fixed;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    left: -10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.12), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ============ NAVIGATION ============ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(5, 8, 20, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px var(--accent-primary));
}

.logo-accent {
    color: var(--accent-primary);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all 0.2s;
    position: relative;
}

.nav-link:hover {
    color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.08);
}

.nav-link.active {
    color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-primary);
}

.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.burger span {
    width: 24px;
    height: 2px;
    background: var(--accent-primary);
    transition: all 0.3s;
    border-radius: 2px;
}

/* ============ HERO ============ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 120px 80px 80px;
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 1;
    max-width: 640px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid var(--border-bright);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-primary);
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.hero-title {
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: 24px;
    letter-spacing: -2px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary) 60%, #ff00ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    font-weight: 800;
}

.hero-subtitle {
    display: block;
    font-size: 0.4em;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0;
    margin-top: 12px;
}

.hero-description {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 36px;
    max-width: 540px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 28px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.25s;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 212, 255, 0.45);
}

.btn-secondary {
    background: rgba(0, 212, 255, 0.08);
    color: var(--accent-primary);
    border: 1px solid var(--border-bright);
}

.btn-secondary:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--accent-primary);
}

.hero-stats {
    display: flex;
    gap: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.stat-num {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-primary);
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.stat-label {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 4px;
}

.hero-visual {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.trajectory-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.3));
}

.trajectory-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawPath 3s ease-out forwards, glowPulse 3s ease-in-out 3s infinite;
}

@keyframes drawPath {
    to { stroke-dashoffset: 0; }
}

@keyframes glowPulse {
    0%, 100% { filter: drop-shadow(0 0 4px var(--accent-primary)); }
    50% { filter: drop-shadow(0 0 16px var(--accent-primary)); }
}

/* ============ MODULES ============ */
.module {
    padding: 100px 0;
    position: relative;
    z-index: 1;
}

.module-alt {
    background: linear-gradient(180deg, transparent, rgba(10, 16, 36, 0.5), transparent);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

.module-header {
    text-align: center;
    margin-bottom: 64px;
    position: relative;
}

.module-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(124, 58, 237, 0.15));
    border: 1px solid var(--border-bright);
    border-radius: 50%;
    font-family: var(--font-mono);
    font-size: 18px;
    color: var(--accent-primary);
    margin-bottom: 20px;
    box-shadow: var(--glow);
}

.module-title {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.module-tagline {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ============ CONCEPT CARDS ============ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.concept-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.concept-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.concept-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-bright);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.1);
}

.concept-card:hover::before { opacity: 1; }

.concept-icon {
    width: 52px;
    height: 52px;
    color: var(--accent-primary);
    margin-bottom: 18px;
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.5));
}

.concept-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.concept-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.concept-formula {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent-success);
    background: rgba(0, 255, 157, 0.08);
    border: 1px solid rgba(0, 255, 157, 0.2);
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-block;
}

/* ============ THEORY BLOCK ============ */
.theory-block {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.theory-text {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 36px;
    backdrop-filter: blur(10px);
}

.theory-text h3 {
    font-size: 22px;
    margin-bottom: 16px;
    color: var(--accent-primary);
}

.theory-text h4 {
    font-size: 16px;
    color: var(--text-primary);
    margin: 20px 0 12px;
}

.theory-text p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.theory-text code {
    font-family: var(--font-mono);
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.92em;
}

.check-list {
    list-style: none;
    margin-top: 16px;
}

.check-list li {
    padding-left: 28px;
    position: relative;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.check-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-size: 18px;
}

.formula-panel {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(0, 212, 255, 0.08));
    border: 1px solid var(--border-bright);
    border-radius: 14px;
    padding: 32px;
    backdrop-filter: blur(10px);
    height: fit-content;
}

.formula-title {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.formula-title::before {
    content: 'Σ';
    font-size: 22px;
    color: var(--accent-secondary);
}

.formula-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.formula-item:last-child { border-bottom: none; }

.formula-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.formula-eq {
    font-family: var(--font-mono);
    color: var(--accent-success);
    font-size: 15px;
    font-weight: 600;
}

/* ============ GRAPH DEMO ============ */
.graph-demo {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px;
    backdrop-filter: blur(10px);
}

.graph-title {
    font-size: 16px;
    color: var(--accent-primary);
    margin-bottom: 16px;
    font-weight: 600;
}

.motion-graph {
    width: 100%;
    height: auto;
    max-height: 320px;
}

.graph-line {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: drawLine 2s ease-out forwards;
    filter: drop-shadow(0 0 6px var(--accent-success));
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

/* ============ FREE FALL ============ */
.fall-wrapper {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    align-items: start;
}

.fall-text {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 36px;
    backdrop-filter: blur(10px);
}

.fall-text h3 {
    color: var(--accent-primary);
    font-size: 22px;
    margin-bottom: 16px;
}

.fall-text h4 {
    margin: 20px 0 12px;
    color: var(--text-primary);
    font-size: 15px;
}

.fall-text p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.highlight-box {
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.08), rgba(255, 184, 0, 0.05));
    border: 1px solid rgba(255, 51, 102, 0.25);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.highlight-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-danger);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.highlight-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-danger);
    text-shadow: 0 0 20px rgba(255, 51, 102, 0.5);
}

.highlight-note {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 6px;
}

.formulas-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.mini-formula {
    font-family: var(--font-mono);
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 6px;
    color: var(--accent-primary);
    text-align: center;
    font-size: 14px;
    transition: all 0.2s;
}

.mini-formula:hover {
    background: rgba(0, 212, 255, 0.15);
    transform: translateY(-1px);
}

.fall-animation {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fall-animation svg {
    width: 100%;
    max-width: 200px;
    height: auto;
}

.falling-ball {
    filter: drop-shadow(0 0 10px var(--accent-primary));
}

/* ============ CIRCULAR MOTION ============ */
.circular-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 40px;
    align-items: center;
}

.circular-visual {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px;
    backdrop-filter: blur(10px);
}

.circular-visual svg {
    width: 100%;
    height: auto;
}

.legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.dot.green { background: var(--accent-success); box-shadow: 0 0 6px var(--accent-success); }
.dot.red { background: var(--accent-danger); box-shadow: 0 0 6px var(--accent-danger); }

.circular-text h3 {
    font-size: 22px;
    color: var(--accent-primary);
    margin-bottom: 16px;
}

.circular-text > p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.circular-formulas {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cf-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "name formula" "desc desc";
    gap: 4px 20px;
    transition: all 0.2s;
}

.cf-item:hover {
    border-color: var(--border-bright);
    background: var(--bg-card-hover);
}

.cf-item.highlight {
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.06), rgba(0, 212, 255, 0.06));
    border-color: rgba(255, 51, 102, 0.3);
}

.cf-name {
    grid-area: name;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.cf-formula {
    grid-area: formula;
    font-family: var(--font-mono);
    color: var(--accent-success);
    font-size: 14px;
    font-weight: 600;
}

.cf-desc {
    grid-area: desc;
    font-size: 12px;
    color: var(--text-dim);
}

/* ============ CALCULATOR ============ */
.calc-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px;
    backdrop-filter: blur(16px);
    box-shadow: var(--glow);
}

.calc-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    overflow-x: auto;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.calc-tab {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 10px 18px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.calc-tab:hover {
    color: var(--accent-primary);
    border-color: var(--border-bright);
}

.calc-tab.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(124, 58, 237, 0.15));
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}

.calc-panel {
    display: none;
    animation: fadeIn 0.4s ease;
}

.calc-panel.active { display: block; }

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

.calc-panel h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.calc-desc {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
}

.calc-desc code {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.95em;
}

.calc-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 14px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 15px;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
    background: rgba(0, 0, 0, 0.6);
}

.calc-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.calc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.35);
}

.calc-result {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 255, 157, 0.05);
    border: 1px solid rgba(0, 255, 157, 0.2);
    border-left: 3px solid var(--accent-success);
    border-radius: 8px;
    font-family: var(--font-mono);
    color: var(--accent-success);
    min-height: 60px;
    display: none;
    animation: fadeIn 0.4s ease;
}

.calc-result.show { display: block; }

.calc-result .res-main {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.calc-result .res-steps {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.calc-result .res-steps span {
    color: var(--accent-primary);
}

/* ============ QUIZ ============ */
.test-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px;
    backdrop-filter: blur(16px);
}

.test-progress {
    margin-bottom: 32px;
}

.test-score {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.test-score span {
    color: var(--accent-success);
    font-weight: 700;
    font-size: 18px;
}

.progress-bar {
    height: 6px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-success));
    width: 0;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px var(--accent-primary);
}

.quiz-question {
    margin-bottom: 28px;
}

.question-num {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-primary);
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.question-text {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 14px 18px;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 15px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-bright);
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s;
}

.option:hover {
    border-color: var(--border-bright);
    background: rgba(0, 212, 255, 0.05);
}

.option.correct {
    border-color: var(--accent-success);
    background: rgba(0, 255, 157, 0.1);
    color: var(--accent-success);
}

.option.correct::before {
    background: var(--accent-success);
    border-color: var(--accent-success);
    box-shadow: 0 0 10px var(--accent-success);
}

.option.wrong {
    border-color: var(--accent-danger);
    background: rgba(255, 51, 102, 0.1);
    color: var(--accent-danger);
}

.option.wrong::before {
    background: var(--accent-danger);
    border-color: var(--accent-danger);
}

.option:disabled { cursor: not-allowed; }

.feedback {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.feedback.show { display: block; }

.feedback.success {
    background: rgba(0, 255, 157, 0.08);
    border-left: 3px solid var(--accent-success);
    color: var(--accent-success);
}

.feedback.error {
    background: rgba(255, 51, 102, 0.08);
    border-left: 3px solid var(--accent-danger);
    color: var(--text-secondary);
}

.quiz-complete {
    text-align: center;
    padding: 40px 20px;
}

.quiz-complete h3 {
    font-size: 32px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-success));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.quiz-complete p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ============ CHAT BOT ============ */
.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.chat-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.5);
    position: relative;
    transition: all 0.3s;
}

.chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.7);
}

.chat-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    animation: chatPulse 2s infinite;
    pointer-events: none;
}

@keyframes chatPulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.3); opacity: 0; }
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-bright);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--glow-strong);
    backdrop-filter: blur(16px);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s;
}

.chat-widget.open .chat-window {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chat-widget.open .chat-toggle {
    background: var(--bg-tertiary);
    transform: rotate(90deg);
}

.chat-header {
    padding: 16px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(124, 58, 237, 0.1));
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.chat-info { flex: 1; }

.chat-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.chat-status {
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-success);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-success);
    animation: pulse 2s infinite;
}

.chat-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    line-height: 1;
    transition: all 0.2s;
}

.chat-close:hover {
    background: rgba(255, 51, 102, 0.15);
    color: var(--accent-danger);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-bright) transparent;
}

.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-bright);
    border-radius: 3px;
}

.msg {
    display: flex;
    animation: msgIn 0.3s ease;
}

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

.msg-bot { justify-content: flex-start; }
.msg-user { justify-content: flex-end; }

.msg-bubble {
    max-width: 85%;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.msg-bot .msg-bubble {
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.msg-user .msg-bubble {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-bottom-right-radius: 4px;
}

.msg-typing .msg-bubble {
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid var(--border);
    display: inline-flex;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 12px;
}

.suggestion {
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.suggestion:hover {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-primary);
    border-color: var(--border-bright);
}

.chat-input-area {
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
}

.api-key-bar {
    display: none;
    gap: 6px;
    margin-bottom: 8px;
}

.api-key-bar.show { display: flex; }

.api-key-bar input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.api-key-bar input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.api-key-bar button {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
}

.chat-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

#chatInput {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 100px;
    font-family: var(--font-sans);
    font-size: 14px;
    transition: all 0.2s;
}

#chatInput:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

#chatSend {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

#chatSend:hover { transform: scale(1.05); }
#chatSend:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-footer {
    text-align: center;
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 8px;
}

.chat-footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

.chat-footer a:hover { text-decoration: underline; }

/* ============ FOOTER ============ */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 60px 0 24px;
    margin-top: 60px;
    position: relative;
    z-index: 1;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-primary);
    margin-bottom: 14px;
    font-family: var(--font-mono);
}

.footer a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.footer a:hover { color: var(--accent-primary); }

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
    font-family: var(--font-mono);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 968px) {
    .hero {
        flex-direction: column;
        padding: 100px 24px 60px;
        text-align: center;
    }

    .hero-content { max-width: 100%; }
    .hero-description { margin: 0 auto 36px; }
    .hero-actions { justify-content: center; }
    .hero-stats { justify-content: center; }

    .theory-block, .fall-wrapper, .circular-wrapper {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .burger { display: flex; }

    .nav-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(5, 8, 20, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 20px;
        gap: 8px;
        border-bottom: 1px solid var(--border);
        transform: translateY(-120%);
        transition: transform 0.3s;
    }

    .nav-menu.open { transform: translateY(0); }

    .nav-container { padding: 14px 20px; }

    .hero { padding: 100px 20px 60px; gap: 40px; }
    .hero-stats { gap: 28px; flex-wrap: wrap; }

    .module { padding: 70px 0; }
    .container { padding: 0 20px; }

    .cards-grid { grid-template-columns: 1fr; }

    .theory-text, .formula-panel, .fall-text, .circular-visual, .circular-text {
        padding: 24px;
    }

    .calc-container, .test-container { padding: 24px; }

    .calc-tabs { flex-wrap: nowrap; }

    .chat-window {
        width: calc(100vw - 24px);
        height: calc(100vh - 100px);
        bottom: 80px;
        right: -8px;
    }

    .chat-widget { bottom: 16px; right: 16px; }
    .chat-toggle { width: 56px; height: 56px; }

    .footer-content { grid-template-columns: 1fr; gap: 24px; }
    .hero-stats { gap: 20px; }
    .stat-num { font-size: 24px; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 40px; }
    .module-title { font-size: 26px; }
    .btn { padding: 12px 20px; font-size: 14px; }
    .calc-inputs { grid-template-columns: 1fr; }
}

/* ============================================
   VISUALIZER MODULE
   ============================================ */

.viz-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.viz-tab {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 12px 22px;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.viz-tab:hover {
    color: var(--accent-primary);
    border-color: var(--border-bright);
    background: rgba(0, 212, 255, 0.05);
}

.viz-tab.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(124, 58, 237, 0.2));
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.4);
}

.viz-panel {
    display: none;
    animation: fadeIn 0.5s ease;
}

.viz-panel.active { display: block; }

.viz-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    align-items: start;
}

.viz-controls {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    backdrop-filter: blur(16px);
    max-height: 720px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-bright) transparent;
}

.viz-controls::-webkit-scrollbar { width: 6px; }
.viz-controls::-webkit-scrollbar-track { background: transparent; }
.viz-controls::-webkit-scrollbar-thumb {
    background: var(--border-bright);
    border-radius: 3px;
}

.viz-section-title {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-primary);
    margin: 20px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.viz-section-title:first-child { margin-top: 0; }

.formula-input-group {
    margin-bottom: 14px;
}

.formula-input-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-family: var(--font-mono);
}

.help-hint {
    color: var(--text-dim);
    font-size: 10px;
    text-transform: none;
    letter-spacing: 0;
}

.formula-input-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    color: var(--accent-primary);
    padding: 10px 12px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 13px;
    transition: all 0.2s;
}

.formula-input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.formula-input-group input.error {
    border-color: var(--accent-danger);
    box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.15);
}

.formula-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.preset-btn {
    background: rgba(0, 212, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-primary);
    border-color: var(--border-bright);
}

.slider-group {
    margin-bottom: 16px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.slider-header label {
    font-size: 12px;
    color: var(--text-secondary);
}

.slider-value {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-success);
    background: rgba(0, 255, 157, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 157, 0.2);
    min-width: 60px;
    text-align: center;
}

.neon-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(0, 212, 255, 0.15);
    border-radius: 100px;
    outline: none;
    cursor: pointer;
}

.neon-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-primary);
    transition: all 0.15s;
}

.neon-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px var(--accent-primary);
}

.neon-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px var(--accent-primary);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.check-item:hover {
    background: rgba(0, 212, 255, 0.05);
}

.check-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.check-mark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--c, var(--accent-primary));
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s;
}

.check-item input:checked + .check-mark {
    background: var(--c, var(--accent-primary));
    box-shadow: 0 0 8px var(--c, var(--accent-primary));
}

.check-item input:checked + .check-mark::after {
    content: '✓';
    position: absolute;
    inset: 0;
    color: var(--bg-primary);
    font-size: 11px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viz-info-card {
    margin-top: 20px;
    padding: 12px 14px;
    background: rgba(124, 58, 237, 0.06);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 8px;
}

.info-title {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.info-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.info-text code {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.08);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
}

/* ===== VIZ DISPLAY ===== */
.viz-display {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    backdrop-filter: blur(16px);
    min-height: 580px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.plot-wrapper {
    position: relative;
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, 0.08);
    min-height: 450px;
}

#plot2d {
    width: 100%;
    height: 100%;
    display: block;
}

.plot-tooltip {
    position: absolute;
    background: rgba(5, 8, 20, 0.95);
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-primary);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    z-index: 10;
    white-space: nowrap;
}

.plot-tooltip.show { opacity: 1; }

.plot-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.stat-chip {
    flex: 1;
    min-width: 100px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--c, var(--border));
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chip-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.chip-val {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--c, var(--accent-primary));
    text-shadow: 0 0 8px var(--c, var(--accent-primary));
}

/* ===== 3D PLOT ===== */
.plotly-container {
    width: 100%;
    height: 600px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    border: 1px solid rgba(0, 212, 255, 0.08);
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.preset-card {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    color: var(--text-secondary);
}

.preset-card:hover {
    background: rgba(0, 212, 255, 0.12);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.preset-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.preset-name {
    font-size: 11px;
    font-family: var(--font-mono);
}

.viz-btn {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--border-bright);
    color: var(--accent-primary);
    padding: 10px 16px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    margin-top: 8px;
}

.viz-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--accent-primary);
}

.viz-btn.primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    margin-top: 0;
    width: auto;
}

.viz-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 212, 255, 0.35);
}

/* ===== QUEST ===== */
.quest-container {
    max-width: 780px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px;
    backdrop-filter: blur(16px);
}

.quest-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.quest-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.5));
}

.quest-header h3 {
    font-size: 22px;
    color: var(--text-primary);
    margin: 0;
}

.quest-problem {
    background: rgba(0, 212, 255, 0.05);
    border-left: 3px solid var(--accent-primary);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 18px;
}

.problem-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
}

.quest-problem p {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

.quest-formula {
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.25);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.quest-formula code {
    font-family: var(--font-mono);
    color: var(--accent-secondary);
    background: rgba(124, 58, 237, 0.12);
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 6px;
    font-size: 0.95em;
}

.quest-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.quest-input-row input {
    flex: 1;
    min-width: 180px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 15px;
}

.quest-input-row input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.quest-feedback {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
    animation: fadeIn 0.3s ease;
    margin-bottom: 20px;
}

.quest-feedback.show { display: block; }

.quest-feedback.success {
    background: rgba(0, 255, 157, 0.08);
    border-left: 3px solid var(--accent-success);
    color: var(--accent-success);
}

.quest-feedback.error {
    background: rgba(255, 51, 102, 0.08);
    border-left: 3px solid var(--accent-danger);
    color: var(--text-secondary);
}

.quest-score {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.score-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.score-bar {
    height: 6px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 100px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-success));
    width: 0;
    transition: width 0.6s ease;
    box-shadow: 0 0 10px var(--accent-primary);
}

.score-num {
    font-family: var(--font-mono);
    font-size: 15px;
    color: var(--accent-success);
    font-weight: 700;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 968px) {
    .viz-grid {
        grid-template-columns: 1fr;
    }

    .viz-controls {
        max-height: none;
    }

    .plotly-container { height: 450px; }
}

@media (max-width: 768px) {
    .viz-tabs { justify-content: flex-start; overflow-x: auto; }
    .viz-tab { padding: 10px 16px; font-size: 13px; white-space: nowrap; }
    .viz-controls, .quest-container { padding: 18px; }
    .plot-wrapper { min-height: 320px; }
    .plotly-container { height: 380px; }
    .preset-grid { grid-template-columns: repeat(2, 1fr); }
    .quest-input-row { flex-direction: column; }
    .quest-input-row input { min-width: 0; }
    .quest-input-row button { width: 100%; }
    .quest-score { grid-template-columns: 1fr; text-align: center; gap: 8px; }
}

/* ============================================
   COLLISION LAB
   ============================================ */
.lab-wrapper {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    align-items: start;
}

.lab-controls {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 90px;
}

.ball-panel {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.ball-panel.ball-blue {
    border-left: 3px solid #00d4ff;
    box-shadow: inset 4px 0 20px rgba(0, 212, 255, 0.08);
}

.ball-panel.ball-magenta {
    border-left: 3px solid #ff00ff;
    box-shadow: inset 4px 0 20px rgba(255, 0, 255, 0.08);
}

.ball1-slider::-webkit-slider-thumb { background: #00d4ff; box-shadow: 0 0 12px #00d4ff; }
.ball1-slider::-moz-range-thumb { background: #00d4ff; box-shadow: 0 0 12px #00d4ff; }
.ball2-slider::-webkit-slider-thumb { background: #ff00ff; box-shadow: 0 0 12px #ff00ff; }
.ball2-slider::-moz-range-thumb { background: #ff00ff; box-shadow: 0 0 12px #ff00ff; }

.collision-type {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.radio-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: var(--text-primary);
}

.radio-item:hover {
    border-color: var(--border-bright);
    background: rgba(0, 212, 255, 0.05);
}

.radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-mark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-bright);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.radio-item input[type="radio"]:checked ~ .radio-mark {
    border-color: var(--accent-primary);
    background: radial-gradient(circle, var(--accent-primary) 0%, var(--accent-primary) 45%, transparent 50%);
    box-shadow: 0 0 10px var(--accent-primary);
}

.radio-item input[type="radio"]:checked ~ span:not(.radio-mark) {
    color: var(--accent-primary);
}

.radio-item small {
    color: var(--text-dim);
    font-size: 11px;
    font-style: italic;
}

.lab-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.lab-buttons #labStart { grid-column: 1 / -1; }

.viz-btn.slomo {
    background: rgba(255, 184, 0, 0.08);
    border-color: rgba(255, 184, 0, 0.3);
    color: #ffb800;
}

.viz-btn.slomo:hover {
    background: rgba(255, 184, 0, 0.15);
    border-color: #ffb800;
}

.viz-btn.slomo.active {
    background: linear-gradient(135deg, #ffb800, #ff6b00);
    color: #fff;
    border-color: #ffb800;
    box-shadow: 0 0 16px rgba(255, 184, 0, 0.5);
}

.lab-info-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(124, 58, 237, 0.05));
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 12px;
}

.lab-info-card .info-title {
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 12px;
}

.lab-info-card .info-text {
    color: var(--text-secondary);
    line-height: 1.5;
}

.lab-info-card code {
    font-family: var(--font-mono);
    background: rgba(0, 212, 255, 0.12);
    color: var(--accent-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.92em;
}

/* Stage */
.lab-stage {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lab-canvas-wrap {
    background: radial-gradient(ellipse at center, rgba(10, 16, 36, 0.95) 0%, rgba(5, 8, 20, 0.98) 100%);
    border: 1px solid var(--border-bright);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--glow), inset 0 0 40px rgba(0, 212, 255, 0.04);
}

#labCanvas {
    display: block;
    width: 100%;
    height: auto;
    touch-action: none;
}

.slomo-indicator {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #ffb800, #ff6b00);
    color: white;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    border-radius: 100px;
    letter-spacing: 1px;
    box-shadow: 0 0 16px rgba(255, 184, 0, 0.5);
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.3s;
    pointer-events: none;
}

.slomo-indicator.show {
    opacity: 1;
    transform: translateY(0);
    animation: slomoPulse 2s ease-in-out infinite;
}

@keyframes slomoPulse {
    0%, 100% { box-shadow: 0 0 16px rgba(255, 184, 0, 0.5); }
    50% { box-shadow: 0 0 28px rgba(255, 184, 0, 0.9); }
}

.lab-legend {
    position: absolute;
    bottom: 14px;
    left: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.leg-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    background: rgba(10, 16, 36, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}

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

.leg-chip .arr {
    width: 16px;
    height: 2px;
    border-radius: 2px;
}

/* Stats */
.lab-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.lab-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
    transition: all 0.2s;
}

.lab-stat-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.lab-stat-val {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-primary);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

.lab-stat-hint {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
}

.lab-stat.conservation.ok {
    border-color: var(--accent-success);
    background: rgba(0, 255, 157, 0.05);
}

.lab-stat.conservation.ok .lab-stat-val {
    color: var(--accent-success);
    text-shadow: 0 0 10px rgba(0, 255, 157, 0.4);
}

.lab-stat.conservation.warn {
    border-color: rgba(255, 184, 0, 0.4);
    background: rgba(255, 184, 0, 0.05);
}

.lab-stat.conservation.warn .lab-stat-val {
    color: #ffb800;
    text-shadow: 0 0 10px rgba(255, 184, 0, 0.4);
}

/* Live vectors panel */
.lab-vectors-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vec-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
}

.vec-label {
    font-weight: 700;
    min-width: 60px;
}

.vec-item span {
    color: var(--accent-success);
    font-weight: 700;
}

/* Responsive */
@media (max-width: 968px) {
    .lab-wrapper {
        grid-template-columns: 1fr;
    }
    .lab-controls {
        position: static;
    }
    .lab-stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .lab-stats-grid { grid-template-columns: 1fr 1fr; }
    .lab-stats-grid .conservation { grid-column: 1 / -1; }
    .vec-row { font-size: 12px; }
    .lab-buttons { grid-template-columns: 1fr; }
    .lab-buttons #labStart { grid-column: auto; }
    .lab-legend { position: static; padding: 8px 14px; background: rgba(5, 8, 20, 0.5); }
}

/* ============================================
   INLINE DEMO BLOCKS (per-module teaching demos)
   ============================================ */
.demo-block {
    margin-top: 40px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(124, 58, 237, 0.05));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 0 40px rgba(0, 212, 255, 0.03);
}

.demo-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.demo-icon {
    font-size: 36px;
    line-height: 1;
    filter: drop-shadow(0 0 12px rgba(0, 212, 255, 0.4));
}

.demo-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.demo-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.demo-stage {
    background: radial-gradient(ellipse at center, rgba(10, 16, 36, 0.9), rgba(5, 8, 20, 0.98));
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: inset 0 0 30px rgba(0, 212, 255, 0.04);
}

.demo-stage canvas {
    display: block;
    width: 100%;
    height: auto;
    max-height: 420px;
}

.demo-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.demo-slider {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
}

.demo-slider .slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.demo-slider .slider-header label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-family: var(--font-mono);
}

.demo-slider .slider-header label span:not(.swatch),
.demo-slider .slider-header label b {
    color: var(--accent-primary);
    font-weight: 700;
}

.swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}

.demo-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.demo-mode-toggle {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
}

.mode-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 7px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.mode-btn:hover {
    color: var(--accent-primary);
}

.mode-btn.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(124, 58, 237, 0.2));
    color: var(--accent-primary);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
}

.demo-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.demo-stat {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 14px;
}

.demo-stat-label {
    color: var(--text-secondary);
}

.demo-stat-val {
    color: var(--accent-success);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(0, 255, 157, 0.4);
}

.demo-live-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.live-chip {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 6px 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

.live-chip span {
    color: var(--accent-primary);
    font-weight: 700;
}

.live-chip b {
    color: var(--accent-success);
    font-weight: 700;
}

.demo-hint {
    background: rgba(255, 184, 0, 0.05);
    border-left: 3px solid rgba(255, 184, 0, 0.5);
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.demo-hint strong {
    color: var(--accent-primary);
}

.demo-hint code {
    font-family: var(--font-mono);
    background: rgba(0, 212, 255, 0.12);
    color: var(--accent-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.92em;
}

@media (max-width: 768px) {
    .demo-block { padding: 18px; }
    .demo-header { flex-direction: column; text-align: center; align-items: center; }
    .demo-stats-row { grid-template-columns: 1fr; }
    .demo-mode-toggle { flex-direction: column; }
    .demo-actions { flex-direction: column; }
    .demo-actions .viz-btn { width: 100%; justify-content: center; }
}

/* ============================================
   AI SOLVER MODULE
   ============================================ */
.solver-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 28px;
    align-items: start;
}

.solver-input-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 90px;
}

.solver-label {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 10px;
}

#solverInput {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 14px 16px;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    min-height: 100px;
    transition: all 0.2s;
}

#solverInput:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
    background: rgba(0, 0, 0, 0.5);
}

#solverInput::placeholder {
    color: var(--text-dim);
}

.solver-examples {
    margin: 16px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.examples-label {
    font-size: 12px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 6px;
}

.example-chip {
    background: rgba(0, 212, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.example-chip:hover {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-primary);
    border-color: var(--border-bright);
    transform: translateY(-1px);
}

.solver-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.solver-actions .viz-btn {
    flex: 1;
    justify-content: center;
}

.solver-actions #solveBtn {
    flex: 2;
}

.solver-note {
    background: rgba(255, 184, 0, 0.05);
    border-left: 3px solid rgba(255, 184, 0, 0.5);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.solver-note strong {
    color: var(--accent-primary);
}

.solver-output {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    backdrop-filter: blur(10px);
    min-height: 400px;
    box-shadow: var(--glow);
}

.solver-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 340px;
    color: var(--text-dim);
    opacity: 0.6;
}

.solver-placeholder svg {
    color: var(--accent-primary);
    margin-bottom: 16px;
    opacity: 0.4;
}

.solver-placeholder p {
    max-width: 300px;
    line-height: 1.6;
}

.solver-placeholder strong {
    color: var(--accent-primary);
}

.solver-section {
    margin-bottom: 24px;
    animation: solverFadeIn 0.5s ease;
}

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

.solver-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.solver-section-title .icon {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(124, 58, 237, 0.2));
    border-radius: 6px;
    font-size: 14px;
}

.given-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 4px;
}

.given-item {
    background: rgba(0, 212, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: var(--font-mono);
}

.given-item .given-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.given-item .given-value {
    font-size: 15px;
    color: var(--accent-primary);
    font-weight: 700;
}

.solver-text {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 14px;
}

.solver-text code {
    font-family: var(--font-mono);
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.93em;
}

.solver-steps {
    list-style: none;
    counter-reset: step;
}

.solver-steps li {
    counter-increment: step;
    position: relative;
    padding: 10px 0 10px 42px;
    color: var(--text-secondary);
    line-height: 1.6;
    border-bottom: 1px dashed rgba(0, 212, 255, 0.08);
}

.solver-steps li:last-child { border-bottom: none; }

.solver-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 10px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.solver-answer {
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.08), rgba(0, 212, 255, 0.05));
    border: 1px solid rgba(0, 255, 157, 0.3);
    border-left: 3px solid var(--accent-success);
    border-radius: 10px;
    padding: 18px 22px;
    font-family: var(--font-mono);
}

.solver-answer .answer-label {
    font-size: 11px;
    color: var(--accent-success);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.solver-answer .answer-value {
    font-size: 20px;
    color: var(--accent-success);
    font-weight: 700;
    text-shadow: 0 0 12px rgba(0, 255, 157, 0.4);
}

.solver-answer .answer-value .item {
    display: block;
    margin: 4px 0;
}

.solver-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loader-ring {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.solver-error {
    background: rgba(255, 51, 102, 0.08);
    border-left: 3px solid var(--accent-danger);
    border-radius: 6px;
    padding: 14px 18px;
    color: #ff6b8a;
    font-size: 14px;
}

@media (max-width: 968px) {
    .solver-wrapper { grid-template-columns: 1fr; }
    .solver-input-block { position: static; }
}

/* ============================================
   SKETCH EDITOR
   ============================================ */
.sketch-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.sketch-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-group-right {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.tool-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 4px;
}

.tool-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
}

.tool-btn:hover {
    color: var(--accent-primary);
    border-color: var(--border-bright);
}

.tool-btn.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(124, 58, 237, 0.15));
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.tool-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 13px;
    width: 70px;
}

.tool-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.tool-unit {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

.sketch-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 0;
    min-height: 500px;
}

.sketch-canvas-wrap {
    position: relative;
    background: radial-gradient(ellipse at center, rgba(10, 16, 36, 0.95), rgba(5, 8, 20, 0.98));
    border-right: 1px solid var(--border);
}

#sketchCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}

.sketch-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-dim);
    font-size: 14px;
    pointer-events: none;
    text-align: center;
    background: rgba(5, 8, 20, 0.7);
    padding: 10px 18px;
    border-radius: 100px;
    border: 1px dashed var(--border-bright);
    backdrop-filter: blur(4px);
    transition: opacity 0.3s;
}

.sketch-hint.hidden {
    opacity: 0;
}

.sketch-results {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(5, 8, 20, 0.3);
    overflow-y: auto;
}

.sketch-stat {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s;
}

.sketch-stat:hover {
    border-color: var(--border-bright);
    background: rgba(0, 0, 0, 0.4);
}

.sketch-stat-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px currentColor);
}

.sketch-stat-body {
    flex: 1;
    min-width: 0;
}

.sketch-stat-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-mono);
    margin-bottom: 2px;
}

.sketch-stat-val {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-success);
    text-shadow: 0 0 8px rgba(0, 255, 157, 0.3);
    margin-bottom: 2px;
}

.sketch-stat-desc {
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.4;
}

.sketch-info-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(124, 58, 237, 0.05));
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: auto;
}

.sketch-info-card .info-title {
    color: var(--accent-primary);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}

.sketch-info-card .info-text {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
}

.sketch-info-card .info-text strong {
    color: var(--accent-primary);
}

@media (max-width: 968px) {
    .sketch-grid {
        grid-template-columns: 1fr;
    }
    .sketch-canvas-wrap {
        border-right: none;
        border-bottom: 1px solid var(--border);
        min-height: 400px;
    }
    #sketchCanvas { min-height: 400px; }
}

@media (max-width: 768px) {
    .sketch-toolbar { padding: 10px 14px; gap: 8px; }
    .tool-group-right { margin-left: 0; width: 100%; justify-content: flex-end; }
    .tool-btn { padding: 6px 10px; font-size: 12px; }
    .solver-input-block, .solver-output { padding: 18px; }
    #solverInput { font-size: 13px; min-height: 80px; }
}

/* ============================================
   SOLVER — Solution rendering
   ============================================ */
.solver-result {
    animation: fadeIn 0.4s ease;
}

.result-type-badge {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(124, 58, 237, 0.15));
    border: 1px solid var(--border-bright);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-primary);
    margin-bottom: 18px;
    letter-spacing: 0.5px;
}

.result-section {
    margin-bottom: 22px;
}

.result-section-title {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-primary);
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.given-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.given-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-primary);
    border-radius: 6px;
    font-size: 13px;
}

.given-name {
    color: var(--text-secondary);
}

.given-value {
    font-family: var(--font-mono);
    color: var(--accent-success);
    font-weight: 700;
}

.find-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.find-chip {
    padding: 7px 14px;
    background: rgba(255, 184, 0, 0.08);
    border: 1px solid rgba(255, 184, 0, 0.3);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #ffb800;
}

.solution-step {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.solution-step:hover {
    border-color: var(--border-bright);
    background: rgba(0, 212, 255, 0.03);
}

.step-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.step-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-radius: 50%;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.step-label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.step-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 34px;
}

.step-formula, .step-subst {
    font-size: 13px;
    color: var(--text-secondary);
}

.formula-tag {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.step-body code {
    font-family: var(--font-mono);
    background: rgba(0, 212, 255, 0.08);
    color: var(--accent-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.95em;
}

.step-result {
    font-family: var(--font-mono);
    color: var(--accent-success);
    font-weight: 700;
    font-size: 14px;
    padding: 6px 10px;
    background: rgba(0, 255, 157, 0.06);
    border-left: 2px solid var(--accent-success);
    border-radius: 4px;
    margin-top: 4px;
}

.solver-answer {
    margin-top: 22px;
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.08), rgba(0, 212, 255, 0.05));
    border: 1px solid rgba(0, 255, 157, 0.3);
    border-radius: 12px;
    box-shadow: 0 0 24px rgba(0, 255, 157, 0.1);
}

.answer-title {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-success);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.answer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(0, 255, 157, 0.15);
}

.answer-row:last-child { border-bottom: none; }

.answer-key {
    color: var(--text-secondary);
    font-size: 13px;
}

.answer-val {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-success);
    text-shadow: 0 0 10px rgba(0, 255, 157, 0.4);
}

.solver-error {
    padding: 14px 18px;
    background: rgba(255, 51, 102, 0.08);
    border: 1px solid rgba(255, 51, 102, 0.3);
    border-left: 3px solid var(--accent-danger);
    border-radius: 8px;
    color: var(--accent-danger);
    font-size: 14px;
}

.solver-warning {
    padding: 14px 18px;
    background: rgba(255, 184, 0, 0.06);
    border: 1px solid rgba(255, 184, 0, 0.3);
    border-left: 3px solid #ffb800;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
}

.solver-warning em {
    color: #ffb800;
    font-style: italic;
}

/* ===== VARIANT TABS for topic quizzes ===== */
.variant-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.variant-tab {
    padding: 10px 28px;
    border: 2px solid var(--accent);
    background: transparent;
    color: var(--accent);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.variant-tab.active,
.variant-tab:hover {
    background: var(--accent);
    color: #000;
}

/* ===== NAV DROPDOWN ===== */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 190px;
    padding: 8px 0;
    z-index: 999;
    list-style: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-menu li a {
    display: block;
    padding: 10px 18px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}
.nav-dropdown-menu li a:hover {
    color: var(--accent);
}

/* ===== Registration / Teacher Stats / AI Test Maker additions ===== */
.user-chip{
    border:1px solid rgba(0,212,255,.35); background:rgba(0,212,255,.08); color:var(--text-primary,#fff);
    border-radius:999px; padding:10px 14px; cursor:pointer; font-weight:700; white-space:nowrap;
    box-shadow:0 0 18px rgba(0,212,255,.14); transition:.2s ease;
}
.user-chip:hover{transform:translateY(-1px); border-color:rgba(0,212,255,.75)}
.auth-overlay{position:fixed; inset:0; display:none; place-items:center; background:rgba(3,7,18,.78); backdrop-filter:blur(10px); z-index:9999; padding:20px;}
.auth-overlay.show{display:grid;}
.auth-card{width:min(520px,100%); position:relative; border:1px solid rgba(0,212,255,.25); border-radius:28px; padding:28px; background:linear-gradient(145deg,rgba(10,18,40,.96),rgba(18,10,35,.96)); box-shadow:0 30px 80px rgba(0,0,0,.45),0 0 50px rgba(124,58,237,.18);}
.auth-close{position:absolute; right:18px; top:14px; font-size:28px; color:var(--text-secondary,#b8c2d6); background:transparent; border:0; cursor:pointer;}
.auth-badge{display:inline-flex; padding:6px 12px; border-radius:999px; background:rgba(0,255,157,.1); color:#00ff9d; border:1px solid rgba(0,255,157,.25); font-weight:700; margin-bottom:12px;}
.auth-card h2{margin:0 0 8px; font-size:30px}.auth-card p{color:var(--text-secondary,#b8c2d6); margin-bottom:20px;}
.auth-form{display:grid; gap:14px}.auth-form label,.ai-maker-card label{display:grid; gap:8px; color:var(--text-secondary,#b8c2d6); font-weight:700;}
.auth-form input,.auth-form select,.stats-tools input,.stats-tools select,.ai-maker-card input,.ai-maker-card select{width:100%; padding:13px 14px; border-radius:16px; border:1px solid rgba(255,255,255,.14); background:rgba(255,255,255,.06); color:var(--text-primary,#fff); outline:none;}
.auth-form option,.ai-maker-card option,.stats-tools option{background:#111827; color:#fff;}
.role-grid{display:grid; grid-template-columns:1fr 1fr; gap:12px}.role-card{border:1px solid rgba(255,255,255,.14); border-radius:18px; padding:14px; background:rgba(255,255,255,.045); cursor:pointer}.role-card input{width:auto; margin-right:8px}.role-card span{color:var(--text-primary,#fff)}
.teacher-dashboard{display:grid; grid-template-columns:repeat(4,minmax(150px,1fr)); gap:16px; margin-bottom:18px}.dash-card{padding:18px; border-radius:22px; border:1px solid rgba(0,212,255,.18); background:rgba(255,255,255,.055)}.dash-card span{display:block; color:var(--text-secondary,#b8c2d6); margin-bottom:8px}.dash-card strong{font-size:34px; color:#00d4ff}.calc-btn.danger{border-color:rgba(255,51,102,.35); color:#ff6b8d}.stats-tools{display:grid; grid-template-columns:1fr 220px; gap:14px; margin:18px 0}.stats-table-wrap{overflow:auto; border-radius:22px; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.035)}.stats-table{width:100%; border-collapse:collapse; min-width:780px}.stats-table th,.stats-table td{padding:14px 16px; border-bottom:1px solid rgba(255,255,255,.08); text-align:left}.stats-table th{color:#00d4ff; background:rgba(0,212,255,.07)}.stats-table td{color:var(--text-secondary,#d6deef)}
.ai-maker-grid{display:grid; grid-template-columns:minmax(280px,420px) 1fr; gap:22px}.ai-maker-card,.ai-output-card{border:1px solid rgba(124,58,237,.23); border-radius:26px; background:rgba(255,255,255,.05); padding:22px}.ai-maker-card{display:grid; gap:16px}.ai-maker-actions{display:grid; gap:10px}.mini-note{font-size:13px; color:var(--text-dim,#8b96ad)}.output-toolbar{display:flex; justify-content:space-between; align-items:center; margin-bottom:12px}.small-btn{border:1px solid rgba(0,212,255,.3); background:rgba(0,212,255,.09); color:#fff; border-radius:12px; padding:8px 12px; cursor:pointer}#generatedTests{white-space:pre-wrap; min-height:360px; max-height:650px; overflow:auto; margin:0; color:#e7eefc; font-family:'JetBrains Mono',monospace; font-size:14px; line-height:1.65; background:rgba(0,0,0,.18); border-radius:18px; padding:18px; border:1px solid rgba(255,255,255,.08)}
@media (max-width:900px){.teacher-dashboard,.ai-maker-grid,.stats-tools{grid-template-columns:1fr}.user-chip{padding:8px 10px}.role-grid{grid-template-columns:1fr}}

/* ===== AI student live test ===== */
.ai-test-box{white-space:normal; min-height:360px; max-height:720px; overflow:auto; margin:0; color:#e7eefc; font-family:var(--font-sans,Arial,sans-serif); font-size:15px; line-height:1.65; background:rgba(0,0,0,.18); border-radius:18px; padding:18px; border:1px solid rgba(255,255,255,.08)}
.ai-loading{padding:22px; text-align:center; color:var(--accent-primary,#00d4ff); font-weight:700}.ai-test-head{margin-bottom:18px; padding:16px; border-radius:16px; background:rgba(0,212,255,.08); border:1px solid rgba(0,212,255,.18)}.ai-test-head h3{margin:0 0 6px; color:var(--text-primary,#fff)}.ai-test-head p{margin:0; color:var(--text-secondary,#b8c2d6)}.ai-live-question{padding:16px; border:1px solid rgba(255,255,255,.08); border-radius:16px; background:rgba(255,255,255,.035)}.ai-option input{accent-color:var(--accent-primary,#00d4ff); margin-right:8px}.ai-option::before{display:none}#aiCheckBtn{margin-top:10px;width:100%}#aiResultBox .quiz-complete{margin-top:18px; border-radius:18px; background:rgba(255,255,255,.05); border:1px solid rgba(0,255,157,.18)}


/* =========================================================
   FINAL NAVBAR FIX — stable desktop + responsive mobile
   ҚОЙЫЛҒАН СОҢ ЕСКІ NAVBAR/LOGO FIX КОДТАРЫ КЕРЕК ЕМЕС
   ========================================================= */

.navbar {
    height: 74px !important;
    min-height: 74px !important;
    overflow: visible !important;
}

.nav-container {
    max-width: 1360px !important;
    height: 74px !important;
    margin: 0 auto !important;
    padding: 0 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 26px !important;
    overflow: visible !important;
}

.logo {
    flex: 0 0 210px !important;
    width: 210px !important;
    min-width: 210px !important;
    max-width: 210px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    overflow: visible !important;
    white-space: nowrap !important;
    font-size: 18px !important;
    line-height: 1 !important;
}

.logo-icon {
    flex: 0 0 32px !important;
    width: 32px !important;
    height: 32px !important;
}

.logo span,
.logo .logo-accent {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.nav-menu {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: 74px !important;
    list-style: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 4px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    white-space: nowrap !important;
}

.nav-menu::-webkit-scrollbar {
    display: none !important;
}

.nav-menu li {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
}

.nav-link {
    flex: 0 0 auto !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 10px !important;
    border-radius: 10px !important;
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.nav-link:hover {
    color: var(--accent-primary) !important;
    background: rgba(0, 212, 255, 0.08) !important;
}

.nav-link.active {
    color: var(--accent-primary) !important;
    background: rgba(0, 212, 255, 0.10) !important;
}

.nav-link.active::after {
    bottom: -18px !important;
}

/* Dropdown inside navbar */
.nav-menu .dropdown,
.nav-menu .dropdown-menu {
    position: absolute !important;
    top: 58px !important;
    right: 0 !important;
    z-index: 999 !important;
}

/* Login / role button */
.nav-menu .login-btn,
.nav-menu .auth-btn,
.nav-menu button,
#loginBtn,
#logoutBtn {
    flex: 0 0 auto !important;
    height: 42px !important;
    max-width: 180px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 16px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Main content offset for fixed navbar */
.hero {
    padding-top: 120px !important;
}

/* Medium screens: keep all buttons, allow horizontal scroll */
@media (max-width: 1250px) {
    .nav-container {
        max-width: 100% !important;
        padding: 0 16px !important;
        gap: 18px !important;
    }

    .logo {
        flex-basis: 190px !important;
        width: 190px !important;
        min-width: 190px !important;
        max-width: 190px !important;
        font-size: 16px !important;
    }

    .nav-link {
        font-size: 12px !important;
        padding: 0 8px !important;
    }
}

/* Mobile menu */
@media (max-width: 768px) {
    .navbar {
        height: 64px !important;
        min-height: 64px !important;
    }

    .nav-container {
        height: 64px !important;
        padding: 0 18px !important;
        justify-content: space-between !important;
    }

    .logo {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        font-size: 16px !important;
    }

    .burger {
        display: flex !important;
        flex: 0 0 auto !important;
        z-index: 1001 !important;
    }

    .nav-menu {
        position: fixed !important;
        top: 64px !important;
        left: 0 !important;
        right: 0 !important;
        height: auto !important;
        max-height: calc(100vh - 64px) !important;
        padding: 18px !important;
        background: rgba(5, 8, 20, 0.98) !important;
        border-bottom: 1px solid var(--border) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        transform: translateY(-120%) !important;
        transition: transform 0.3s ease !important;
    }

    .nav-menu.open {
        transform: translateY(0) !important;
    }

    .nav-menu li {
        width: 100% !important;
    }

    .nav-link {
        width: 100% !important;
        height: 44px !important;
        justify-content: flex-start !important;
        padding: 0 14px !important;
        font-size: 14px !important;
    }

    .nav-link.active::after {
        display: none !important;
    }

    .hero {
        padding-top: 100px !important;
    }
}
/* =========================================================
   HARD NAVBAR FIX — логотип сол жақ бұрышта, меню үстіне шықпайды
   Мұны styles.css файлының ЕҢ СОҢЫНА қой
   ========================================================= */

.navbar {
    height: 76px !important;
    min-height: 76px !important;
    background: rgba(5, 8, 20, 0.96) !important;
    border-bottom: 1px solid rgba(0, 212, 255, 0.15) !important;
    overflow: visible !important;
}

.nav-container {
    width: 100% !important;
    max-width: none !important;
    height: 76px !important;
    margin: 0 !important;
    padding: 0 28px 0 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 34px !important;
    overflow: visible !important;
}

/* ЛОГОТИП: толық сол жаққа, ештеңе жаппайды */
.logo {
    flex: 0 0 250px !important;
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
    height: 76px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    white-space: nowrap !important;
    position: relative !important;
    z-index: 5 !important;
}

.logo-icon {
    flex: 0 0 34px !important;
    width: 34px !important;
    height: 34px !important;
    margin: 0 !important;
}

.logo span,
.logo .logo-accent {
    display: inline-block !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1 !important;
}

.logo {
    font-size: 18px !important;
    font-weight: 800 !important;
    letter-spacing: 1px !important;
}

/* МЕНЮ: логотиптен кейін ғана басталады */
.nav-menu {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: 76px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.nav-menu::-webkit-scrollbar {
    display: none !important;
}

.nav-menu li {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    height: 76px !important;
}

.nav-link {
    flex: 0 0 auto !important;
    height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 11px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-primary) !important;
    background: rgba(0, 212, 255, 0.08) !important;
}

.nav-link.active::after {
    bottom: -18px !important;
}

/* Мұғалім батырмасы */
.nav-menu button,
.nav-menu .login-btn,
.nav-menu .auth-btn,
#loginBtn,
#logoutBtn {
    flex: 0 0 auto !important;
    height: 42px !important;
    min-width: 120px !important;
    max-width: 190px !important;
    padding: 0 16px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Орта экранда логотип аздап қысқарады, бірақ менюге кірмейді */
@media (max-width: 1280px) {
    .nav-container {
        padding-left: 24px !important;
        padding-right: 18px !important;
        gap: 24px !important;
    }

    .logo {
        flex-basis: 230px !important;
        width: 230px !important;
        min-width: 230px !important;
        max-width: 230px !important;
        font-size: 17px !important;
    }

    .nav-link {
        padding: 0 9px !important;
        font-size: 12.5px !important;
    }
}

@media (max-width: 768px) {
    .navbar,
    .nav-container {
        height: 64px !important;
        min-height: 64px !important;
    }

    .nav-container {
        padding: 0 18px !important;
        justify-content: space-between !important;
        gap: 16px !important;
    }

    .logo {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 64px !important;
        font-size: 16px !important;
    }

    .burger {
        display: flex !important;
    }

    .nav-menu {
        position: fixed !important;
        top: 64px !important;
        left: 0 !important;
        right: 0 !important;
        height: auto !important;
        max-height: calc(100vh - 64px) !important;
        padding: 18px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        background: rgba(5, 8, 20, 0.98) !important;
        transform: translateY(-120%) !important;
        transition: transform 0.3s ease !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    .nav-menu.open {
        transform: translateY(0) !important;
    }

    .nav-menu li,
    .nav-link {
        width: 100% !important;
    }

    .nav-link {
        justify-content: flex-start !important;
        height: 44px !important;
        font-size: 14px !important;
    }

    .nav-link.active::after {
        display: none !important;
    }
}