/* ==========================================================================
   FORA ACADEMY OF APPLIED COMPUTING & SYSTEMS
   Design System: Academic Course Study & Interactive Engineering Platform
   ========================================================================== */

:root {
    --bg-darkest: #080C14;
    --bg-page: #0D121F;
    --bg-surface: #131A2B;
    --bg-surface-raised: #1A243B;
    --bg-code: #0A0E17;

    --border-color: #232E45;
    --border-hover: #36486C;
    --border-accent: #2563EB;

    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-accent: #60A5FA;

    --primary-blue: #2563EB;
    --primary-blue-hover: #1D4ED8;
    --primary-blue-light: rgba(37, 99, 235, 0.12);

    --academic-gold: #D97706;
    --academic-gold-light: rgba(217, 119, 6, 0.12);

    --pass-emerald: #059669;
    --pass-emerald-light: rgba(5, 150, 105, 0.12);

    --error-ruby: #DC2626;
    --error-ruby-light: rgba(220, 38, 38, 0.12);

    --font-ui: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
    --font-prose: 'Newsreader', 'Inter', Georgia, serif;
    --font-mono: 'Fira Code', Menlo, Monaco, monospace;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --transition: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body.academic-theme {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-ui);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ==========================================================================
   HEADER NAVIGATION BAR
   ========================================================================== */
.navbar {
    height: 64px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.academy-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-decoration: none;
}

.brand-crest {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #1E3A8A, #2563EB);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFF;
    font-size: 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.brand-titles {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: var(--font-ui);
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.5px;
    color: #FFF;
}

.brand-tagline {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.2px;
    color: var(--text-accent);
}

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

.nav-link {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.nav-link:hover {
    color: #FFF;
    background: var(--bg-surface-raised);
}

.nav-link.active {
    color: #FFF;
    background: var(--primary-blue-light);
    color: var(--text-accent);
}

.academic-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-darkest);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
}

.stat-desc {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1E3A8A;
    color: #93C5FD;
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */
.btn {
    font-family: var(--font-ui);
    font-size: 13.5px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: #FFF;
}
.btn-primary:hover {
    background-color: var(--primary-blue-hover);
}

.btn-secondary {
    background-color: var(--bg-surface-raised);
    color: var(--text-primary);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background-color: #232F4C;
    border-color: var(--border-hover);
}

.btn-success {
    background-color: var(--pass-emerald);
    color: #FFF;
}
.btn-success:hover {
    background-color: #047857;
}

.btn-subtle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 5px 10px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.btn-subtle:hover {
    color: #FFF;
    border-color: var(--border-hover);
}

.btn-icon-subtle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 15px;
    padding: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon-subtle:hover {
    color: #FFF;
}

.btn-lg {
    padding: 12px 22px;
    font-size: 14.5px;
}

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

/* ==========================================================================
   VIEW 1: COURSE CATALOG (ACADEMY PORTAL)
   ========================================================================== */
.main-viewport {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.viewport-page {
    display: none;
    flex: 1;
}
.viewport-page.active {
    display: flex;
    flex-direction: column;
}

.page-container {
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    padding: 36px 24px 60px;
}

.catalog-hero {
    background: linear-gradient(180deg, #111827 0%, #0F172A 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    margin-bottom: 40px;
}

.hero-text {
    max-width: 820px;
}

.academic-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-accent);
    background: var(--primary-blue-light);
    border: 1px solid rgba(37, 99, 235, 0.3);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
}

.catalog-heading {
    font-family: var(--font-ui);
    font-size: 36px;
    font-weight: 800;
    line-height: 1.25;
    color: #FFF;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.catalog-subheading {
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.hero-button-group {
    display: flex;
    gap: 14px;
}

.catalog-controls {
    margin-bottom: 24px;
}

.academic-section-title {
    font-size: 22px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 4px;
}

.academic-section-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

/* COURSE CARDS GRID */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
}

.course-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), border-color var(--transition);
}

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

.course-top-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.course-code {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    background: var(--primary-blue-light);
    color: #93C5FD;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.course-level-tag {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.course-title {
    font-family: var(--font-ui);
    font-size: 18px;
    font-weight: 700;
    color: #FFF;
    line-height: 1.35;
    margin-bottom: 8px;
}

.course-instructor {
    font-size: 13px;
    color: var(--text-accent);
    margin-bottom: 12px;
    font-weight: 500;
}

.course-synopsis {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 20px;
    flex: 1;
}

.course-card-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.course-workload {
    font-size: 12.5px;
    color: var(--text-muted);
}

