/* ==========================================
   POLYMARKET MASTERY - MODERN CRYPTO UI
   Dark Glassmorphism + Web3 Aesthetics
   ========================================== */

/* CSS Variables - Advanced Theme System */
:root {
    /* Dark Theme (Default) - Crypto Noir */
    --bg-primary: #050508;
    --bg-secondary: rgba(12, 12, 20, 0.85);
    --bg-tertiary: rgba(22, 22, 35, 0.9);
    --bg-elevated: rgba(30, 30, 45, 0.95);

    /* Glass Effects */
    --glass-bg: rgba(15, 15, 25, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.05);

    /* Text Colors - WCAG AA compliant contrast ratios */
    --text-primary: #f8fafc;
    --text-secondary: #a1afc4;  /* Improved from #94a3b8 for better contrast */
    --text-muted: #8895a7;      /* Improved from #64748b for WCAG AA compliance */

    /* Border & Shadows */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(139, 92, 246, 0.3);

    /* Accent Colors - Neon Crypto Palette */
    --primary: #8b5cf6;
    --primary-hover: #a78bfa;
    --primary-muted: rgba(139, 92, 246, 0.15);
    --primary-glow: rgba(139, 92, 246, 0.4);

    --accent-cyan: #06b6d4;
    --accent-cyan-muted: rgba(6, 182, 212, 0.15);

    --accent-pink: #ec4899;
    --accent-pink-muted: rgba(236, 72, 153, 0.15);

    --success: #10b981;
    --success-muted: rgba(16, 185, 129, 0.15);
    --success-glow: rgba(16, 185, 129, 0.4);

    --warning: #f59e0b;
    --warning-muted: rgba(245, 158, 11, 0.15);

    --danger: #ef4444;
    --danger-muted: rgba(239, 68, 68, 0.15);

    --info: #3b82f6;
    --info-muted: rgba(59, 130, 246, 0.15);

    /* Gradient Orbs */
    --gradient-primary: radial-gradient(circle at center, rgba(139, 92, 246, 0.35) 0%, transparent 70%);
    --gradient-cyan: radial-gradient(circle at center, rgba(6, 182, 212, 0.25) 0%, transparent 70%);
    --gradient-pink: radial-gradient(circle at center, rgba(236, 72, 153, 0.2) 0%, transparent 70%);

    /* Layout */
    --header-height: 72px;
    --sidebar-width: 300px;
    --content-max-width: 920px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.02);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.03);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.2);
    --shadow-glow-sm: 0 0 20px rgba(139, 92, 246, 0.15);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
}

/* Light Theme - Clean Minimal */
[data-theme="light"] {
    --bg-primary: #fafafa;
    --bg-secondary: rgba(255, 255, 255, 0.9);
    --bg-tertiary: rgba(248, 250, 252, 0.95);
    --bg-elevated: rgba(255, 255, 255, 0.98);

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.06);
    --glass-highlight: rgba(0, 0, 0, 0.02);

    --text-primary: #0f172a;
    --text-secondary: #3d4a5c;  /* Improved from #475569 for better contrast */
    --text-muted: #64748b;      /* Kept as is - good contrast on light bg */

    --border-color: rgba(0, 0, 0, 0.06);
    --border-light: rgba(0, 0, 0, 0.1);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);

    --gradient-primary: radial-gradient(circle at center, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    --gradient-cyan: radial-gradient(circle at center, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
    --gradient-pink: radial-gradient(circle at center, rgba(236, 72, 153, 0.06) 0%, transparent 70%);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Background Orbs */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(80px);
    opacity: 0.6;
    animation: floatOrb 20s ease-in-out infinite;
}

body::before {
    width: 600px;
    height: 600px;
    background: var(--gradient-primary);
    top: -200px;
    right: -200px;
}

body::after {
    width: 500px;
    height: 500px;
    background: var(--gradient-cyan);
    bottom: -150px;
    left: -150px;
    animation-delay: -10s;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.02); }
}

/* Third gradient orb via pseudo-element on wrapper */
.app-wrapper {
    position: relative;
    z-index: 1;
}

