/* ============================================
   Java Learning Hub - Modern Dark Design
   ============================================ */

/* CSS Variables */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #0b1120;
    --bg-tertiary: #1e293b;
    --bg-hover: #334155;
    --bg-active: rgba(99, 102, 241, 0.1);
    
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-error: #ef4444;
    
    --java-orange: #f8981d;
    --java-blue: #5382a1;
    
    --border-primary: #1e293b;
    --border-secondary: #334155;
    
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    
    --header-height: 56px;
    --sidebar-width: 280px;
    --status-height: 32px;
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

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

html, body {
    height: 100%;
    min-height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

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

/* Screen reader only - visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--accent-primary);
    color: white;
    padding: 8px 16px;
    z-index: 9999;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-secondary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Text Selection - Remove highlight */
::selection,
::-moz-selection {
    background: transparent !important;
}

/* App Container */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    min-height: 0;
}

/* ============================================
   Header
   ============================================ */
.header {
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 18px;
    color: white;
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--java-orange);
}

.logo-text {
    letter-spacing: -0.02em;
}

.logo-accent {
    color: var(--accent-primary);
}

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

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

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

.breadcrumb-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.breadcrumb-lesson {
    color: var(--accent-primary);
    font-weight: 500;
}

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

.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-primary);
}

.ai-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
    animation: pulse 2s infinite;
}

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

.ai-status-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.header-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.header-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.header-btn svg {
    width: 20px;
    height: 20px;
}

.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    background: transparent;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.mobile-menu-btn svg {
    width: 22px;
    height: 22px;
}

.sidebar-overlay {
    display: none;
}

/* ============================================
   Main Layout
   ============================================ */
.main {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    height: calc(100vh - var(--header-height) - var(--status-height));
}

/* ============================================
   Sidebar - Left
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-progress {
    padding: 16px;
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), #818cf8);
    border-radius: 3px;
    transition: width var(--transition-normal);
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 8px;
}

.progress-percent {
    color: var(--accent-primary);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    min-height: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(30, 41, 59, 0.5);
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-secondary svg {
    width: 16px;
    height: 16px;
}

/* Module & Lesson Items */
.module-item {
    margin-bottom: 16px;
}

.module-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.module-header:hover {
    color: var(--text-secondary);
}

.module-header svg {
    width: 12px;
    height: 12px;
    transition: transform var(--transition-fast);
}

.module-header.expanded svg {
    transform: rotate(90deg);
}

.lesson-list {
    margin-top: 4px;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lesson-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.lesson-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    font-weight: 500;
}

.lesson-item.completed {
    color: var(--accent-success);
}

.lesson-status {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: bold;
    color: var(--text-muted);
}

.lesson-item.completed .lesson-status {
    background: var(--accent-success);
    border-color: var(--accent-success);
    color: white;
}

.lesson-status svg {
    width: 10px;
    height: 10px;
}

.lesson-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   Content Area (Lesson + Editor side by side)
   ============================================ */
.content-area {
    flex: 1;
    display: flex;
    min-width: 0;
    overflow: hidden;
    position: relative;
    min-height: 0;
    height: calc(100vh - var(--header-height) - var(--status-height));
}

.lesson-section {
    width: 35%;
    min-width: 200px;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    flex-shrink: 1;
    min-height: 0;
}

.editor-section {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    overflow: hidden;
    position: relative;
    height: 100%;
}

/* Resize Handle - Vertical (Lesson ↔ Editor) */
.resize-handle-v {
    width: 6px;
    background: var(--bg-tertiary);
    cursor: col-resize;
    flex-shrink: 0;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Vertical resize handle indicator - always visible */
.resize-handle-v::before {
    content: '';
    width: 2px;
    height: 30px;
    background: var(--text-muted);
    border-radius: 1px;
    opacity: 0.5;
}

.resize-handle-v:hover::before {
    background: white;
    opacity: 1;
}

.resize-handle-v:hover {
    background: var(--accent-primary);
}

/* Resize Handle - Horizontal (Editor ↔ Output) */
.resize-handle-h {
    height: 6px;
    background: var(--bg-tertiary);
    cursor: row-resize;
    flex-shrink: 0;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Horizontal resize handle indicator - always visible */
.resize-handle-h::before {
    content: '';
    width: 30px;
    height: 2px;
    background: var(--text-muted);
    border-radius: 1px;
    opacity: 0.5;
}

.resize-handle-h:hover::before,
.resize-handle-h:active::before {
    background: white;
    opacity: 1;
}

.resize-handle-h:hover,
.resize-handle-h:active {
    background: var(--accent-primary);
}

/* Touch-friendly resize handles (visible on mobile) */
.resize-handle-v::after,
.resize-handle-h::after {
    content: '';
    position: absolute;
    background: transparent;
}

/* Lesson Panel */
.lesson-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
    min-height: 0;
}

.lesson-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}

.lesson-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.lesson-panel-title svg {
    width: 16px;
    height: 16px;
    color: var(--accent-primary);
}

.lesson-nav-btns {
    display: flex;
    gap: 4px;
}

.lesson-nav-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.lesson-nav-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.lesson-nav-btn svg {
    width: 16px;
    height: 16px;
}

.lesson-panel-content {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
    min-height: 0;
}

.lesson-panel-content h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.lesson-panel-content p {
    margin-bottom: 12px;
}

.lesson-panel-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 16px 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lesson-panel-content h4 svg {
    width: 16px;
    height: 16px;
    color: var(--java-orange);
}

.lesson-panel-content code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent-primary);
}

.lesson-panel-content pre {
    background: var(--bg-primary);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    margin: 12px 0;
    overflow-x: auto;
}

/* Lesson Content Blocks */
.lesson-block {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-primary);
}

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

.lesson-interactive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-primary);
}

.lesson-badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.ai-explain-btn {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.2);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ai-explain-btn:hover {
    background: rgba(99, 102, 241, 0.2);
}

.lesson-block h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.lesson-block ul {
    margin: 0;
    padding-left: 20px;
}

.lesson-block li {
    margin-bottom: 6px;
    color: var(--text-secondary);
}