/* ==========================================================================
   VIEW 2: SYLLABUS OVERVIEW
   ========================================================================== */
.syllabus-header-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 36px 28px;
    margin-bottom: 32px;
}

.btn-back-link {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}
.btn-back-link:hover {
    color: #FFF;
}

.syllabus-course-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.course-code-pill, .course-level-pill, .course-hours-pill {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-darkest);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.course-code-pill {
    color: var(--text-accent);
    border-color: rgba(37, 99, 235, 0.4);
}

.syllabus-title {
    font-size: 28px;
    font-weight: 800;
    color: #FFF;
    margin-bottom: 6px;
}

.syllabus-dept {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.syllabus-instructor {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-accent);
    margin-bottom: 16px;
}

.syllabus-desc {
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 900px;
    margin-bottom: 24px;
}

.syllabus-progress-strip {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.progress-bar-wrap {
    flex: 1;
    height: 8px;
    background: var(--bg-darkest);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-blue);
    transition: width 0.3s ease;
}

.progress-ratio {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* SYLLABUS UNITS LIST */
.syllabus-units-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.syllabus-unit-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.unit-box-header {
    padding: 20px 24px;
    background: var(--bg-surface-raised);
    border-bottom: 1px solid var(--border-color);
}

.unit-number-title {
    font-size: 17px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 4px;
}

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

.unit-lessons-table {
    display: flex;
    flex-direction: column;
}

.syl-lesson-row {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background var(--transition);
}

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

.syl-lesson-row:hover {
    background: rgba(37, 99, 235, 0.05);
}

.syl-lesson-row.completed .lesson-status-tag {
    color: var(--pass-emerald);
}

.syl-lesson-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.lesson-check-icon {
    font-size: 16px;
    color: var(--text-muted);
}

.syl-lesson-row.completed .lesson-check-icon {
    color: var(--pass-emerald);
}

.syl-lesson-title-text {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.syl-lesson-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.syl-est-time {
    font-size: 12.5px;
    color: var(--text-muted);
}

/* ==========================================================================
   VIEW 3: INTERACTIVE STUDY WORKSPACE (SPLIT PANE)
   ========================================================================== */
.workspace-page {
    height: calc(100vh - 64px);
    overflow: hidden;
}

.workspace-top-bar {
    height: 48px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.ws-bar-left, .ws-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ws-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.ws-course-badge {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 11.5px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--primary-blue-light);
    color: #93C5FD;
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.ws-breadcrumb-sep {
    color: var(--text-muted);
}

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

.ws-lesson-name {
    font-weight: 600;
    color: #FFF;
}

.ws-lesson-stepper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-darkest);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.btn-stepper {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
}
.btn-stepper:hover {
    color: #FFF;
}

.stepper-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.time-est, .xp-gain {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.xp-gain {
    color: var(--academic-gold);
}

/* WORKSPACE SPLIT PANES */
.workspace-split {
    display: flex;
    height: calc(100% - 48px);
    overflow: hidden;
}

.ws-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.ws-pane-lecture {
    width: 48%;
    min-width: 400px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

.ws-pane-studio {
    flex: 1;
    min-width: 420px;
    background: var(--bg-code);
}

.pane-resizer {
    width: 5px;
    background: var(--border-color);
    cursor: col-resize;
    transition: background 0.15s;
}
.pane-resizer:hover {
    background: var(--primary-blue);
}

/* LECTURE TABS & PROSE */
.lecture-tabs-bar {
    height: 44px;
    background: var(--bg-surface-raised);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 6px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.lec-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lec-tab:hover {
    color: #FFF;
}

.lec-tab.active {
    background: var(--bg-surface);
    color: #FFF;
    border: 1px solid var(--border-color);
    border-bottom: none;
}

.lec-pane-content {
    display: none;
    padding: 28px;
}
.lec-pane-content.active {
    display: block;
}

/* Learning Objectives Card */
.learning-objectives-card {
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.obj-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-accent);
    margin-bottom: 10px;
}

.obj-list {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13.5px;
    color: #E2E8F0;
}

/* Textbook Reading Prose */
.lecture-prose {
    font-family: var(--font-prose);
    font-size: 17px;
    line-height: 1.75;
    color: #E2E8F0;
    margin-bottom: 32px;
}

.lecture-prose h3 {
    font-family: var(--font-ui);
    font-size: 20px;
    font-weight: 700;
    color: #FFF;
    margin: 28px 0 12px;
}

.lecture-prose h4 {
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 700;
    color: #CBD5E1;
    margin: 20px 0 8px;
}

.lecture-prose p {
    margin-bottom: 16px;
}

.lecture-prose code {
    font-family: var(--font-mono);
    font-size: 14px;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: #93C5FD;
}

.lecture-prose pre {
    background: #060910;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    overflow-x: auto;
    margin: 18px 0;
}

.lecture-prose pre code {
    background: transparent;
    padding: 0;
    color: #F8FAFC;
    font-size: 13.5px;
}

.lecture-prose blockquote {
    border-left: 3px solid var(--academic-gold);
    background: var(--academic-gold-light);
    padding: 12px 18px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 14.5px;
    color: #FEF3C7;
    margin: 20px 0;
}

/* Key Takeaways Card */
.takeaways-card {
    background: var(--academic-gold-light);
    border-left: 3px solid var(--academic-gold);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 16px 20px;
    margin-bottom: 28px;
}

.takeaways-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #F59E0B;
    margin-bottom: 10px;
}

.takeaways-list {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13.5px;
    color: #FEF3C7;
}

/* Exercise Specification Card */
.exercise-card {
    background: var(--bg-surface-raised);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-blue);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

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

.ex-tag {
    font-size: 14px;
    font-weight: 700;
    color: #FFF;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ex-status {
    font-size: 12px;
    font-weight: 600;
    color: var(--academic-gold);
}

.exercise-prompt-body {
    font-size: 14.5px;
    line-height: 1.65;
    color: #E2E8F0;
}

/* Progressive Hints Accordion */
.hints-accordion {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    overflow: hidden;
}

.hints-toggle-btn {
    width: 100%;
    padding: 12px 18px;
    background: var(--bg-surface-raised);
    border: none;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}
.hints-toggle-btn:hover {
    color: #FFF;
}

.hints-body {
    padding: 16px 20px;
    background: var(--bg-darkest);
    font-size: 13.5px;
    color: var(--text-secondary);
}
.hints-body ol {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Solution Reveal */
.solution-inspection {
    margin-top: 16px;
}

.btn-reveal-solution {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-reveal-solution:hover {
    color: var(--text-secondary);
}

.solution-code-viewer {
    margin-top: 10px;
    background: #060910;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #A7F3D0;
}

/* KNOWLEDGE CHECK QUIZ */
.quiz-container {
    max-width: 600px;
}

.quiz-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--academic-gold);
    background: var(--academic-gold-light);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.quiz-question {
    font-size: 17px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 20px;
    line-height: 1.45;
}

.quiz-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.quiz-opt-btn {
    padding: 14px 18px;
    background: var(--bg-surface-raised);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
}
.quiz-opt-btn:hover {
    border-color: var(--border-hover);
    background: #202B44;
}

.quiz-opt-btn.correct {
    border-color: var(--pass-emerald);
    background: var(--pass-emerald-light);
    color: #A7F3D0;
}

.quiz-opt-btn.wrong {
    border-color: var(--error-ruby);
    background: var(--error-ruby-light);
    color: #FECDD3;
}

.quiz-feedback-box {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    line-height: 1.5;
}

/* STUDENT NOTES */
.notes-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notes-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.notes-textarea {
    width: 100%;
    height: 320px;
    background: var(--bg-darkest);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.6;
    outline: none;
    resize: none;
}
.notes-textarea:focus {
    border-color: var(--primary-blue);
}

.notes-saved-flag {
    font-size: 12px;
    color: var(--pass-emerald);
}

/* ==========================================================================
   RIGHT PANE: CODE STUDIO & EVALUATION
   ========================================================================== */
.studio-toolbar {
    height: 42px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.studio-tab-active {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-accent);
    background: var(--bg-code);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.studio-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.studio-editor-wrapper {
    flex: 1;
    position: relative;
    background: var(--bg-code);
}

.studio-code-area {
    width: 100%;
    height: 100%;
    background: transparent;
    color: #F8FAFC;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.65;
    padding: 18px 24px;
    border: none;
    outline: none;
    resize: none;
    tab-size: 4;
    white-space: pre;
}

/* STUDIO CONSOLE DRAWER */
.studio-console-drawer {
    height: 290px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.console-tab-strip {
    height: 40px;
    background: var(--bg-surface-raised);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 6px;
}

.c-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.c-tab:hover {
    color: #FFF;
}

.c-tab.active {
    background: var(--bg-surface);
    color: #FFF;
    border: 1px solid var(--border-color);
    border-bottom: none;
}

.c-tab-count {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
}

.c-tools {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.latency-label {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-muted);
}

.console-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-darkest);
}

.c-pane {
    display: none;
    height: 100%;
}
.c-pane.active {
    display: block;
}

/* Test Assertion Results */
.test-assertions-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.test-row {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.test-row.passed {
    border-left: 3px solid var(--pass-emerald);
}

.test-row.failed {
    border-left: 3px solid var(--error-ruby);
}

.test-row-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
}

.badge-pass {
    color: var(--pass-emerald);
    font-size: 11.5px;
    font-weight: 700;
}

.badge-fail {
    color: var(--error-ruby);
    font-size: 11.5px;
    font-weight: 700;
}

.test-diff-card {
    font-family: var(--font-mono);
    font-size: 12px;
    background: #060910;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.diff-exp {
    color: #93C5FD;
}
.diff-act {
    color: #F87171;
}

.stdout-stream {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: #E2E8F0;
    white-space: pre-wrap;
}

.stream-idle {
    color: var(--text-muted);
}

.web-preview-box {
    width: 100%;
    height: 100%;
    background: #FFF;
    border: none;
    border-radius: var(--radius-sm);
}

.c-empty-state {
    color: var(--text-muted);
    font-size: 13px;
    padding: 12px 0;
}

/* Console Action Bar */
.console-action-bar {
    height: 52px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.evaluation-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-secondary);
}

.eval-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pass-emerald);
}

.eval-btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* COLLAPSIBLE SYLLABUS DRAWER */
.syllabus-drawer {
    position: fixed;
    top: 64px;
    right: -420px;
    width: 420px;
    height: calc(100vh - 64px);
    background: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 80;
    transition: right 0.25s ease;
    display: flex;
    flex-direction: column;
}

.syllabus-drawer.open {
    right: 0;
}

.drawer-header {
    height: 48px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.drawer-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: #FFF;
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.drawer-unit-group {
    background: var(--bg-surface-raised);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.drawer-unit-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-accent);
    margin-bottom: 8px;
}

.drawer-lesson-item {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}
.drawer-lesson-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #FFF;
}
.drawer-lesson-item.active {
    background: var(--primary-blue-light);
    color: #FFF;
    font-weight: 600;
}