.app-wrapper::before {
    content: '';
    position: fixed;
    width: 400px;
    height: 400px;
    background: var(--gradient-pink);
    top: 50%;
    left: 30%;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    pointer-events: none;
    animation: floatOrb 25s ease-in-out infinite reverse;
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Code Styling */
code {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
    font-size: 0.875em;
    background: var(--bg-tertiary);
    padding: 0.2em 0.5em;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    color: var(--accent-cyan);
}

pre {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    position: relative;
}

pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.8125rem;
    line-height: 1.8;
    color: var(--text-primary);
}

/* ==========================================
   HEADER - Glassmorphism Navigation
   ========================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1000;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(139, 92, 246, 0.3) 20%,
        rgba(6, 182, 212, 0.3) 50%,
        rgba(236, 72, 153, 0.3) 80%,
        transparent
    );
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-center {
    flex: 1;
    max-width: 480px;
    margin: 0 2rem;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.625rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow-sm);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.logo-icon {
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
    transition: all var(--transition-normal);
}

.logo:hover .logo-icon {
    transform: scale(1.05);
    filter: drop-shadow(0 0 12px var(--primary-glow));
}

.logo-text {
    font-weight: 700;
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Search */
.search-container {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-muted), var(--shadow-glow-sm);
}

.search-input:focus + .search-icon {
    color: var(--primary);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.025em;
}

.progress-bar-mini {
    width: 100px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill-mini {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
    border-radius: 3px;
    transition: width var(--transition-normal);
    position: relative;
}

.progress-fill-mini::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(500%); }
}

/* Theme Toggle */
.theme-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.625rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--warning);
    border-color: var(--warning);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: none; }

/* ==========================================
   SIDEBAR - Glass Navigation Panel
   ========================================== */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 900;
    transition: transform var(--transition-normal);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: -1px;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg,
        var(--primary-muted),
        var(--accent-cyan-muted),
        var(--accent-pink-muted)
    );
    opacity: 0.5;
}

.nav {
    flex: 1;
    padding: 1.25rem;
}

.nav-section {
    margin-bottom: 1.75rem;
}

.nav-section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.75rem 0.875rem 0.5rem;
    display: block;
    line-height: 1.4;
}

.module-badge {
    background: linear-gradient(135deg, var(--primary-muted), var(--accent-cyan-muted));
    color: var(--primary);
    padding: 0.1875rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border: 1px solid var(--primary-muted);
    display: block;
    width: fit-content;
    margin-bottom: 0.375rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 0.8125rem;
    margin-bottom: 0.125rem;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform var(--transition-fast);
    border-radius: 0 2px 2px 0;
}

.nav-item:hover {
    background-color: var(--glass-highlight);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(90deg, var(--primary-muted), transparent);
    color: var(--primary);
    font-weight: 500;
}

.nav-item.active::before {
    transform: scaleY(1);
    box-shadow: 0 0 10px var(--primary-glow);
}

.lesson-number {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 1.75rem;
    font-family: 'JetBrains Mono', monospace;
}

.nav-item.active .lesson-number {
    color: var(--primary);
}

/* Completion Check */
.completion-check {
    margin-left: auto;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-light);
    border-radius: 50%;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    position: relative;
}

.completion-check.completed {
    border-color: var(--success);
    background: var(--success);
    box-shadow: 0 0 8px var(--success-glow);
}

.completion-check.completed::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 3px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: translate(-50%, -60%) rotate(-45deg);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--glass-border);
    background: var(--glass-bg);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    padding: 0.5rem 0;
    transition: color var(--transition-fast);
}

.sidebar-link:hover {
    color: var(--primary);
}

.version-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
}

.legal-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.625rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.legal-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.legal-links a:hover {
    color: var(--primary);
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    padding: 2.5rem;
    position: relative;
}

.content-section {
    display: none;
    max-width: var(--content-max-width);
    margin: 0 auto;
    animation: fadeInUp 0.4s ease-out;
    scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

/* Ensure all anchored elements account for fixed header */
[id] {
    scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

.content-section.active {
    display: block;
}

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

/* Section Header */
.section-header {
    margin-bottom: 2.5rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.breadcrumb .separator {
    opacity: 0.4;
}

.section-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 50%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================
   HERO CARD - Glassmorphism Feature
   ========================================== */
.hero-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: 2.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: var(--gradient-primary);
    filter: blur(60px);
    opacity: 0.4;
    pointer-events: none;
}

.hero-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
}

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

.hero-content h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.625rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-chart {
    width: 100%;
    max-width: 280px;
    position: relative;
}

.chart-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 20px var(--primary-glow));
}

