/* =========================================================
   C++ MASTERY - ADVANCED MODERN STYLESHEET
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* =========================================
   ROOT VARIABLES & DESIGN TOKENS
   ========================================= */
:root {
    /* Color Palette - Light Mode */
    --bg-primary: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.85);

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --border-color: #e2e8f0;
    --border-focus: #6366f1;

    --accent-primary: #4f46e5;
    --accent-primary-hover: #4338ca;
    --accent-secondary: #0ea5e9;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;

    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    --badge-gradient: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);

    --sidebar-bg: #ffffff;
    --sidebar-width: 300px;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.2);

    --code-bg: #0f172a;
    --code-text: #f8fafc;

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark {
    /* Color Palette - Dark Mode */
    --bg-primary: #0b0f17;
    --bg-surface: #111827;
    --bg-surface-elevated: #1f2937;
    --bg-glass: rgba(17, 24, 39, 0.85);

    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-light: #6b7280;

    --border-color: #1f2937;
    --border-focus: #818cf8;

    --accent-primary: #6366f1;
    --accent-primary-hover: #818cf8;
    --accent-secondary: #38bdf8;
    --accent-success: #34d399;
    --accent-warning: #fbbf24;
    --accent-danger: #f87171;

    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    --badge-gradient: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);

    --sidebar-bg: #0f172a;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.35);

    --code-bg: #090d16;
    --code-text: #f8fafc;
}

/* Backward compatibility mapping */
:root {
    --bg: var(--bg-primary);
    --surface: var(--bg-surface);
    --surface-soft: var(--bg-surface-elevated);
    --text: var(--text-main);
    --muted: var(--text-muted);
    --border: var(--border-color);
    --accent: var(--accent-primary);
    --sidebar: var(--sidebar-bg);
    --shadow: var(--shadow-md);
}

/* =========================================
   GLOBAL RESET & BASE
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

button, input, select, textarea {
    font-family: inherit;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* =========================================
   READING PROGRESS BAR AT TOP
   ========================================= */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--accent-gradient);
    z-index: 10000;
    width: 0%;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
}

/* =========================================
   MOBILE HEADER
   ========================================= */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    z-index: 2000;
}

.mobile-brand {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mobile-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-actions button {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mobile-actions button:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* =========================================
   SIDEBAR NAV
   ========================================= */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 24px 18px;
    overflow-y: auto;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: transform var(--transition-normal), background var(--transition-normal);
}

.brand {
    padding: 0 8px 18px;
    border-bottom: 1px solid var(--border-color);
}

.brand-main {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-main i {
    color: var(--accent-primary);
    -webkit-text-fill-color: initial;
}

.brand-sub {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 8px 12px 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-main);
    background: var(--bg-surface-elevated);
}

.nav-link.active {
    color: var(--accent-primary);
    background: var(--badge-gradient);
    font-weight: 700;
}

/* Roadmap List */
.roadmap-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    width: 100%;
}

.roadmap-item > span:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.roadmap-item:hover {
    color: var(--text-main);
    background: var(--bg-surface-elevated);
}

.roadmap-item:hover > span:first-child {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.roadmap-item.active {
    color: var(--accent-primary);
    background: var(--badge-gradient);
    font-weight: 700;
}

.roadmap-item.active > span:first-child {
    background: var(--accent-primary);
    color: #ffffff;
    border-color: var(--accent-primary);
}

/* Checkmark indicator for completed day */
.roadmap-item .check-icon {
    margin-left: auto;
    color: var(--accent-success);
    font-size: 14px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.roadmap-item.completed-day .check-icon {
    opacity: 1;
}

/* Sidebar Progress */
.sidebar-progress {
    margin-top: auto;
    padding: 16px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-bottom: 10px;
}

.progress-top span {
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.progress-top strong {
    color: var(--accent-primary);
    font-size: 14px;
}

.progress {
    height: 8px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

/* =========================================
   MAIN CONTENT LAYOUT
   ========================================= */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 30px 45px 60px;
    max-width: 1200px;
    transition: margin-left var(--transition-normal);
}

/* Topbar Header */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 28px;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 35px;
    position: sticky;
    top: 20px;
    z-index: 1000;
}

.topbar-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}

.topbar h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;

}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Search trigger button */
.search-trigger-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 9px 16px;
    border-radius: var(--radius-full);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 220px;
}

.search-trigger-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-main);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-trigger-btn kbd {
    margin-left: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 11px;
    font-family: inherit;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Legacy input backward compatibility */
.search-box {
    display: none;
}

/* Language Switcher Pill */
.lang-toggle-pill {
    display: flex;
    align-items: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 3px;
}

.lang-toggle-pill button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lang-toggle-pill button.active {
    background: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* Theme Toggle Button */
.theme-button, .theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 9px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-button:hover, .theme-toggle-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

/* Playground Button */
.btn-playground {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-gradient);
    border: none;
    color: #ffffff;
    padding: 9px 18px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.btn-playground:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

/* Social Links */
.social-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.social-link svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.social-link:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

/* =========================================
   HERO SECTION & INTRO CARDS
   ========================================= */
.hero-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: var(--accent-gradient);
    opacity: 0.12;
    filter: blur(60px);
    border-radius: 50%;
    pointer-events: none;
}

.lesson-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--badge-gradient);
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-full);
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 16px;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent-gradient);
    color: #ffffff;
    padding: 12px 26px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.5);
    color: #ffffff;
}

