/* ===== VexTrainer Web - Complete Styles ===== */
/* Single CSS file for entire site */

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

/* ===== CSS Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --border-color: #dee2e6;
    --text-color: #212529;
    --text-muted: #6c757d;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
    
    /* Font stacks */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', 'Consolas', 'Monaco', monospace;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--light-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Code and preformatted text */
code,
pre,
kbd,
samp {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* Lesson content - enhanced readability */
.lesson-content {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.75;
    letter-spacing: -0.003em;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-dark);
}

/* ===== Header Styles ===== */
.site-header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    flex: 1;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.header-center {
    flex: 0 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.logo-icon {
    font-size: 32px;
}

.header-right {
    flex: 1;
    text-align: right;
}

.btn-signin {
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
}

.btn-signin:hover {
    background: var(--primary-dark);
    color: white;
}

/* User Menu */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
}

.user-button:hover {
    background: var(--light-color);
}

.user-icon {
    font-size: 20px;
}

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

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1001;
}

.user-dropdown.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 15px;
}

.dropdown-item:hover {
    background: var(--light-color);
}

.dropdown-divider {
    margin: 8px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

.dropdown-form {
    margin: 0;
}

.signout-button {
    color: var(--error-color);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    margin: 10px 20px;
    border-radius: 6px;
    position: relative;
    animation: slideDown 0.3s ease;
}

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

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
}

.alert-close:hover {
    opacity: 1;
}

/* ===== Main Content ===== */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 40px 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.container-sm {
    max-width: 600px;
    margin: 0 auto;
}

.container-md {
    max-width: 900px;
    margin: 0 auto;
}

/* ===== Footer Styles ===== */
.site-footer {
    background: var(--dark-color);
    color: white;
    padding: 40px 20px 20px;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-link {
    color: white;
    padding: 0 10px;
}

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

.footer-separator {
    color: var(--text-muted);
}

.footer-apps {
    margin: 25px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.footer-apps-label {
    font-weight: 600;
}

.app-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: white;
    font-weight: 500;
    transition: all 0.3s;
}

.app-badge:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    transform: translateY(-2px);
}

.app-icon {
    width: 24px;
    height: 24px;
}

.footer-copyright {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
}

/* ===== Form Styles ===== */
.form-container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-color);
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

/* Floating Label Styles */
.floating-label {
    position: relative;
}

.floating-label input,
.floating-label textarea {
    width: 100%;
    padding: 12px 12px 12px 0;
    border: none;
    border-bottom: 2px solid var(--border-color);
    font-size: 16px;
    background: transparent;
    transition: border-color 0.3s;
}

.floating-label input:focus,
.floating-label textarea:focus {
    outline: none;
    border-bottom-color: var(--primary-color);
}

.floating-label label {
    position: absolute;
    left: 0;
    top: 12px;
    color: var(--text-muted);
    font-size: 16px;
    transition: all 0.3s;
    pointer-events: none;
}

.floating-label input:focus + label,
.floating-label input:valid + label,
.floating-label input:not(:placeholder-shown) + label,
.floating-label textarea:focus + label,
.floating-label textarea:valid + label {
    top: -18px;
    font-size: 12px;
    color: var(--primary-color);
}

.error-message {
    display: block;
    color: var(--error-color);
    font-size: 13px;
    margin-top: 5px;
}

.help-text {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 5px;
}

.toggle-password {
    position: absolute;
    right: 0;
    top: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;  /* Keep text white on hover */
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

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

.btn-block {
    width: 100%;
    display: block;
}

.button-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.button-row .btn {
    flex: 1;
}

/* ===== Card Styles ===== */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 15px 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* ===== Module/Lesson Styles ===== */
.module-card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 25px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.module-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.module-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.module-description {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.module-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--success-color);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--light-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success-color);
    transition: width 0.3s;
}

/* Lesson List */
.lesson-list {
    list-style: none;
}

.lesson-item {
    background: white;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
}

.lesson-item:hover {
    transform: translateX(5px);
}

.lesson-status {
    font-size: 32px;
}

.lesson-content {
    flex: 1;
}

.lesson-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.lesson-description {
    color: var(--text-muted);
    font-size: 14px;
}

.lesson-action {
    white-space: nowrap;
}

/* ===== Dashboard Styles ===== */
.dashboard-header {
    text-align: center;
    margin-bottom: 40px;
}