.chart-labels {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0.75rem;
    background: linear-gradient(to top, var(--bg-primary), transparent);
}

.chart-labels span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ==========================================
   BUTTONS - Neon Glow Effects
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::before {
    opacity: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 15px var(--primary-muted);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow-sm);
}

.btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: var(--radius-xl);
}

/* ==========================================
   LEARNING PATH CARDS
   ========================================== */
.learning-paths {
    margin-bottom: 3rem;
}

.learning-paths h3 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.path-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.path-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.path-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.path-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.path-card:hover::before {
    transform: scaleX(1);
}

.path-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    transition: all var(--transition-fast);
}

.path-icon.beginner {
    background: linear-gradient(135deg, var(--info-muted), rgba(59, 130, 246, 0.25));
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.path-icon.intermediate {
    background: linear-gradient(135deg, var(--warning-muted), rgba(245, 158, 11, 0.25));
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.path-icon.advanced {
    background: linear-gradient(135deg, var(--danger-muted), rgba(239, 68, 68, 0.25));
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.path-card:hover .path-icon {
    transform: scale(1.1);
    box-shadow: 0 0 20px currentColor;
}

.path-card h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.path-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.path-topics {
    list-style: none;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.path-topics li {
    padding: 0.375rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.path-topics li::before {
    content: '→';
    color: var(--primary);
    font-weight: bold;
}

.path-duration {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* ==========================================
   KEY FACTS GRID
   ========================================== */
.key-facts h3 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.facts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.fact-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-fast);
}

.fact-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-sm);
}

.fact-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-muted), var(--accent-cyan-muted));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
    border: 1px solid var(--primary-muted);
}

.fact-content {
    display: flex;
    flex-direction: column;
}

.fact-value {
    font-size: 1.375rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fact-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================
   REFERENCE CARDS & TABLES
   ========================================== */
.reference-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.reference-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.reference-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
}

.reference-card.wide {
    grid-column: 1 / -1;
}

.reference-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reference-card h3::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(180deg, var(--primary), var(--accent-cyan));
    border-radius: 2px;
}

.reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.reference-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--glass-border);
}

.reference-table td {
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--glass-border);
    transition: background var(--transition-fast);
}

.reference-table tr:hover td {
    background: var(--glass-highlight);
}

.reference-table td code {
    font-size: 0.75rem;
}

.reference-table td code.address {
    font-size: 0.6875rem;
    word-break: break-all;
}

.reference-table td.positive {
    color: var(--success);
    font-weight: 600;
}

/* ==========================================
   GENERIC TABLE STYLES
   ========================================== */

/* ==========================================
   RESPONSIVE OVERFLOW PREVENTION FRAMEWORK
   ========================================== */

/* Global overflow prevention */
.lesson-content,
.content-section {
    max-width: 100%;
    overflow-x: hidden;
}

/* Long text handling - addresses, URLs, hashes */
.lesson-content p,
.lesson-content li,
.lesson-content dd,
.content-section p,
.content-section li {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* Inline code must break */
code {
    word-break: break-all;
    overflow-wrap: break-word;
}

/* Responsive table wrapper - wraps all tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0 1.5rem 0;
    border-radius: 8px;
}

/* Base table styling for all content tables */
.lesson-content table,
.content-section table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin: 1rem 0 1.5rem 0;
    background: var(--glass-bg);
    border-radius: 8px;
    overflow: hidden;
}

.lesson-content table th,
.content-section table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
}

.lesson-content table td,
.content-section table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    vertical-align: top;
    line-height: 1.5;
}

.lesson-content table tr:last-child td,
.content-section table tr:last-child td {
    border-bottom: none;
}

.lesson-content table tr:hover td,
.content-section table tr:hover td {
    background: var(--glass-highlight);
}

.lesson-content table td strong,
.content-section table td strong {
    color: var(--primary);
    font-weight: 600;
}

.lesson-content table code,
.content-section table code {
    font-size: 0.8125rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ==========================================
   LESSON CONTENT
   ========================================== */
.lesson-content {
    line-height: 1.8;
}

.lesson-content h2 {
    font-size: 1.625rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    position: relative;
    padding-left: 1rem;
}

.lesson-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.25em;
    bottom: 0.25em;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--accent-cyan));
    border-radius: 2px;
}