/* Concept Chips */
.concept-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.concept-chip {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.concept-chip:hover {
    background: rgba(99, 102, 241, 0.2);
}

/* Example Actions */
.example-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.action-primary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-primary:hover {
    background: #4f46e5;
}

.action-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-secondary:hover {
    background: rgba(99, 102, 241, 0.2);
}

/* AI More Button */
.ai-more-btn {
    width: 100%;
    padding: 10px 16px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 12px;
    transition: all var(--transition-fast);
}

.ai-more-btn:hover {
    background: rgba(99, 102, 241, 0.2);
}

/* Practice Suggestions */
.practice-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.practice-btn {
    padding: 8px 14px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.practice-btn:hover {
    background: rgba(16, 185, 129, 0.2);
}

/* Lesson Navigation */
.lesson-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-primary);
}

.nav-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.complete-btn {
    padding: 8px 20px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.complete-btn:hover {
    background: rgba(16, 185, 129, 0.2);
}

.complete-btn.completed {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.complete-btn.completed:hover {
    background: rgba(245, 158, 11, 0.2);
}

/* Editor Panel */
.editor-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    overflow: hidden;
    position: relative;
}

/* Editor Tabs */
.editor-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    padding-top: 8px;
    background: var(--bg-primary);
    flex-shrink: 0;
}

/* Editor Tab */
.editor-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    cursor: pointer;
    flex-shrink: 0;
}

/* Editor Tab - Active */
.editor-tab.active {
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-bottom: none;
    margin-bottom: -1px;
}

/* Editor Tab Icon */
.editor-tab-icon {
    font-family: var(--font-mono);
    color: var(--java-orange);
    font-weight: 700;
}

/* Editor Tab Add Button */
.editor-tab-add {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

/* Editor Tab Add Button - Hover */
.editor-tab-add:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Editor Tab Add Button Icon */
.editor-tab-add svg {
    width: 16px;
    height: 16px;
}

/* Editor Actions */
.editor-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    flex-shrink: 0;
}

/* Icon Button */
.btn-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

/* Icon Button - Hover */
.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Icon Button Icon */
.btn-icon svg {
    width: 14px;
    height: 14px;
}

/* Primary Button */
.btn-primary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    background: var(--accent-primary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

/* Primary Button - Hover */
.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

/* Primary Button Icon */
.btn-primary svg {
    width: 12px;
    height: 12px;
}

/* Editor Wrapper */
.editor-wrapper {
    flex: 1;
    border-top: 1px solid var(--border-primary);
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.editor-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    padding-top: 8px;
    background: var(--bg-primary);
}

.editor-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    cursor: pointer;
}

.editor-tab.active {
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-bottom: none;
    margin-bottom: -1px;
}

.editor-tab-icon {
    font-family: var(--font-mono);
    color: var(--java-orange);
    font-weight: 700;
}

.editor-tab-add {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.editor-tab-add:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.editor-tab-add svg {
    width: 16px;
    height: 16px;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
}

.btn-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-icon svg {
    width: 14px;
    height: 14px;
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    background: var(--accent-primary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.btn-primary svg {
    width: 12px;
    height: 12px;
}

.editor-wrapper {
    flex: 1;
    border-top: 1px solid var(--border-primary);
    overflow: hidden;
}

#codeMirrorEditor {
    flex: 1;
    height: 100%;
    min-height: 0;
    background: var(--bg-primary);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.CodeMirror {
    height: 100% !important;
    min-height: 100% !important;
    font-family: var(--font-mono) !important;
    font-size: 14px;
    background: var(--bg-primary) !important;
    color: #f8f8f2 !important;
}

.CodeMirror-scroll {
    min-height: 100% !important;
    height: 100% !important;
    overflow-y: auto !important;
    position: relative !important;
}

.CodeMirror-vscrollbar {
    display: block !important;
}

.CodeMirror-sizer {
    min-height: 100% !important;
    min-width: 100% !important;
    position: relative !important;
}

.CodeMirror-lines {
    min-height: 100% !important;
}

.CodeMirror-linewidget {
    display: none !important;
}

.CodeMirror.CodeMirror-wrap {
    height: 100% !important;
    min-height: 100% !important;
}

.CodeMirror div.CodeMirror-scroller {
    height: 100% !important;
    min-height: 100% !important;
    overflow: auto !important;
    position: relative !important;
}

.CodeMirror div.CodeMirror-measure {
    position: absolute !important;
}

.CodeMirror-gutters {
    background: var(--bg-secondary) !important;
    border-right: 1px solid var(--border-primary) !important;
}

.CodeMirror-linenumber {
    color: #64748b !important;
    padding: 0 8px 0 4px !important;
}

.CodeMirror-activeline {
    background: transparent !important;
}

.CodeMirror-selected {
    background: transparent !important;
}

.CodeMirror-activeline-background {
    background: transparent !important;
}

/* Remove CodeMirror selection highlight */
.CodeMirror ::selection,
.CodeMirror *::selection,
.CodeMirror span::selection,
.CodeMirror-selectedtext {
    background: transparent !important;
}

/* Editor wrapper */
.editor-wrapper,
#codeMirrorEditor {
    background: var(--bg-primary);
}

/* Cursor - Dark Theme (Default) */
.CodeMirror-cursor {
    border-left: 2px solid #f8f8f2 !important;
}

.CodeMirror-focused .CodeMirror-cursor {
    border-left: 2px solid #f8f8f2 !important;
}

.CodeMirror div.CodeMirror-secondarycursor {
    border-left: 2px solid #f8f8f2 !important;
}

.CodeMirror.cm-focused .CodeMirror-cursor {
    border-left: 2px solid #f8f8f2 !important;
}

/* Cursor - Light Theme */
body.light-theme .CodeMirror-cursor,
body.light-theme .CodeMirror-focused .CodeMirror-cursor,
body.light-theme .CodeMirror div.CodeMirror-secondarycursor,
body.light-theme .CodeMirror.cm-focused .CodeMirror-cursor {
    border-left: 2px solid #1e293b !important;
}

/* Cursor - Night/Amber Theme */
body.night-theme .CodeMirror-cursor,
body.night-theme .CodeMirror-focused .CodeMirror-cursor,
body.night-theme .CodeMirror div.CodeMirror-secondarycursor,
body.night-theme .CodeMirror.cm-focused .CodeMirror-cursor {
    border-left: 2px solid #fef3c7 !important;
}

/* Output Panel */
.output-panel {
    flex-shrink: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
    min-height: 40px;
    max-height: 50%;
}

.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-primary);
}