.dashboard-header h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-muted);
    margin-top: 5px;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-left, .header-right {
        text-align: center;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .button-row {
        flex-direction: column;
    }
    
    .button-row .btn {
        width: 100%;
    }
    
    .form-container {
        padding: 20px;
    }
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-error { color: var(--error-color); }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.hidden { display: none; }
.visible { display: block; }

/* ===== Browse Lessons / TOC Styles ===== */

/* Page Header */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    margin: 0 0 8px 0;
    font-size: 28px;
}

.page-header .subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 16px;
}

/* Progress Legend */
.progress-legend {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

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

/* Legend indicators - small colored circles */
.legend-item .status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Lessons List - Ultra Compact for 1000+ Items, 4-Level Support */
.lessons-list {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 15px 25px;
}

/* Level 1: Module List - NO BULLETS */
.lessons-list .module-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.lessons-list .module-item {
    margin-bottom: 8px;
    list-style-type: none;
}

.lessons-list .module-item:last-child {
    margin-bottom: 0;
}

.module-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0 2px 0;
    margin-bottom: 2px;
}

.module-name {
    font-size: 15px;
    font-weight: 600;
    flex: 1;
    line-height: 1.3;
}

.progress-text {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.3;
}

/* Level 2: Lesson List - DISC BULLETS • */
.lessons-list .lesson-list {
    list-style-type: disc;
    padding-left: 15px;
    margin: 2px 0 0 0;
}

.lessons-list .lesson-item {
    margin: 1px 0;
    line-height: 1.3;
    list-style-type: disc;
    display: list-item;
}

.lesson-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    padding: 1px 0;
    line-height: 1.3;
}

.lesson-link:hover {
    text-decoration: underline;
}

.lesson-name {
    flex: 1;
    font-size: 13px;
    line-height: 1.3;
}

.topic-count {
    font-size: 11px;
    color: #6c757d;
    line-height: 1.3;
}

/* Level 3: Topic List - CIRCLE BULLETS ○ */
.lessons-list .topic-list {
    list-style-type: circle;
    padding-left: 15px;
    margin: 1px 0 0 0;
}

.lessons-list .topic-item {
    margin: 1px 0;
    line-height: 1.3;
    list-style-type: circle;
    display: list-item;
}

.topic-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: inherit;
    padding: 0;
    font-size: 12px;
    line-height: 1.3;
}

.topic-link:hover {
    text-decoration: underline;
}

.topic-name {
    line-height: 1.3;
}

/* Level 4: Sub-topic List - SQUARE BULLETS ▪ */
.lessons-list .subtopic-list {
    list-style-type: square;
    padding-left: 15px;
    margin: 1px 0 0 0;
}

.lessons-list .subtopic-item {
    margin: 1px 0;
    line-height: 1.3;
    list-style-type: square;
    display: list-item;
}

.subtopic-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: inherit;
    padding: 0;
    font-size: 11px;
    line-height: 1.3;
}

.subtopic-link:hover {
    text-decoration: underline;
}

.subtopic-name {
    line-height: 1.3;
}

/* Navigation Buttons */
.lesson-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 30px 0;
    border-top: 2px solid #e9ecef;
}

.nav-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.nav-prev {
    background: #007bff;
    color: white;
}

.nav-prev:hover {
    background: #0056b3;
}

.nav-next {
    background: #007bff;
    color: white;
    margin-left: auto;  /* Always push to right */
}

.nav-next:hover {
    background: #0056b3;
}

.nav-quiz {
    background: #28a745;
    color: white;
    margin-left: auto;
}

.nav-quiz:hover {
    background: #218838;
}

/* Completed - Green text */
.status-completed .module-name {
    color: #28a745;
    font-weight: 700;
}

.status-completed .lesson-name {
    color: #28a745;
    font-weight: 600;
}

.status-completed .topic-name {
    color: #28a745;
    font-weight: 600;
}

.status-completed .subtopic-name {
    color: #28a745;
    font-weight: 500;
}

/* Partial - Orange text */
.status-partial .module-name {
    color: #ff8c00;
    font-weight: 700;
}

.status-partial .lesson-name {
    color: #ff8c00;
    font-weight: 600;
}

.status-partial .topic-name {
    color: #ff8c00;
    font-weight: 600;
}

.status-partial .subtopic-name {
    color: #ff8c00;
    font-weight: 500;
}

/* Unread - Gray text */
.status-unread .module-name {
    color: #6c757d;
}

.status-unread .lesson-name {
    color: #6c757d;
}

.status-unread .topic-name {
    color: #6c757d;
}

