@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --primary: #0f172a; /* Formal Navy/Slate */
    --primary-dark: #020617;
    --accent: #0f172a; 
    --secondary: #ffffff;
    --bg-light: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --success: #10b981;
    --error: #e11d48;
    --warning: #f59e0b;
    --border: #e2e8f0;
    --card-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
    --radius: 10px;
}
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-light);
    color: var(--text-main);
    letter-spacing: -0.01em;
}

/* Student Dashboard Refresh */
.student-dashboard-page {
    background: #eef3f8;
}

.student-dashboard-page .student-navbar {
    border-bottom: 1px solid #dce5ef;
    box-shadow: none;
}

.student-dashboard-page .nav-links .active {
    color: #0f62fe;
}

.codeathon-nav-link {
    display: none;
    color: #d9480f !important;
    font-weight: 700 !important;
}

.student-pill {
    background: #f1f5f9;
    border: 1px solid #dbe4ee;
    border-radius: 999px;
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.45rem 0.8rem;
}

.student-shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 20px 48px;
}

.student-hero {
    align-items: stretch;
    background: #ffffff;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
    padding: 28px;
}

.hero-copy h1 {
    color: #111827;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.04;
    margin: 8px 0 14px;
}

.hero-copy p {
    color: #536171;
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 680px;
}

.eyebrow {
    color: #0f62fe;
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.student-stats {
    display: grid;
    gap: 12px;
}

.metric-tile {
    background: #f8fafc;
    border: 1px solid #dbe4ee;
    border-left: 4px solid #0f62fe;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 92px;
    padding: 18px;
}

.metric-tile:nth-child(2) {
    border-left-color: #16a34a;
}

.metric-tile:nth-child(3) {
    border-left-color: #f59e0b;
}

.metric-label {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.metric-tile strong {
    color: #0f172a;
    font-size: 2rem;
    line-height: 1;
}

.codeathon-strip {
    align-items: center;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 5px solid #f97316;
    border-radius: 8px;
    display: none;
    gap: 20px;
    justify-content: space-between;
    margin-top: 18px;
    padding: 20px;
}

.codeathon-strip h2 {
    color: #9a3412;
    font-size: 1.45rem;
    margin: 5px 0;
}

.codeathon-strip p {
    color: #7c2d12;
    font-weight: 600;
}

.codeathon-action {
    background: #c2410c;
    border-radius: 8px;
    color: #ffffff;
    flex: 0 0 auto;
    font-weight: 800;
    padding: 12px 18px;
    text-decoration: none;
}

.dashboard-layout {
    align-items: start;
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1fr) 360px;
    margin-top: 22px;
}

.learning-panel,
.leaderboard-panel {
    background: #ffffff;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    padding: 22px;
}

.section-heading {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.section-heading h2 {
    color: #111827;
    font-size: 1.55rem;
    margin-top: 4px;
}

.section-heading.compact {
    margin-bottom: 14px;
}

.soft-badge {
    background: #eef6ff;
    border: 1px solid #cfe3ff;
    border-radius: 999px;
    color: #0f62fe;
    font-size: 0.84rem;
    font-weight: 800;
    padding: 7px 12px;
}

.track-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.track-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    padding: 16px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.track-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transform: translateY(-4px);
}

.track-mark {
    display: none;
}

.track-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.track-icon img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.track-name {
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0;
}

.track-meta, .track-cta {
    display: none;
}

.student-dashboard-page .top-3 {
    align-items: stretch;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
    margin: 0 0 14px;
}

.student-dashboard-page .podium {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    box-shadow: none;
    display: grid;
    gap: 10px;
    grid-template-columns: 54px 1fr auto;
    min-height: auto;
    padding: 12px;
    text-align: left;
}

.student-dashboard-page .podium.rank-1 {
    border-color: #facc15;
}

.student-dashboard-page .podium.rank-2 {
    border-color: #94a3b8;
}

.student-dashboard-page .podium.rank-3 {
    border-color: #fb923c;
}

.student-dashboard-page .podium .rank {
    align-items: center;
    background: #ffffff;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    color: #111827;
    display: inline-flex;
    font-size: 0.95rem;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    width: 44px;
}

.student-dashboard-page .podium .name {
    color: #111827;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-dashboard-page .podium .score {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 700;
}

.leaderboard-list {
    display: grid;
    gap: 8px;
}

.leaderboard-row {
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 10px 12px;
}

.leaderboard-rank {
    color: #64748b;
    font-weight: 900;
}

.leaderboard-name {
    color: #111827;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-row strong {
    color: #0f62fe;
}

.module-modal {
    align-items: center;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 1000;
}

.module-dialog {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    max-height: 86vh;
    max-width: 480px;
    overflow: hidden;
    padding: 20px;
    width: 100%;
}

.modal-header-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-header-row h3 {
    color: #111827;
    font-size: 1.35rem;
    margin-top: 4px;
}

.icon-close {
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.module-options {
    display: grid;
    gap: 10px;
    max-height: 55vh;
    overflow-y: auto;
}

.module-option {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    color: #111827;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    padding: 13px 14px;
    text-align: left;
}

.module-option span {
    font-weight: 800;
}

.module-option small {
    color: #0f62fe;
    font-weight: 800;
}

.empty-state {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    font-weight: 700;
    padding: 18px;
    text-align: center;
}

@media (max-width: 980px) {
    .student-hero,
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 720px) {
    .student-dashboard-page .navbar {
        align-items: flex-start;
        gap: 14px;
    }

    .student-dashboard-page .nav-links {
        justify-content: flex-start;
        width: 100%;
    }

    .student-shell {
        padding: 18px 14px 38px;
    }

    .student-hero,
    .learning-panel,
    .leaderboard-panel,
    .codeathon-strip {
        padding: 16px;
    }

    .student-stats {
        grid-template-columns: 1fr;
    }

    .codeathon-strip {
        align-items: stretch;
        flex-direction: column;
    }

    .codeathon-action {
        text-align: center;
    }

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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
}

/* Auth Page */
.auth-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
}

.auth-card {
    background: var(--secondary);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.logo-large {
    width: 60px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.auth-card h2 {
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.auth-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
}

.form-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--text-main);
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background: var(--bg-light);
    outline: none;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.form-group input:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.05);
    background: var(--secondary);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--card-shadow);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.btn-primary:active {
    transform: translateY(1px);
}