.output-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.output-title svg {
    width: 16px;
    height: 16px;
}

.output-clear {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color var(--transition-fast);
}

.output-clear:hover {
    color: var(--text-primary);
}

.output-content {
    flex: 1;
    padding: 12px;
    overflow: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    min-height: 0;
}

#output {
    margin: 0;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

#output.error {
    color: var(--accent-error);
}

#output.success {
    color: var(--accent-success);
}

/* ============================================
   Floating Chat
   ============================================ */

/* Chat Toggle Button */
.chat-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.5);
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    border: none;
}

.chat-toggle-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.6);
}

.chat-toggle-btn svg {
    width: 26px;
    height: 26px;
    color: white;
}

.chat-btn-icon {
    font-size: 28px;
    line-height: 1;
}

.chat-toggle-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 22px;
    height: 22px;
    background: var(--accent-error);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 3px solid var(--bg-primary);
}

.chat-toggle-badge.hidden {
    display: none;
}

/* Floating Chat Panel */
.floating-chat {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 400px;
    height: 560px;
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-primary);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

.floating-chat.visible {
    display: flex;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.floating-chat-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-bottom: 1px solid var(--border-primary);
}

.floating-chat-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.floating-chat-info {
    flex: 1;
}

.floating-chat-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.status-online {
    font-size: 12px;
    color: var(--accent-success);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-online::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-success);
}

.floating-chat-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--text-muted);
    transition: all 0.2s ease;
    background: var(--bg-tertiary);
}

.floating-chat-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-error);
}

.floating-chat-close svg {
    width: 20px;
    height: 20px;
}

/* Chat Messages */
.floating-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    animation: fadeIn 0.25s ease;
}

.message:last-child {
    margin-bottom: 0;
}

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

.message.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.message.bot-message .message-avatar {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.message.user-message .message-avatar {
    background: linear-gradient(135deg, var(--accent-success), #059669);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.message-content {
    max-width: 78%;
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.message.bot-message .message-content {
    background: var(--bg-tertiary);
    border-radius: 4px 16px 16px 16px;
    color: var(--text-primary);
}

.message.user-message .message-content {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 16px 4px 16px 16px;
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.message-content p {
    margin: 0 0 10px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content p + p {
    margin-top: 8px;
}

.message-content code {
    font-family: var(--font-mono);
    font-size: 13px;
    background: rgba(0, 0, 0, 0.12);
    padding: 2px 6px;
    border-radius: 4px;
}

.message.user-message .message-content code {
    background: rgba(255, 255, 255, 0.2);
}

.message-content pre {
    background: var(--bg-primary);
    padding: 14px;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    margin: 12px 0;
    overflow-x: auto;
    border: 1px solid var(--border-primary);
}

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

.message-content ul,
.message-content ol {
    margin: 10px 0;
    padding-left: 20px;
}

.message-content li {
    margin-bottom: 6px;
}

.message-content h2,
.message-content h3,
.message-content h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.message-content h2:first-child,
.message-content h3:first-child,
.message-content h4:first-child {
    margin-top: 0;
}

.message-content strong {
    font-weight: 600;
}

.message-content em {
    font-style: italic;
}

/* Typing Indicator */
.floating-chat-typing {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    background: var(--bg-tertiary);
    border-radius: 4px 16px 16px 16px;
    width: fit-content;
    margin-top: 4px;
}

.floating-chat-typing.visible {
    display: flex;
}

.floating-chat-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    animation: typing 1.2s infinite ease-in-out both;
}

.floating-chat-typing span:nth-child(1) { animation-delay: -0.4s; }
.floating-chat-typing span:nth-child(2) { animation-delay: -0.2s; }
.floating-chat-typing span:nth-child(3) { animation-delay: 0s; }

@keyframes typing {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* Chat Input */
.floating-chat-input {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-primary);
}

.floating-chat-input textarea {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 13px;
    resize: none;
    outline: none;
    transition: border-color var(--transition-fast);
}

.floating-chat-input textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.floating-chat-input textarea::placeholder {
    color: var(--text-muted);
}

.floating-chat-input .send-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-radius: 12px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.floating-chat-input .send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.floating-chat-input .send-btn:active {
    transform: scale(0.95);
}

.floating-chat-input .send-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   Status Bar
   ============================================ */
.status-bar {
    height: var(--status-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-primary);
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

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

.status-item {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.status-item:hover {
    color: var(--text-secondary);
}

.status-item svg {
    width: 14px;
    height: 14px;
    color: var(--accent-success);
}

/* ============================================
   Modals
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-primary);
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-normal);
}

.modal.visible .modal-content {
    transform: scale(1) translateY(0);
}

/* Welcome Modal */
.welcome-modal {
    width: 480px;
    text-align: center;
}

.welcome-header {
    padding: 32px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
}

.welcome-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--java-orange);
}

.welcome-icon svg {
    width: 100%;
    height: 100%;
}

.welcome-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.welcome-header p {
    color: var(--text-secondary);
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 24px;
}

.feature {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    text-align: center;
}

.feature-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}

.feature h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.feature p {
    font-size: 11px;
    color: var(--text-muted);
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 24px 24px;
}

.btn-primary-lg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: var(--accent-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.btn-primary-lg:hover {
    background: #4f46e5;
    transform: translateY(-2px);
}

.btn-primary-lg svg {
    width: 16px;
    height: 16px;
}

.btn-secondary-lg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-secondary-lg:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-secondary-lg svg {
    width: 16px;
    height: 16px;
}

/* Settings Modal */
.settings-modal {
    width: 480px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-primary);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.close-modal {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.close-modal:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.setting-group {
    margin-bottom: 24px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-primary);
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.setting-item select,
.setting-item input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
}

.setting-item select:focus,
.setting-item input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn input {
    flex: 1;
}

.input-with-btn button {
    padding: 10px 16px;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.input-with-btn button:hover {
    background: #4f46e5;
}

.setting-item small {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.setting-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
    transition: all var(--transition-fast);
}

.setting-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.setting-btn.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-error);
    border-color: rgba(239, 68, 68, 0.3);
}

.setting-btn.danger:hover {
    background: var(--accent-error);
    color: white;
}

.setting-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-primary);
}

.btn-primary-full {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary-full:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ============================================
   Toast
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 48px;
    right: 16px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success {
    border-color: var(--accent-success);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), var(--bg-primary));
}