.status-unread .subtopic-name {
    color: #6c757d;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* ===== Lesson Viewer Styles ===== */

.lesson-viewer {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.lesson-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-top: 2px solid #e9ecef;
}

.back-link {
    display: inline-block;
    margin-bottom: 15px;
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    text-decoration: underline;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 15px;
    font-size: 14px;
    color: #6c757d;
}

.breadcrumb-item {
    display: inline;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #adb5bd;
}

.breadcrumb-current {
    color: #495057;
    font-weight: 500;
}

.lesson-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: #212529;
}

/* Progress Bar */
.progress-container {
    margin-top: 10px;
}

.progress-bar-wrapper {
    width: 100%;
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    gap: 2px;
    padding: 2px;
}

.progress-segment {
    flex: 1;
    height: 100%;
    background: #dee2e6;
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

.progress-segment.completed {
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.progress-segment.current {
    background: linear-gradient(135deg, #28a745, #20c997);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Completion Message */
.completion-message {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    width: 100%;
}

.completion-message p:first-child {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #28a745;
}

.quiz-suggestion {
    font-size: 14px;
    color: #6c757d;
    margin: 0 0 20px 0;
}

.nav-back {
    background: #007bff;
    color: white;
}

.nav-back:hover {
    background: #0056b3;
}

/* Code Blocks with Copy Button */
#lessonContent pre {
    position: relative;
    background: #2d2d2d !important;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 15px 0;
}

#lessonContent pre code {
    background: none !important;
    padding: 0 !important;
    color: #f8f8f2 !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

#lessonContent pre code[class*="language-"] {
    background: transparent !important;
}

.code-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 0;
    border-bottom: none;
}

.code-language {
    display: none;  /* Hide language label */
}

.copy-code-btn {
    background: #444;
    color: #f8f8f2;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 500;
}

.copy-code-btn:hover {
    background: #555;
}

.copy-code-btn.copied {
    background: #28a745;
    color: white;
}

/* Lesson Content */
.lesson-viewer .lesson-content {
    min-height: 400px;
    margin-bottom: 40px;
    line-height: 1.7;
}

.lesson-viewer .lesson-content h3 {
    font-size: 24px;
    margin: 30px 0 15px 0;
    color: #212529;
}

.lesson-viewer .lesson-content h4 {
    font-size: 20px;
    margin: 25px 0 12px 0;
    color: #495057;
}

.lesson-viewer .lesson-content p {
    margin-bottom: 15px;
}

.lesson-viewer .lesson-content pre {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 15px 0;
}

.lesson-viewer .lesson-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.lesson-viewer .lesson-content pre code {
    background: none;
    padding: 0;
}

.lesson-viewer .lesson-content ul, .lesson-viewer .lesson-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

.lesson-viewer .lesson-content li {
    margin: 8px 0;
}

.lesson-viewer .lesson-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 8px;
}