/* Navbar */
.navbar {
    background: var(--secondary);
    padding: 0 40px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--card-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.nav-brand img {
    height: 36px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    padding: 8px 12px;
    border-radius: 8px;
}

.nav-links a:hover {
    color: var(--text-main);
    background: var(--bg-light);
}

.btn-logout {
    padding: 10px 18px;
    background: transparent;
    color: var(--error);
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-logout:hover {
    background: #ffe4e6;
}

/* Dashboard */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: #eef2ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Leaderboard */
.leaderboard-section {
    margin-top: 3rem;
}

.top-3 {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.podium {
    background: white;
    padding: 1.5rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--card-shadow);
    width: 200px;
}

.podium.gold { height: 220px; border-top: 5px solid #ffd700; }
.podium.silver { height: 190px; border-top: 5px solid #c0c0c0; }
.podium.bronze { height: 170px; border-top: 5px solid #cd7f32; }

.podium .rank { font-size: 2rem; margin-bottom: 0.5rem; }
.podium .name { font-weight: 600; margin-bottom: 0.5rem; }
.podium .score { font-size: 0.9rem; color: var(--text-muted); }

/* Practice Page Layout - FORMAL PREMIUM */
.practice-main-container {
    display: flex;
    height: calc(100vh - 70px);
    overflow: hidden;
    background: var(--bg-light);
}

.question-numbers-sidebar {
    width: 70px;
    background: var(--secondary);
    border-right: 1px solid var(--border);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.q-num-btn {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    cursor: pointer;
    background: var(--secondary);
    color: var(--text-muted);
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
}

.q-num-btn:hover {
    border-color: #94a3b8;
    color: var(--text-main);
    background: var(--bg-light);
}

.q-num-btn.active { 
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(15,23,42,0.2);
}

.q-num-btn.solved { 
    background: #ecfdf5;
    color: var(--success);
    border-color: #34d399;
}

.practice-grid-three {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--bg-light);
}

.question-panel {
    background: var(--secondary);
    padding: 40px;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-main);
}

.editor-panel {
    background: var(--bg-light);
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.samples-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

.sample-box {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.sample-content {
    margin-top: 12px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.95rem;
    color: var(--text-main);
    white-space: pre-wrap;
    background: var(--secondary);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* Editor & Result */
.editor-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: var(--border);
}

.editor-container {
    background: var(--secondary);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.editor-header {
    padding: 12px 24px;
    background: var(--secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    flex-shrink: 0;
}

.editor-header select {
    background: var(--secondary);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.2s ease;
    cursor: pointer;
}
.editor-header select:hover { border-color: #94a3b8; }

.editor-controls button {
    background: var(--secondary);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 6px;
    margin-left: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.editor-controls button:hover {
    background: var(--bg-light);
    border-color: #94a3b8;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.editor-wrapper {
    flex-grow: 1;
    display: flex;
    position: relative;
    overflow: hidden;
    background: #f8fafc !important;
    min-height: 420px;
    border-top: 1px solid #e2e8f0;
}

#monaco-editor-container {
    flex: 1;
    width: 100%;
    min-height: 420px;
    background: #f8fafc;
}

.monaco-editor,
.monaco-editor-background,
.monaco-editor .margin {
    background-color: #f8fafc !important;
}

.monaco-editor {
    outline: none;
}

.monaco-editor .line-numbers {
    color: #94a3b8 !important;
    font-weight: 600;
}

.monaco-editor .current-line {
    border: none !important;
}

.execution-results {
    background: var(--secondary);
    height: 380px;
    padding: 24px;
    border-top: 1px solid var(--border);
    overflow-y: auto;
}

.result-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.res-box {
    background: var(--bg-light);
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.res-box strong { color: var(--text-main); font-size: 0.95rem; }

.res-content {
    margin-top: 8px;
    padding: 12px 16px;
    background: var(--secondary);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    min-height: 48px;
    white-space: pre-wrap;
    color: var(--text-main);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
}

/* Admin Specific */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    background: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    box-shadow: var(--card-shadow);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8faff;
    font-weight: 600;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success { background: #e6f4ea; color: #1e7e34; }
.badge-error { background: #fdf2f2; color: #d32f2f; }

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #eee;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Dashboard Language Cards (BIG) */
.lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 2rem;
}

.lang-card {
    background: white;
    padding: 4rem 2rem;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 3px solid transparent;
}

.lang-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 74, 173, 0.1);
}

.lang-icon-img {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-icon-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.lang-card:hover .lang-icon-img img {
    transform: scale(1.1) rotate(5deg);
}

.lang-name {
    font-weight: 700;
    font-size: 2rem;
    color: var(--primary);
}

.module-list {
    display: grid;
    gap: 15px;
    margin-top: 1rem;
}

.module-item {
    background: white;
    padding: 1.5rem 2.5rem;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 700;
    font-size: 1.1rem;
}

.module-item:hover {
    background: var(--primary);
    color: white;
    transform: translateX(10px);
}

/* Result Modal Styling */
.result-modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.close-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.result-card {
    padding: 25px;
    border-radius: 12px;
    background: #f8f9fa;
    border-left: 5px solid #ddd;
    text-align: left;
}

.res-box-vertical {
    margin-top: 15px;
}

.res-box-vertical .res-content {
    margin-top: 8px;
    background: white;
    border: 1px solid #e0e0e0;
    padding: 12px;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    min-height: 45px;
}

.metrics-section {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
}

.custom-input-section {
    margin-top: 20px;
    font-weight: 500;
}


/* Floating Fix Button */
.btn-fix-site {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ffc107;
    color: #333;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 9999;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.btn-fix-site:hover {
    transform: scale(1.05);
    background: #ffca2c;
}

.clear-cache-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.clear-cache-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Media Queries for Responsiveness */
@media (max-width: 1024px) {
    .practice-grid-three {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }
    
    .practice-main-container {
        height: auto;
        overflow: visible;
        flex-direction: column;
    }
    
    .question-numbers-sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 10px;
    }

    .question-panel, .editor-panel {
        height: auto;
        overflow: visible;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

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

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

    .samples-container {
        grid-template-columns: 1fr;
    }

    .top-3 {
        flex-direction: column;
        align-items: center;
    }

    .podium {
        width: 100%;
        max-width: 300px;
        height: auto !important;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

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

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-card, .lang-card, .stat-card, .question-panel, .editor-panel {
    animation: fadeIn 0.5s ease-out forwards;
}

/* 
   PRACTICE PAGE - full styles
    */

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: 64px;
    background: #0f172a;
    border-bottom: 1px solid rgba(255,255,255,.06);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #f1f5f9;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.nav-brand img {
    height: 32px;
    width: 32px;
    object-fit: contain;
    border-radius: 6px;
    filter: brightness(0) invert(1);
}
.btn-logout {
    padding: 9px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    transition: opacity .15s;
}
.btn-logout:hover { opacity: .85; }

/* Practice layout */
.practice-main-container {
    display: flex;
    height: calc(100vh - 64px);
    overflow: hidden;
}

.question-numbers-sidebar {
    width: 56px;
    background: #1e293b;
    border-right: 1px solid rgba(255,255,255,.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    overflow-y: auto;
    gap: 6px;
    flex-shrink: 0;
}

.practice-grid-three {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1;
    overflow: hidden;
}

/* Question Panel */
.question-panel {
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 28px 28px;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #1e293b;
}
.question-panel h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}

.problem-statement {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 20px;
    margin: 16px 0;
}
.format-section {
    margin: 16px 0;
    color: #475569;
}
.samples-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 16px;
}
.sample-box {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    font-size: 0.88rem;
}
.sample-content {
    margin-top: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #334155;
    white-space: pre;
}

/* Editor Panel */
.editor-panel {
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    overflow: hidden;
}

.editor-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    background: #f8fafc;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #1e293b;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
    color: #f1f5f9;
}

.editor-panel .editor-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.editor-header select {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 7px 12px;
    font-weight: 700;
}
.editor-controls {
    display: flex;
    gap: 10px;
}
/* Editor Controls */
.editor-controls button {
    padding: 8px 18px;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    background: #2563eb;
    color: #fff;
    transition: background .15s, transform .15s;
}
.editor-controls button:hover:not(:disabled) { background: #1d4ed8; transform: translateY(-1px); }
.editor-controls button:first-child { background: #10b981; }
.editor-controls button:first-child:hover { background: #059669; }
.editor-controls button:disabled { opacity: .45; cursor: not-allowed; }

/* Results section */
#resultsSection {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 20px 24px;
    overflow-y: auto;
    max-height: 40%;
}

.result-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px;
}
.status-line {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 700;
}
.badge-success { background: #ecfdf5; color: #059669; padding: 3px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 800; }
.badge-error   { background: #fef2f2; color: #dc2626; padding: 3px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 800; }
.res-box-vertical { margin-top: 14px; }
.res-content { background: #f1f5f9; border-radius: 8px; padding: 10px 14px; font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; margin-top: 6px; white-space: pre-wrap; color: #334155; }
.metrics-section { margin-top: 16px; font-size: 0.9rem; color: #64748b; }
.custom-input-section { margin-top: 14px; font-size: 0.9rem; color: #475569; }

.btn-primary {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 22px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    width: 100%;
    transition: background .15s;
}
.btn-primary:hover { background: #1d4ed8; }

/* Modals */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal[style*="display: flex"], .modal[style*="display:flex"], .modal.open { display: flex !important; }
.modal-content {
    background: #fff;
    border-radius: 14px;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0,0,0,.12);
    max-width: 480px;
    width: 100%;
    animation: pop .25s cubic-bezier(.175,.885,.32,1.275);
}
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Fix-site button */
.btn-fix-site {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
    transition: background .15s, color .15s;
}
.btn-fix-site:hover { background: #334155; color: #f1f5f9; }

/* Timer */
#timer {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #f1f5f9;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.95rem;
}