.lesson-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.lesson-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.lesson-content p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.lesson-content ul, .lesson-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.lesson-content li {
    margin-bottom: 0.625rem;
    color: var(--text-secondary);
}

/* ==========================================
   INFO CALLOUTS - Glassmorphism Style
   ========================================== */
.info-callout {
    display: flex;
    gap: 1rem;
    background: linear-gradient(135deg, var(--info-muted), transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-left: 4px solid var(--info);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.info-callout.warning {
    background: linear-gradient(135deg, var(--warning-muted), transparent);
    border-color: rgba(245, 158, 11, 0.25);
    border-left-color: var(--warning);
}

.info-callout.warning .callout-icon {
    color: var(--warning);
}

.callout-icon {
    color: var(--info);
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px currentColor);
}

.callout-content strong {
    display: block;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
}

.callout-content p {
    margin: 0;
    font-size: 0.875rem;
}

/* ==========================================
   CONCEPT CARDS
   ========================================== */
.concept-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    margin: 2rem 0;
    position: relative;
}

.concept-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--accent-cyan), transparent);
    border-radius: 1px;
}

.concept-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.125rem;
}

.example-box {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-top: 1.25rem;
    border: 1px solid var(--border-color);
}

.example-label {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-muted), var(--accent-cyan-muted));
    color: var(--primary);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.875rem;
    border: 1px solid var(--primary-muted);
}

/* Numbered List Styling */
.numbered-list {
    counter-reset: numbered-item;
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.numbered-list li {
    counter-increment: numbered-item;
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.numbered-list li::before {
    content: counter(numbered-item);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.75rem;
    height: 1.75rem;
    background: linear-gradient(135deg, var(--primary-muted), var(--accent-cyan-muted));
    color: var(--primary);
    font-weight: 700;
    font-size: 0.8125rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--primary-muted);
}

/* ==========================================
   STEPS CONTAINER
   ========================================== */
.steps-container {
    margin: 2rem 0;
}

.step {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.step:hover {
    border-color: var(--primary);
    background: var(--glass-highlight);
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--primary-muted);
}

.step-content h4 {
    margin: 0 0 0.375rem 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.step-content p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ==========================================
   COMPARISON TABLE
   ========================================== */
.comparison-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.compare-col {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    position: relative;
}

.compare-col::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 10%;
    right: 10%;
    height: 3px;
    border-radius: 2px;
}

.compare-col.yes::before {
    background: linear-gradient(90deg, transparent, var(--success), transparent);
}

.compare-col.no::before {
    background: linear-gradient(90deg, transparent, var(--danger), transparent);
}

.compare-col.yes h4 {
    color: var(--success);
}

.compare-col.no h4 {
    color: var(--danger);
}

.compare-col h4 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: 1.125rem;
}

.compare-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.compare-col li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.875rem;
}

.compare-col li:last-child {
    border-bottom: none;
}

/* ==========================================
   KEY INSIGHT BOX
   ========================================== */