.lesson-viewer .loading, .lesson-viewer .error {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.lesson-viewer .error {
    color: #dc3545;
}

/* Mobile responsive - Lesson Viewer */
@@media (max-width: 768px) {
    .lesson-viewer {
        padding: 15px;
    }

    .lesson-header h1 {
        font-size: 24px;
    }

    .lesson-viewer .lesson-content h3 {
        font-size: 20px;
    }

    .lesson-viewer .lesson-content h4 {
        font-size: 18px;
    }

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

    .nav-btn {
        width: 100%;
        margin-left: 0 !important;
    }
}

/* ===== Accordion Lessons Styles ===== */
/* Accordion Container */
.accordion-lessons {
    margin-top: 20px;
}

/* Accordion Item */
.accordion-item {
    margin-bottom: 4px;
    border-radius: 4px;
    overflow: hidden;
}

/* Accordion Header */
.accordion-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.accordion-header:hover {
    background: rgba(0, 0, 0, 0.03);
}

/* Toggle Icons */
.toggle-icon {
    display: inline-block;
    width: 20px;
    font-size: 12px;
    transition: transform 0.2s;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-icon.expanded {
    transform: rotate(90deg);
}

.toggle-icon-spacer {
    display: inline-block;
    width: 20px;
    flex-shrink: 0;
}

/* Item Titles */
.item-title {
    flex: 1;
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.item-title:hover {
    color: #007bff;
}

/* Lesson, Topic, Sub-topic Links */
.lesson-link, .topic-link, .subtopic-link {
    display: block;
    width: 100%;
}

/* Accordion Content */
.accordion-content {
    padding-left: 20px;
}

/* Level-Specific Styling */
.accordion-item {
    background: #f8f9fa;
}

.lesson-level {
    background: #fff;
    margin-bottom: 2px;
}

.topic-level {
    background: #fafafa;
    margin-bottom: 1px;
}

.subtopic-level {
    background: #fcfcfc;
    margin-bottom: 1px;
}

/* Status Colors */
.status-completed {
    border-left: 4px solid #28a745;
}

.status-partial {
    border-left: 4px solid #ffc107;
}

.status-unread {
    border-left: 4px solid #6c757d;
}

/* Status Completed - Green tint */
.status-completed .item-title {
    color: #28a745;
}

/* Status Partial - Orange tint */
.status-partial .item-title {
    color: #d39e00;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state p {
    font-size: 18px;
    margin: 0;
}

/* ===== Lesson Page (Topic Viewer) Styles ===== */
/* Breadcrumb Navigation */
.breadcrumb-nav {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
}

.breadcrumb-nav a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb-nav a:hover {
    text-decoration: underline;
}

.breadcrumb-nav span {
    margin: 0 8px;
    color: #6c757d;
}

/* Lesson Viewer */
.lesson-viewer {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Lesson Content */
.lesson-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    min-height: 400px;
}

.lesson-content .loading {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 18px;
}

.lesson-content .error {
    text-align: center;
    padding: 60px 20px;
    color: #dc3545;
    font-size: 18px;
}

/* Navigation Buttons */
.lesson-navigation {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
    flex: 1;
    max-width: 300px;
}

.nav-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.nav-btn.prev {
    text-align: left;
}

.nav-btn.next {
    text-align: right;
    margin-left: auto;
}

.nav-arrow {
    font-size: 24px;
    color: #007bff;
}

.nav-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 600;
}

.nav-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.nav-btn-spacer {
    flex: 1;
    max-width: 300px;
}

/* Mark Complete Button */
#markCompleteBtn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
}

/* Mobile Responsive - Lesson Page */
@media (max-width: 768px) {
    .lesson-content {
        padding: 20px;
    }

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

    .nav-btn {
        max-width: 100%;
        width: 100%;
    }

    .nav-btn.next {
        margin-left: 0;
    }

    #markCompleteBtn {
        width: 100%;
    }
}

/* ===== Custom Code Blocks with Line Numbers & Copy Button ===== */
/* Clean, simple implementation - no finicky Prism plugins! */

/* Code block container */
pre {
    position: relative;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin: 1.5em 0;
    padding: 0;
    background: #2d2d2d;
    overflow: hidden;
}

/* Code container (holds line numbers + code) */
.code-container {
    display: flex;
    position: relative;
    overflow-x: auto;
}

/* Line numbers column */
.line-numbers-wrapper {
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
    padding: 1.25em 0;
    margin: 0;
    border-right: 1px solid #444;
    user-select: none;
    min-width: 45px;
    text-align: right;
}

.line-number {
    display: block;
    padding: 0 12px 0 8px;
    color: #858585;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    height: 1.6em;
}

/* Code content column */
.code-content {
    flex: 1;
    padding: 1.25em 1.5em;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
}

.code-content code {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    background: transparent;
    padding: 0;
}

/* Copy button */
.copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #007bff;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 10;
}

.copy-code-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.4);
}

.copy-code-btn:active {
    transform: translateY(0);
}

.copy-code-btn.copied {
    background: #28a745;
}

/* Inline code (not in pre blocks) */
:not(pre) > code {
    padding: 0.2em 0.4em;
    background: #f5f5f5;
    border-radius: 3px;
    color: #e83e8c;
    font-size: 0.875em;
    font-family: var(--font-mono);
}

/* Prism syntax highlighting colors (keep these!) */
.token.keyword {
    color: #66d9ef;
    font-weight: 600;
}

.token.function {
    color: #a6e22e;
}

.token.class-name {
    color: #e6db74;
    font-weight: 500;
}

.token.operator {
    color: #f92672;
}

.token.number {
    color: #ae81ff;
}

.token.string {
    color: #e6db74;
}

.token.comment {
    color: #75715e;
    font-style: italic;
}

.token.boolean,
.token.constant {
    color: #ae81ff;
}

.token.punctuation {
    color: #f8f8f2;
}

/* Scrollbar for code blocks */
.code-container::-webkit-scrollbar {
    height: 8px;
}

.code-container::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 4px;
}

.code-container::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.code-container::-webkit-scrollbar-thumb:hover {
    background: #777;
}


/* ===== OVERRIDE Prism Toolbar Defaults ===== */
/* Force hide the default gray capsule background */
div.code-toolbar > .toolbar > .toolbar-item {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

div.code-toolbar > .toolbar > .toolbar-item > * {
    background: #007bff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}