.toast.error {
    border-color: var(--accent-error);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1), var(--bg-primary));
}

/* ============================================
   Responsive
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .lesson-section {
        width: 40%;
        min-width: 280px;
    }
    
    .sidebar {
        width: 280px;
    }
    
    .floating-chat {
        width: 360px;
        height: 500px;
    }
    
    .header {
        padding: 0 16px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .breadcrumb {
        font-size: 12px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --header-height: 52px;
        --status-height: 40px;
    }
    
    body {
        font-size: 13px;
    }
    
    /* Header */
    .header {
        padding: 0 12px;
        justify-content: space-between;
    }
    
    .header-left {
        gap: 8px;
    }
    
    .mobile-menu-btn {
        display: flex;
        width: 36px;
        height: 36px;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: var(--text-primary);
        cursor: pointer;
        padding: 0;
        border-radius: var(--radius-sm);
        transition: background var(--transition-fast);
    }
    
    .mobile-menu-btn:hover {
        background: var(--bg-hover);
    }
    
    .mobile-menu-btn svg {
        width: 22px;
        height: 22px;
    }
    
    .logo-icon {
        display: none;
    }
    
    .logo-text {
        font-size: 16px;
    }
    
    .header-divider {
        display: none;
    }
    
    .breadcrumb {
        display: none;
    }
    
    .ai-status {
        display: none;
    }
    
    .header-right {
        gap: 8px;
    }
    
    .header-btn {
        width: 36px;
        height: 36px;
    }
    
    .header-btn svg {
        width: 18px;
        height: 18px;
    }
    
    /* Sidebar Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        transition: opacity var(--transition-normal);
    }
    
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* Sidebar */
    .sidebar {
        position: fixed;
        left: 0;
        top: var(--header-height);
        bottom: 0;
        width: 85%;
        max-width: 320px;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-progress {
        padding: 12px 16px;
    }
    
    .sidebar-section-title {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .progress-bar {
        height: 6px;
    }
    
    .progress-stats {
        font-size: 11px;
    }
    
    .sidebar-content {
        padding: 8px 0;
    }
    
    /* Main Content */
    .content-area {
        flex-direction: column;
        min-height: 0;
    }
    
    .lesson-section {
        width: 100% !important;
        max-width: 100%;
        min-height: 80px;
        height: 200px;
        flex-shrink: 0;
        border-bottom: 1px solid var(--border-primary);
    }
    
    .lesson-panel {
        padding: 12px;
    }
    
    .panel-header {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .lesson-panel-title {
        font-size: 14px;
    }
    
    .key-point {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .editor-section {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    .editor-panel {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    .output-panel {
        flex-shrink: 0;
        min-height: 80px;
        height: 150px;
        max-height: 50vh;
        overflow: hidden;
        position: relative;
        transition: height 0s !important;
    }
    
    .output-content {
        overflow: hidden;
        height: calc(100% - 36px);
    }
    
    .output-content pre {
        margin: 0;
        white-space: pre-wrap;
        word-break: break-word;
    }
    
    /* Prevent CodeMirror from causing layout shifts */
    .CodeMirror {
        height: 100% !important;
        min-height: 0 !important;
        flex: 1 !important;
    }
    
    .CodeMirror-scroll {
        min-height: 0 !important;
        height: 100% !important;
    }
    
    .CodeMirror-sizer {
        min-height: 0 !important;
    }
    
    /* Touch-friendly resize handles on mobile */
    .resize-handle-v {
        width: 100%;
        height: 12px;
        cursor: row-resize;
        background: var(--bg-hover);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition: background 0.1s;
        touch-action: none;
    }
    
    .resize-handle-v::before {
        content: '';
        width: 50px;
        height: 4px;
        background: var(--text-muted);
        border-radius: 2px;
        opacity: 0.6;
        transition: background 0.1s, opacity 0.1s;
    }
    
    .resize-handle-v:hover,
    .resize-handle-v:active {
        background: var(--accent-primary);
    }
    
    .resize-handle-v:hover::before,
    .resize-handle-v:active::before {
        background: white;
        opacity: 1;
    }
    
    .resize-handle-h {
        height: 12px;
        cursor: row-resize;
        background: var(--bg-hover);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.1s;
        touch-action: none;
    }
    
    .resize-handle-h:hover {
        background: var(--accent-primary);
    }
    
    .resize-handle-h::before {
        content: '';
        width: 50px;
        height: 4px;
        background: var(--text-muted);
        border-radius: 2px;
        opacity: 0.6;
        transition: background 0.1s, opacity 0.1s;
    }
    
    .resize-handle-h:hover::before,
    .resize-handle-h:active::before {
        background: white;
        opacity: 1;
    }
    
    /* Editor Panel Header */
    .editor-panel .panel-header {
        padding: 6px 10px;
    }
    
    .run-btn {
        padding: 6px 14px;
        font-size: 12px;
    }
    
    .panel-actions {
        gap: 6px;
    }
    
    .panel-btn {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    /* Output Panel */
    .output-content {
        font-size: 12px;
        padding: 10px;
    }
    
    /* Floating Chat */
    .floating-chat {
        width: calc(100vw - 24px);
        left: 12px;
        right: 12px;
        bottom: 70px;
        height: 60vh;
        max-height: 450px;
        border-radius: var(--radius-xl);
    }
    
    .floating-chat-header {
        padding: 10px 14px;
    }
    
    .floating-chat-header h3 {
        font-size: 14px;
    }
    
    .chat-messages {
        padding: 10px;
    }
    
    .message {
        max-width: 85%;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .floating-chat-input {
        padding: 10px 12px;
    }
    
    .floating-chat-input textarea {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .send-btn {
        width: 40px;
        height: 40px;
    }
    
    /* Quick Actions */
    .quick-actions {
        padding: 8px 10px;
        gap: 6px;
    }
    
    .quick-btn {
        padding: 4px 10px;
        font-size: 10px;
    }
    
    /* Settings Modal */
    .settings-modal {
        width: calc(100vw - 24px);
        max-width: 400px;
        margin: 12px;
        max-height: calc(100vh - 24px);
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .setting-group {
        margin-bottom: 16px;
    }
    
    .setting-group h3 {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .setting-item {
        margin-bottom: 12px;
    }
    
    .setting-item label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .setting-item small {
        font-size: 10px;
    }
    
    .theme-selector {
        gap: 8px;
    }
    
    .theme-option {
        padding: 10px 6px;
    }
    
    .theme-preview {
        width: 40px;
        height: 28px;
    }
    
    .theme-label {
        font-size: 10px;
    }
    
    /* Welcome Modal */
    .welcome-modal {
        width: calc(100vw - 24px);
        margin: 12px;
        padding: 20px;
    }
    
    .welcome-title {
        font-size: 20px;
    }
    
    .welcome-text {
        font-size: 13px;
    }
    
    /* Status Bar */
    .status-bar {
        font-size: 10px;
        padding: 0 10px;
    }
    
    /* Lesson Items */
    .lesson-item {
        padding: 10px 14px;
    }
    
    .lesson-title {
        font-size: 13px;
    }
    
    .lesson-duration {
        font-size: 10px;
    }
    
    .lesson-item .lesson-icon {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }
    
    /* Navigation Buttons */
    .lesson-nav {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .nav-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    :root {
        --header-height: 48px;
    }
    
    .header {
        padding: 0 10px;
    }
    
    .logo-text {
        font-size: 15px;
    }
    
    .header-btn {
        width: 34px;
        height: 34px;
    }
    
    .header-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .sidebar {
        width: 100%;
        max-width: 100%;
    }
    
    .floating-chat {
        width: calc(100vw - 16px);
        left: 8px;
        right: 8px;
        bottom: 60px;
        height: 65vh;
        max-height: 500px;
    }
    
    .settings-modal {
        width: calc(100vw - 16px);
        margin: 8px;
        max-height: calc(100vh - 16px);
    }
    
    .welcome-modal {
        width: calc(100vw - 16px);
        margin: 8px;
        padding: 16px;
    }
    
    .welcome-title {
        font-size: 18px;
    }
    
    .theme-selector {
        flex-direction: column;
    }
    
    .theme-option {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
    }
}

/* Touch-specific improvements */
@media (hover: none) and (pointer: coarse) {
    .run-btn,
    .nav-btn,
    .panel-btn,
    .quick-btn,
    .theme-option,
    .header-btn,
    .mobile-menu-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .lesson-item {
        min-height: 48px;
    }
    
    .floating-chat-input textarea {
        min-height: 44px;
    }
    
    .send-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .CodeMirror {
        font-size: 15px !important;
    }
}

/* ============================================
   Light Theme
   ============================================ */
body.light-theme {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-hover: #e2e8f0;
    --bg-active: rgba(99, 102, 241, 0.15);
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --accent-primary: #4f46e5;
    --accent-secondary: #7c3aed;
    --accent-success: #059669;
    --accent-warning: #d97706;
    --accent-error: #dc2626;
    
    --border-primary: #e2e8f0;
    --border-secondary: #cbd5e1;
}

body.light-theme .header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

body.light-theme .logo-text {
    color: var(--text-primary);
}

body.light-theme .logo-accent {
    color: var(--accent-primary);
}

body.light-theme .breadcrumb {
    color: var(--text-secondary);
}

body.light-theme .ai-status-text {
    color: var(--accent-success);
}

body.light-theme .header-btn {
    color: var(--text-secondary);
}

body.light-theme .header-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body.light-theme .mobile-menu-btn {
    color: var(--text-secondary);
}

body.light-theme .mobile-menu-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body.light-theme .sidebar-overlay {
    background: rgba(0, 0, 0, 0.3);
}

body.light-theme .sidebar {
    background: var(--bg-primary);
}
body.light-theme .lesson-section,
body.light-theme .lesson-panel,
body.light-theme .output-panel,
body.light-theme .floating-chat {
    background: var(--bg-primary);
    border-color: var(--border-primary);
}

body.light-theme .main {
    background: var(--bg-secondary);
}

body.light-theme .editor-section {
    background: var(--bg-secondary);
}

body.light-theme .editor-panel,
body.light-theme .CodeMirror {
    background: #ffffff !important;
}

body.light-theme .CodeMirror-gutters {
    background: #f1f5f9 !important;
    border-right: 1px solid #e2e8f0 !important;
}

body.light-theme .CodeMirror-linenumber {
    color: #94a3b8 !important;
}

body.light-theme .CodeMirror-selected {
    background: rgba(99, 102, 241, 0.1) !important;
}

body.light-theme .CodeMirror-activeline,
body.light-theme .CodeMirror-activeline-background {
    background: rgba(99, 102, 241, 0.03) !important;
}

body.light-theme .editor-panel,
body.light-theme .editor-section,
body.light-theme .editor-wrapper,
body.light-theme #codeMirrorEditor {
    background: #ffffff !important;
}

body.light-theme .CodeMirror {
    background: #ffffff !important;
}

body.light-theme .CodeMirror div.CodeMirror-scroller {
    background: #ffffff !important;
}

body.light-theme .floating-chat-header {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.06) 0%, rgba(124, 58, 237, 0.04) 100%);
    border-bottom: 1px solid var(--border-primary);
}

body.light-theme .message.bot-message .message-content {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

body.light-theme .message.user-message .message-content {
    background: var(--accent-primary);
    color: #ffffff;
}

body.light-theme .floating-chat-input {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-primary);
}

body.light-theme .floating-chat-input textarea {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
}

body.light-theme .floating-chat-input textarea:focus {
    border-color: var(--accent-primary);
    outline: none;
}

body.light-theme .settings-modal {
    background: var(--bg-primary);
}

body.light-theme .setting-group h3 {
    color: var(--text-primary);
}

body.light-theme .setting-item label {
    color: var(--text-secondary);
}

body.light-theme .modal-header h2 {
    color: var(--text-primary);
}

body.light-theme .modal-header .close-modal {
    color: var(--text-secondary);
}

body.light-theme .modal-header .close-modal:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body.light-theme .setting-item small {
    color: var(--text-muted);
}

body.light-theme input[type="password"],
body.light-theme input[type="text"],
body.light-theme select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    color: var(--text-primary);
}

body.light-theme input[type="password"]:focus,
body.light-theme input[type="text"]:focus {
    border-color: var(--accent-primary);
    outline: none;
}

body.light-theme .btn-primary-full {
    background: var(--accent-primary);
    color: #ffffff;
}

body.light-theme .btn-primary-full:hover {
    background: #4338ca;
}

body.light-theme .lesson-item {
    color: var(--text-primary);
}

body.light-theme .lesson-item:hover {
    background: var(--bg-hover);
}

body.light-theme .lesson-item.active {
    background: var(--bg-active);
    border-left-color: var(--accent-primary);
    color: var(--accent-primary);
}

body.light-theme .lesson-duration {
    color: var(--text-muted);
}

body.light-theme .lesson-panel-title {
    color: var(--text-primary);
}

body.light-theme .key-point {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

body.light-theme .key-point-icon {
    color: var(--accent-primary);
}

body.light-theme .panel-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
}

body.light-theme .run-btn {
    background: var(--accent-success);
    color: #ffffff;
}

body.light-theme .run-btn:hover {
    background: #047857;
}

body.light-theme .output-content {
    color: var(--text-primary);
    background: #ffffff;
}

body.light-theme .status-bar {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-primary);
    color: var(--text-secondary);
}

body.light-theme .resize-handle {
    background: var(--border-secondary);
}

body.light-theme .resize-handle:hover {
    background: var(--accent-primary);
}

body.light-theme .welcome-modal {
    background: var(--bg-primary);
}

body.light-theme .welcome-title {
    color: var(--text-primary);
}

body.light-theme .welcome-text {
    color: var(--text-secondary);
}

body.light-theme .welcome-btn-primary {
    background: var(--accent-primary);
    color: #ffffff;
}

body.light-theme .welcome-btn-secondary {
    color: var(--accent-primary);
}

body.light-theme .theme-option {
    background: var(--bg-tertiary);
    border-color: var(--border-secondary);
}

body.light-theme .theme-option.active {
    border-color: var(--accent-primary);
}

/* Theme Selector */
.theme-selector {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.theme-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-option:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.theme-option.active {
    border-color: var(--accent-primary);
    background: var(--bg-active);
}

.theme-preview {
    width: 48px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-secondary);
}

.theme-preview.dark {
    background: linear-gradient(135deg, #0f172a 50%, #1e293b 50%);
}

.theme-preview.light {
    background: linear-gradient(135deg, #ffffff 50%, #f1f5f9 50%);
}

.theme-preview.night {
    background: linear-gradient(135deg, #1a1410 50%, #2d2319 50%);
}

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

.theme-option.active .theme-label {
    color: var(--accent-primary);
}

/* Night Theme Overrides */
body.night-theme {
    --bg-primary: #1a1410;
    --bg-secondary: #0f0c08;
    --bg-tertiary: #2d2319;
    --bg-hover: #3d3127;
    --bg-active: rgba(251, 191, 36, 0.15);
    
    --text-primary: #fef3c7;
    --text-secondary: #fcd34d;
    --text-muted: #b45309;
    
    --accent-primary: #f59e0b;
    --accent-secondary: #d97706;
    --accent-success: #84cc16;
    --accent-warning: #fbbf24;
    --accent-error: #f87171;
    
    --border-primary: #3d3127;
    --border-secondary: #4d4137;
}

body.night-theme .header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
}

body.night-theme .logo-text {
    color: var(--text-primary);
}

body.night-theme .logo-accent {
    color: var(--accent-primary);
}

body.night-theme .breadcrumb {
    color: var(--text-secondary);
}

body.night-theme .ai-status-text {
    color: var(--accent-success);
}

body.night-theme .header-btn {
    color: var(--text-secondary);
}

body.night-theme .header-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body.night-theme .mobile-menu-btn {
    color: var(--text-secondary);
}

body.night-theme .mobile-menu-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body.night-theme .sidebar-overlay {
    background: rgba(0, 0, 0, 0.6);
}

body.night-theme .CodeMirror {
    background: #0d0a08 !important;
    color: #fef3c7 !important;
}

body.night-theme .CodeMirror-gutters {
    background: #0d0a08 !important;
    border-right: 1px solid var(--border-primary) !important;
}

body.night-theme .CodeMirror-linenumber {
    color: #b45309 !important;
}

body.night-theme .CodeMirror-selected {
    background: rgba(251, 191, 36, 0.2) !important;
}

body.night-theme .CodeMirror-activeline,
body.night-theme .CodeMirror-activeline-background {
    background: rgba(251, 191, 36, 0.05) !important;
}

body.night-theme .sidebar,
body.night-theme .lesson-section,
body.night-theme .lesson-panel,
body.night-theme .output-panel {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
}

body.night-theme .lesson-item {
    color: var(--text-primary);
}

body.night-theme .lesson-item:hover {
    background: var(--bg-hover);
}

body.night-theme .lesson-item.active {
    background: var(--bg-active);
    border-left-color: var(--accent-primary);
    color: var(--text-secondary);
}

body.night-theme .lesson-duration {
    color: var(--text-muted);
}

body.night-theme .lesson-panel-title {
    color: var(--text-primary);
}

body.night-theme .key-point {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

body.night-theme .key-point-icon {
    color: var(--accent-primary);
}

body.night-theme .floating-chat {
    background: var(--bg-primary);
    border-color: var(--border-primary);
}

body.night-theme .floating-chat-header {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.08) 100%);
    border-bottom: 1px solid var(--border-primary);
}

body.night-theme .message.bot-message .message-content {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

body.night-theme .message.user-message .message-content {
    background: var(--accent-primary);
    color: #0f0c08;
}

body.night-theme .floating-chat-input {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-primary);
}

body.night-theme .floating-chat-input textarea {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
}

body.night-theme .floating-chat-input textarea:focus {
    border-color: var(--accent-primary);
    outline: none;
}

body.night-theme .settings-modal {
    background: var(--bg-primary);
}

body.night-theme .setting-group h3 {
    color: var(--text-primary);
}

body.night-theme .setting-item label {
    color: var(--text-secondary);
}

body.night-theme .modal-header h2 {
    color: var(--text-primary);
}

body.night-theme .modal-header .close-modal {
    color: var(--text-secondary);
}

body.night-theme .modal-header .close-modal:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body.night-theme .setting-item small {
    color: var(--text-muted);
}

body.night-theme input[type="password"],
body.night-theme input[type="text"],
body.night-theme select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    color: var(--text-primary);
}

body.night-theme input[type="password"]:focus,
body.night-theme input[type="text"]:focus {
    border-color: var(--accent-primary);
    outline: none;
}

body.night-theme .btn-primary-full {
    background: var(--accent-primary);
    color: #0f0c08;
}

body.night-theme .btn-primary-full:hover {
    background: #d97706;
}

body.night-theme .panel-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
}

body.night-theme .run-btn {
    background: var(--accent-success);
    color: #0f0c08;
}

body.night-theme .run-btn:hover {
    background: #65a30d;
}

body.night-theme .output-content {
    color: var(--text-primary);
    background: #0d0a08;
}

body.night-theme .status-bar {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-primary);
    color: var(--text-secondary);
}

body.night-theme .resize-handle {
    background: var(--border-secondary);
}

body.night-theme .resize-handle:hover {
    background: var(--accent-primary);
}

body.night-theme .welcome-modal {
    background: var(--bg-primary);
}

body.night-theme .welcome-title {
    color: var(--text-primary);
}

body.night-theme .welcome-text {
    color: var(--text-secondary);
}

body.night-theme .welcome-btn-primary {
    background: var(--accent-primary);
    color: #0f0c08;
}

body.night-theme .welcome-btn-secondary {
    color: var(--accent-primary);
}

body.night-theme .theme-option {
    background: var(--bg-tertiary);
    border-color: var(--border-primary);
}

body.night-theme .theme-option.active {
    border-color: var(--accent-primary);
}

/* ============================================
   SYNTAX HIGHLIGHTING - Dark Theme (Default)
   ============================================ */
.CodeMirror .cm-keyword { color: #ff79c6 !important; font-weight: bold !important; }
.CodeMirror .cm-atom { color: #ffb86c !important; }
.CodeMirror .cm-string { color: #50fa7b !important; }
.CodeMirror .cm-string-2 { color: #50fa7b !important; }
.CodeMirror .cm-def { color: #8be9fd !important; }
.CodeMirror .cm-variable { color: #f8f8f2 !important; }
.CodeMirror .cm-variable-2 { color: #f8f8f2 !important; }
.CodeMirror .cm-variable-3 { color: #bd93f9 !important; }
.CodeMirror .cm-property { color: #66d9ef !important; }
.CodeMirror .cm-operator { color: #ff79c6 !important; }
.CodeMirror .cm-comment { color: #6272a4 !important; font-style: italic !important; }
.CodeMirror .cm-number { color: #ffb86c !important; }
.CodeMirror .cm-meta { color: #f1fa8c !important; }
.CodeMirror .cm-qualifier { color: #f1fa8c !important; }
.CodeMirror .cm-builtin { color: #ff79c6 !important; }
.CodeMirror .cm-type { color: #8be9fd !important; }
.CodeMirror .cm-bracket { color: #ffb86c !important; }
.CodeMirror .cm-brace { color: #ff79c6 !important; font-weight: bold !important; }
.CodeMirror .cm-punctuation { color: #f8f8f2 !important; }
.CodeMirror .cm-tag { color: #ff5555 !important; }
.CodeMirror .cm-attribute { color: #50fa7b !important; }
.CodeMirror .cm-hint { color: #bd93f9 !important; }
.CodeMirror .cm-header { color: #ff5555 !important; }
.CodeMirror .cm-link { color: #8be9fd !important; }
.CodeMirror .cm-url { color: #50fa7b !important; }
.CodeMirror .cm-error { color: #ff5555 !important; }
.CodeMirror .cm-special { color: #ff79c6 !important; }
.CodeMirror .cm-invalid { color: #ff5555 !important; }
.CodeMirror .cm-quote { color: #50fa7b !important; }
.CodeMirror .cm-process { color: #f1fa8c !important; }
.CodeMirror .cm-entity { color: #bd93f9 !important; }
.CodeMirror .cm-em { font-style: italic !important; }
.CodeMirror .cm-strong { font-weight: bold !important; }
.CodeMirror .cm-strikethrough { text-decoration: line-through !important; }
.CodeMirror .cm-header { color: #ff79c6 !important; }

.CodeMirror pre, .CodeMirror pre *, .CodeMirror span { 
    color: #f8f8f2 !important; 
}

/* ============================================
   SYNTAX HIGHLIGHTING - Light Theme
   ============================================ */
body.light-theme .CodeMirror .cm-keyword { color: #7c3aed !important; font-weight: bold !important; }
body.light-theme .CodeMirror .cm-atom { color: #b45309 !important; }
body.light-theme .CodeMirror .cm-string { color: #059669 !important; }
body.light-theme .CodeMirror .cm-string-2 { color: #059669 !important; }
body.light-theme .CodeMirror .cm-def { color: #2563eb !important; }
body.light-theme .CodeMirror .cm-variable { color: #1e293b !important; }
body.light-theme .CodeMirror .cm-variable-2 { color: #1e293b !important; }
body.light-theme .CodeMirror .cm-variable-3 { color: #7c3aed !important; }
body.light-theme .CodeMirror .cm-property { color: #0891b2 !important; }
body.light-theme .CodeMirror .cm-operator { color: #7c3aed !important; }
body.light-theme .CodeMirror .cm-comment { color: #94a3b8 !important; font-style: italic !important; }
body.light-theme .CodeMirror .cm-number { color: #b45309 !important; }
body.light-theme .CodeMirror .cm-meta { color: #d97706 !important; }
body.light-theme .CodeMirror .cm-qualifier { color: #d97706 !important; }
body.light-theme .CodeMirror .cm-builtin { color: #7c3aed !important; }
body.light-theme .CodeMirror .cm-type { color: #2563eb !important; }
body.light-theme .CodeMirror .cm-bracket { color: #b45309 !important; }
body.light-theme .CodeMirror .cm-brace { color: #7c3aed !important; font-weight: bold !important; }
body.light-theme .CodeMirror .cm-punctuation { color: #1e293b !important; }
body.light-theme .CodeMirror .cm-tag { color: #dc2626 !important; }
body.light-theme .CodeMirror .cm-attribute { color: #059669 !important; }
body.light-theme .CodeMirror .cm-hint { color: #7c3aed !important; }
body.light-theme .CodeMirror .cm-header { color: #dc2626 !important; }
body.light-theme .CodeMirror .cm-link { color: #2563eb !important; }
body.light-theme .CodeMirror .cm-url { color: #059669 !important; }
body.light-theme .CodeMirror .cm-error { color: #dc2626 !important; }
body.light-theme .CodeMirror .cm-special { color: #7c3aed !important; }
body.light-theme .CodeMirror .cm-invalid { color: #dc2626 !important; }
body.light-theme .CodeMirror .cm-quote { color: #059669 !important; }
body.light-theme .CodeMirror .cm-process { color: #d97706 !important; }
body.light-theme .CodeMirror .cm-entity { color: #7c3aed !important; }
body.light-theme .CodeMirror .cm-em { font-style: italic !important; }
body.light-theme .CodeMirror .cm-strong { font-weight: bold !important; }
body.light-theme .CodeMirror .cm-strikethrough { text-decoration: line-through !important; }
body.light-theme .CodeMirror .cm-header { color: #7c3aed !important; }

body.light-theme .CodeMirror pre, 
body.light-theme .CodeMirror pre *, 
body.light-theme .CodeMirror span { 
    color: #1e293b !important; 
}

/* ============================================
   SYNTAX HIGHLIGHTING - Night/Amber Theme
   ============================================ */
body.night-theme .CodeMirror .cm-keyword { color: #fbbf24 !important; font-weight: bold !important; }
body.night-theme .CodeMirror .cm-atom { color: #fcd34d !important; }
body.night-theme .CodeMirror .cm-string { color: #84cc16 !important; }
body.night-theme .CodeMirror .cm-string-2 { color: #84cc16 !important; }
body.night-theme .CodeMirror .cm-def { color: #fde68a !important; }
body.night-theme .CodeMirror .cm-variable { color: #fef3c7 !important; }
body.night-theme .CodeMirror .cm-variable-2 { color: #fef3c7 !important; }
body.night-theme .CodeMirror .cm-variable-3 { color: #fbbf24 !important; }
body.night-theme .CodeMirror .cm-property { color: #fcd34d !important; }
body.night-theme .CodeMirror .cm-operator { color: #fbbf24 !important; }
body.night-theme .CodeMirror .cm-comment { color: #92400e !important; font-style: italic !important; }
body.night-theme .CodeMirror .cm-number { color: #fcd34d !important; }
body.night-theme .CodeMirror .cm-meta { color: #fde68a !important; }
body.night-theme .CodeMirror .cm-qualifier { color: #fde68a !important; }
body.night-theme .CodeMirror .cm-builtin { color: #fbbf24 !important; }
body.night-theme .CodeMirror .cm-type { color: #fde68a !important; }
body.night-theme .CodeMirror .cm-bracket { color: #fcd34d !important; }
body.night-theme .CodeMirror .cm-brace { color: #fbbf24 !important; font-weight: bold !important; }
body.night-theme .CodeMirror .cm-punctuation { color: #fef3c7 !important; }
body.night-theme .CodeMirror .cm-tag { color: #f87171 !important; }
body.night-theme .CodeMirror .cm-attribute { color: #84cc16 !important; }
body.night-theme .CodeMirror .cm-hint { color: #fbbf24 !important; }
body.night-theme .CodeMirror .cm-header { color: #f87171 !important; }
body.night-theme .CodeMirror .cm-link { color: #fde68a !important; }
body.night-theme .CodeMirror .cm-url { color: #84cc16 !important; }
body.night-theme .CodeMirror .cm-error { color: #f87171 !important; }
body.night-theme .CodeMirror .cm-special { color: #fbbf24 !important; }
body.night-theme .CodeMirror .cm-invalid { color: #f87171 !important; }
body.night-theme .CodeMirror .cm-quote { color: #84cc16 !important; }
body.night-theme .CodeMirror .cm-process { color: #fde68a !important; }
body.night-theme .CodeMirror .cm-entity { color: #fbbf24 !important; }
body.night-theme .CodeMirror .cm-em { font-style: italic !important; }
body.night-theme .CodeMirror .cm-strong { font-weight: bold !important; }
body.night-theme .CodeMirror .cm-strikethrough { text-decoration: line-through !important; }
body.night-theme .CodeMirror .cm-header { color: #fbbf24 !important; }

body.night-theme .CodeMirror pre, 
body.night-theme .CodeMirror pre *, 
body.night-theme .CodeMirror span { 
    color: #fef3c7 !important; 
}