/* =========================================
   CARDS & SECTIONS
   ========================================= */
.section-block {
    margin-bottom: 50px;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.section-label {
    font-size: 13px;
    font-weight: 800;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-heading h2 {
    font-size: 26px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
}

/* Day Lesson Section */
.day-lesson {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 35px;
    margin-bottom: 35px;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.day-lesson:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.lesson-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.lesson-header h2 {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 6px;
}

.lesson-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.language-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

/* Lesson Cards & Sub-topics */
.lesson-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    transition: all var(--transition-fast);
}

.lesson-card:hover {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-sm);
}

.lesson-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--text-main);
}

.lesson-card p {
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.7;
    margin-bottom: 16px;
}

/* Code Snippets & Custom Code Window */
.code-window, .lesson-code {
    background: var(--code-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    margin: 20px 0;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.code-top, .code-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-top-dots {
    display: flex;
    gap: 6px;
}

.code-top-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.code-lang-badge {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-actions-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-copy-code, .btn-try-code {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-copy-code:hover, .btn-try-code:hover {
    background: var(--accent-primary);
    color: #ffffff;
    border-color: var(--accent-primary);
}

pre {
    margin: 0;
    padding: 18px 20px;
    overflow-x: auto;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--code-text);
}

code {
    font-family: 'Fira Code', 'Courier New', monospace;
}

/* Console Output Box */
.output-box {
    background: #090d16;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-top: 15px;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: #34d399;
}

.output-box::before {
    content: 'CONSOLE OUTPUT';
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #059669;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

/* Callout & Note Cards */
.important-note {
    background: var(--badge-gradient);
    border-left: 4px solid var(--accent-primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 18px 22px;
    margin: 20px 0;
}

.note-label {
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.note-text {
    font-size: 14px;
    color: var(--text-main);
    margin: 0;
}

table{
    width: 100%;
}


/* Comparison & Operator Tables */
.comparison-table, .operator-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 20px 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.comparison-table th, .operator-table th {
    background: var(--bg-surface-elevated);
    padding: 14px 18px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
}

.comparison-table td, .operator-table td {
    padding: 14px 18px;
    font-size: 13.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.comparison-table tr:last-child td, .operator-table tr:last-child td {
    border-bottom: none;
}

/* Day Grid for Overview */
.day-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.day-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.day-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.day-number {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.day-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 8px 0 12px;
}

/* =========================================
   MCQ TEST CARDS & QUIZ INTERFACE
   ========================================= */
.test-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.test-container {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
    margin-top: 20px;
}

.test-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

#timer {
    font-family: 'Fira Code', monospace;
    font-weight: 700;
    font-size: 15px;
    color: var(--accent-warning);
    background: rgba(245, 158, 11, 0.1);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 6px;
}

.test-option, .option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    margin-bottom: 12px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 14.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.test-option:hover, .option:hover {
    border-color: var(--accent-primary);
    background: var(--badge-gradient);
}

.test-option.selected, .option.selected {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: #ffffff;
    font-weight: 700;
}

.test-option.correct-option {
    border-color: var(--accent-success) !important;
    background: rgba(16, 185, 129, 0.15) !important;
    color: var(--accent-success) !important;
    font-weight: 700;
}

.test-option.wrong-option {
    border-color: var(--accent-danger) !important;
    background: rgba(239, 68, 68, 0.15) !important;
    color: var(--accent-danger) !important;
}

.test-controls {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
}

.test-controls button {
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.test-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.4);
}

/* =========================================
   SEARCH & PLAYGROUND MODAL POPUPS
   ========================================= */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.modal-backdrop.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

/* Search Modal */
.search-modal-card {
    width: 100%;
    max-width: 650px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideDown {
    from { opacity: 0; transform: translateY(-20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.search-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
}

.search-modal-header i {
    color: var(--accent-primary);
    font-size: 18px;
}

.search-modal-header input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.close-kbd {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.search-modal-results {
    max-height: 380px;
    overflow-y: auto;
    padding: 12px;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-result-item:hover, .search-result-item.active {
    background: var(--badge-gradient);
}

.search-result-item h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.search-result-item p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.search-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.search-empty-state i {
    font-size: 32px;
    margin-bottom: 12px;
    color: var(--accent-primary);
}

.search-modal-footer {
    padding: 12px 22px;
    background: var(--bg-surface-elevated);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Compiler Modal */
.compiler-modal-card {
    width: 100%;
    max-width: 900px;
    height: 85vh;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.compiler-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-color);
}

.compiler-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 16px;
}

.compiler-badge {
    background: var(--badge-gradient);
    color: var(--accent-primary);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close-btn:hover {
    color: var(--accent-danger);
}

.compiler-body {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
}

.compiler-editor-container {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background: var(--code-bg);
}

.editor-toolbar, .output-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
}

.btn-sm {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #cbd5e1;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    cursor: pointer;
}

.btn-sm:hover {
    background: rgba(255, 255, 255, 0.2);
}

.code-textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 16px;
    font-family: 'Fira Code', monospace;
    font-size: 13.5px;
    line-height: 1.6;
    color: #f8fafc;
    resize: none;
}

.compiler-stdin-box {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.compiler-stdin-box label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
}

.compiler-stdin-box input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: #ffffff;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    outline: none;
}

.compiler-output-container {
    display: flex;
    flex-direction: column;
    background: #06090e;
}

.btn-run {
    background: var(--accent-success);
    color: #ffffff;
    border: none;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.btn-run:hover {
    transform: scale(1.04);
}

.console-output {
    flex: 1;
    padding: 16px;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: #34d399;
    white-space: pre-wrap;
    overflow-y: auto;
}

.console-placeholder {
    color: #64748b;
    font-style: italic;
}

/* =========================================
   TOAST NOTIFICATIONS
   ========================================= */
.toast-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main);
    animation: toastSlideIn 0.3s ease-out;
}

.toast i {
    color: var(--accent-success);
    font-size: 16px;
}

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

/* =========================================
   SCROLL TO TOP BUTTON
   ========================================= */
.scroll-top-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 1000;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.6);
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 13px;
}

/* =========================================
   RESPONSIVE LAYOUT
   ========================================= */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-content {
        margin-left: 0;
        padding: 85px 20px 40px;
    }

    .mobile-header {
        display: flex;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .compiler-body {
        grid-template-columns: 1fr;
    }

    .compiler-editor-container {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        height: 50%;
    }
}

/* =========================================
   SIDEBAR ROADMAP SYLLABUS WRAPPER
   ========================================= */
.roadmap-text-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.roadmap-day-title {
    font-weight: 700;
    font-size: 13px;
    line-height: 1.25;
}

.roadmap-topic-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* =========================================
   DAILY STREAK PILL & FLAME ANIMATION
   ========================================= */
.streak-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface-elevated);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--text-main);
    padding: 7px 14px;
    border-radius: var(--radius-full);
    font-size: 12.5px;
    font-weight: 800;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}

.flame-icon {
    color: #f97316;
    font-size: 16px;
    animation: pulseFlame 1.5s infinite alternate ease-in-out;
}

@keyframes pulseFlame {
    0% { transform: scale(1); filter: drop-shadow(0 0 2px #f97316); }
    100% { transform: scale(1.25); filter: drop-shadow(0 0 8px #ef4444); }
}

.xp-badge {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

/* =========================================
   DAILY CODING GAME BUTTON & MODAL
   ========================================= */
.btn-game {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    border: none;
    color: #ffffff;
    padding: 9px 18px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35);
}

.btn-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(236, 72, 153, 0.55);
}

/* Game Modal Card */
.game-modal-card {
    width: 100%;
    max-width: 850px;
    max-height: 90vh;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.game-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 26px;
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-color);
}

.game-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.game-icon {
    font-size: 26px;
    color: #ec4899;
}

.game-header-left h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.game-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.game-header-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-stat-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
}

.game-level-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.game-level-btn {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.game-level-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-main);
}

.game-level-btn.active {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(236, 72, 153, 0.3);
}

.game-body {
    padding: 26px;
    overflow-y: auto;
}

.game-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.game-mode-badge {
    background: var(--badge-gradient);
    color: var(--accent-primary);
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
}

.game-timer-badge {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-warning);
    font-size: 12px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-family: 'Fira Code', monospace;
}

.game-card h4 {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 800;
}

.game-code-box {
    margin-bottom: 20px;
}

.game-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.game-option-btn {
    background: var(--bg-surface-elevated);
    border: 1.5px solid var(--border-color);
    color: var(--text-main);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.game-option-btn:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

.game-option-btn.correct {
    border-color: var(--accent-success) !important;
    background: rgba(16, 185, 129, 0.15) !important;
    color: var(--accent-success) !important;
    font-weight: 800;
}

.game-option-btn.wrong {
    border-color: var(--accent-danger) !important;
    background: rgba(239, 68, 68, 0.15) !important;
    color: var(--accent-danger) !important;
}

.game-explanation-box {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-top: 15px;
}

.game-explanation-box.hidden {
    display: none;
}

.exp-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--accent-success);
    margin-bottom: 8px;
}

.btn-primary-game {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: #ffffff;
    border: none;
    padding: 10px 22px;
    border-radius: var(--radius-full);
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 14px;
    transition: transform var(--transition-fast);
}

.btn-primary-game:hover {
    transform: translateY(-2px);
}