/* ==========================================================================
   MODALS: STUDENT AUTH & CONGRATS
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 12, 20, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-dialog {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    position: relative;
    width: 440px;
    padding: 32px;
}

.btn-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
}
.btn-modal-close:hover {
    color: #FFF;
}

.auth-dialog-header {
    text-align: center;
    margin-bottom: 24px;
}

.dialog-crest {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: var(--primary-blue-light);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93C5FD;
    font-size: 22px;
}

.auth-dialog-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 4px;
}
.auth-dialog-header p {
    font-size: 13px;
    color: var(--text-muted);
}

.auth-toggle-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.auth-toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    font-size: 13.5px;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}
.auth-toggle-btn.active {
    color: var(--text-accent);
    border-color: var(--primary-blue);
}

.student-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-control {
    background: var(--bg-darkest);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}
.input-control:focus {
    border-color: var(--primary-blue);
}

.auth-separator {
    text-align: center;
    position: relative;
    margin: 18px 0 14px;
}
.auth-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--border-color);
}
.auth-separator span {
    position: relative;
    background: var(--bg-surface);
    padding: 0 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.auth-error-banner {
    background: var(--error-ruby-light);
    border: 1px solid var(--error-ruby);
    color: #FECDD3;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    margin-bottom: 14px;
}

/* CONGRATS DIALOG */
.modal-congrats-dialog {
    width: 460px;
    text-align: center;
    overflow: hidden;
}

.congrats-crest {
    font-size: 48px;
    color: var(--academic-gold);
    margin-bottom: 12px;
}

.congrats-title {
    font-size: 24px;
    font-weight: 800;
    color: #FFF;
    margin-bottom: 4px;
}

.congrats-lesson {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.congrats-award {
    margin-bottom: 24px;
}

.award-pts {
    display: inline-block;
    background: var(--academic-gold-light);
    border: 1px solid rgba(217, 119, 6, 0.3);
    color: #FBBF24;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 15px;
}

.congrats-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#congrats-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Custom Scrollbars */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* Responsive adjustments */
@media (max-width: 960px) {
    .workspace-split {
        flex-direction: column;
    }
    .ws-pane-lecture {
        width: 100%;
        height: 50%;
    }
    .ws-pane-studio {
        width: 100%;
        height: 50%;
    }
    .pane-resizer {
        display: none;
    }
}