.key-insight {
    background: linear-gradient(135deg, var(--primary-muted) 0%, transparent 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 2rem 0;
    position: relative;
}

.key-insight::before {
    content: '💡';
    position: absolute;
    top: -10px;
    left: 20px;
    background: var(--bg-primary);
    padding: 0 0.5rem;
    font-size: 1rem;
}

.key-insight h3 {
    margin: 0 0 0.625rem 0;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
}

.key-insight p {
    margin: 0;
    color: var(--text-secondary);
}

/* ==========================================
   STATS HIGHLIGHT
   ========================================== */
.stats-highlight {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.stats-highlight .stat {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stats-highlight .stat::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: var(--gradient-primary);
    opacity: 0.3;
    filter: blur(60px);
    pointer-events: none;
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    position: relative;
}

.stat-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    position: relative;
}

/* ==========================================
   METRICS GRID
   ========================================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.metric-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all var(--transition-fast);
}

.metric-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.metric-name {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.metric-formula {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent-cyan);
    background: var(--bg-tertiary);
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.metric-meaning {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.metric-typical {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* ==========================================
   TWO COLUMN GRID
   ========================================== */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.grid-item {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    transition: all var(--transition-fast);
}

.grid-item:hover {
    border-color: var(--primary);
}

.grid-item h4 {
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.grid-item ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.grid-item li {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grid-item li::before {
    content: '→';
    color: var(--primary);
    font-weight: bold;
}

/* ==========================================
   FEATURE LIST
   ========================================== */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.feature-list li {
    padding: 1rem 0;
    padding-left: 2rem;
    position: relative;
    border-bottom: 1px solid var(--glass-border);
    transition: all var(--transition-fast);
}

.feature-list li:hover {
    background: var(--glass-highlight);
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 3rem;
    padding-right: 1rem;
    border-radius: var(--radius-md);
}

.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success-muted);
    border-radius: 50%;
    font-size: 0.75rem;
}

.feature-list li:last-child {
    border-bottom: none;
}

/* ==========================================
   PRACTICE BOX
   ========================================== */
.practice-box {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    margin: 2.5rem 0;
    position: relative;
}

.practice-box::before {
    content: '🎯 Practice';
    position: absolute;
    top: -12px;
    left: 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.875rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.practice-box h3 {
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.practice-question {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
}

.solution {
    margin-top: 1.25rem;
}

.solution summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 600;
    padding: 0.625rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.solution summary::before {
    content: '▶';
    font-size: 0.625rem;
    transition: transform var(--transition-fast);
}

.solution[open] summary::before {
    transform: rotate(90deg);
}

.solution summary:hover {
    color: var(--primary-hover);
}

.solution-content {
    padding: 1.25rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-top: 0.75rem;
}

/* ==========================================
   LESSON NAVIGATION
   ========================================== */
.lesson-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 4rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--glass-border);
}

.mark-complete {
    background: linear-gradient(135deg, var(--success), #059669);
    box-shadow: 0 4px 15px var(--success-muted);
}

.mark-complete:hover {
    box-shadow: 0 8px 25px var(--success-glow);
}

/* ==========================================
   SEARCH MODAL
   ========================================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}

.modal.active {
    display: flex;
}

.search-modal {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 620px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    overflow: hidden;
}

.search-modal-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.search-modal-header .search-icon {
    color: var(--primary);
}

.search-modal-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.0625rem;
}

.search-modal-input:focus {
    outline: none;
}

.search-modal-header kbd {
    padding: 0.25rem 0.625rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.search-results {
    max-height: 420px;
    overflow-y: auto;
    padding: 1rem;
}

.search-hint {
    color: var(--text-muted);
    text-align: center;
    padding: 2.5rem;
    font-size: 0.875rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.search-result-item:hover {
    background: var(--glass-highlight);
    color: var(--text-primary);
}

.search-result-item svg {
    flex-shrink: 0;
    color: var(--primary);
}

/* ==========================================
   TOAST NOTIFICATION
   ========================================== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    box-shadow: var(--shadow-lg), 0 0 30px var(--success-glow);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 3000;
    font-weight: 500;
}

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

/* ==========================================
   LOADING PLACEHOLDER
   ========================================== */
.loading-content {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-muted);
}

.loading-content::before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

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

.loading-content::after {
    content: 'Loading content...';
    display: block;
    font-size: 0.875rem;
}

/* ==========================================
   TAGS
   ========================================== */
.tag {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag.maker {
    background: var(--success-muted);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.tag.taker {
    background: var(--warning-muted);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.tag.default {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.tag.advanced {
    background: var(--primary-muted);
    color: var(--primary);
    border: 1px solid var(--primary-muted);
}

/* ==========================================
   ORDER TYPES
   ========================================== */
.order-types-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.order-type-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-fast);
}

.order-type-card:hover {
    border-color: var(--primary-muted);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.1);
}

.order-type-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.order-type-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

.order-example {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.order-example code {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.order-result {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ==========================================
   ARCHITECTURE DIAGRAM
   ========================================== */
.architecture-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem;
    background: var(--glass-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    margin: 1.5rem 0;
}

.arch-layer {
    width: 100%;
    max-width: 400px;
}

.arch-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--glass-bg));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-fast);
}

.arch-item:hover {
    border-color: var(--primary-muted);
    box-shadow: var(--shadow-glow-sm);
}

.arch-item.user {
    background: linear-gradient(135deg, var(--primary-muted), transparent);
    border-color: var(--primary-muted);
}

.arch-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.arch-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.arch-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.arch-arrow {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 700;
    opacity: 0.7;
}

/* ==========================================
   ORDER BOOK VISUALIZATION
   ========================================== */
.order-book-visual {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 1.5rem 0;
}

.orderbook-header {
    display: grid;
    grid-template-columns: 1fr 1fr 80px;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.orderbook-asks,
.orderbook-bids {
    display: flex;
    flex-direction: column;
}

.orderbook-row {
    display: grid;
    grid-template-columns: 1fr 1fr 80px;
    gap: 1rem;
    padding: 0.5rem 1rem;
    position: relative;
    font-size: 0.8125rem;
    font-family: 'JetBrains Mono', monospace;
    border-bottom: 1px solid var(--glass-border);
}

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

.orderbook-row.ask {
    color: var(--error);
}

.orderbook-row.bid {
    color: var(--success);
}

.orderbook-row.best {
    font-weight: 600;
    background: rgba(139, 92, 246, 0.1);
}

.orderbook-row .price {
    font-weight: 500;
}

.orderbook-row .size {
    color: var(--text-secondary);
}

.orderbook-row .side {
    font-size: 0.6875rem;
    font-weight: 600;
    text-align: right;
}

.orderbook-row .depth-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

.orderbook-row.ask .depth-bar {
    background: var(--error);
}

.orderbook-row.bid .depth-bar {
    background: var(--success);
}

.orderbook-spread {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    text-align: center;
}

.spread-indicator {
    padding: 0.75rem 1rem;
    background: linear-gradient(90deg, var(--error-muted), var(--success-muted));
    border-top: 1px solid var(--glass-border);
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ==========================================
   FORMULA GRID
   ========================================== */
.formula-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.formula-item {
    padding: 1.25rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.formula-item:hover {
    border-color: var(--primary-muted);
}

.formula-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
}

.formula-item code.formula {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    color: var(--accent-cyan);
    border: 1px solid var(--glass-border);
}

.formula-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ==========================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ========================================== */
@media (max-width: 1200px) {
    .path-grid {
        grid-template-columns: 1fr;
    }

    .facts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-card {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
        --sidebar-width: 280px;
    }

    body::before,
    body::after {
        display: none;
    }

    .app-wrapper::before {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }

    .header-center {
        display: none;
    }

    .progress-indicator {
        display: none;
    }

    .section-header h1 {
        font-size: 1.75rem;
    }

    .hero-card {
        padding: 1.5rem;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .reference-grid,
    .formula-grid,
    .comparison-table,
    .order-types-grid,
    .metrics-grid,
    .two-col-grid,
    .stats-highlight {
        grid-template-columns: 1fr;
    }

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

    .lesson-nav {
        flex-direction: column;
    }

    .lesson-nav .btn {
        width: 100%;
        justify-content: center;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .search-modal {
        margin: 1rem;
        max-width: calc(100% - 2rem);
        border-radius: var(--radius-xl);
    }

    .step {
        flex-direction: column;
        text-align: center;
    }

    .step-number {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem;
    }

    .section-header h1 {
        font-size: 1.5rem;
    }

    .hero-card {
        padding: 1.25rem;
    }

    .concept-card,
    .practice-box,
    .reference-card {
        padding: 1.25rem;
    }

    pre {
        padding: 1rem;
        font-size: 0.75rem;
    }

    .stat-number {
        font-size: 2.25rem;
    }

    /* Mobile table handling */
    .lesson-content table,
    .content-section table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.8rem;
    }

    .lesson-content table th,
    .lesson-content table td,
    .content-section table th,
    .content-section table td {
        padding: 0.625rem 0.75rem;
        min-width: 100px;
    }

    /* Ensure all text breaks */
    p, li, dd, td, th {
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    /* Force code to break */
    code {
        word-break: break-all;
        font-size: 0.75rem;
    }
}

/* ==========================================
   CUSTOM SCROLLBAR
   ========================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) var(--bg-primary);
}

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {
    body::before,
    body::after,
    .app-wrapper::before,
    .sidebar,
    .header,
    .lesson-nav,
    .search-container,
    .theme-toggle {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 0;
    }

    .content-section {
        display: block !important;
        page-break-after: always;
    }

    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
}

/* ==========================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
