/*
═══════════════════════════════════════════════════════════════════════════════
FILE: learn-theme.css | LEARN/theme/learn-theme.css
PURPOSE: Universal theme system for all LEARN tutorials
MODIFIED: 2025-12-30
LAYER: LEARN → theme
═══════════════════════════════════════════════════════════════════════════════
*/

/* ═══════════════════════════════════════════════════════════════════════════
   CSS RESET
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════════════════════════════════════
   DARK THEME (DEFAULT)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* Base colors */
    --bg: #050508;
    --surface: #0a0a12;
    --surface-hover: #12121a;
    --text: #e0e0e0;
    --text-muted: #888;
    --heading: #ffffff;
    --border: rgba(100, 255, 218, 0.15);

    /* Accent (tutorials override this) */
    --accent: #64ffda;
    --accent-dim: rgba(100, 255, 218, 0.2);
    --accent-gradient-end: #00ff88;

    /* Canvas & overlays */
    --canvas-bg: #0a0a12;
    --overlay-bg: rgba(0, 0, 0, 0.3);

    /* Partition calculator colors (theme-aware) */
    --partition-efi: #4488ff;
    --partition-root: var(--accent);
    --partition-swap: #44ff88;
    --partition-home: #ffaa44;
    --partition-text: #ffffff;
    --partition-text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT THEME (WCAG AA Compliant)
   ═══════════════════════════════════════════════════════════════════════════ */

:root[data-theme="light"] {
    /* Base colors - high contrast for readability */
    --bg: #FFFFFF;
    --surface: #F8F9FA;
    --surface-hover: #E9ECEF;
    --text: #212529;
    --text-muted: #6C757D;
    --heading: #1A1D20;
    --canvas-bg: #F1F3F5;
    --overlay-bg: rgba(0, 0, 0, 0.1);

    /* Border uses accent with transparency for consistency */
    --border: rgba(0, 0, 0, 0.1);

    /* Partition colors - darker for contrast, keeping accent variable */
    --partition-efi: #1A5FB4;
    --partition-root: var(--accent);
    --partition-swap: #26A269;
    --partition-home: #E66100;
    --partition-text: #FFFFFF;
    --partition-text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT THEME - TERMINAL COLORS
   ═══════════════════════════════════════════════════════════════════════════ */

:root[data-theme="light"] {
    --terminal-green: #26A269;
    --terminal-red: #C01C28;
}

:root[data-theme="light"] .terminal-line {
    color: #26A269;
}

:root[data-theme="light"] .terminal-input {
    color: #1A1D20;
}

:root[data-theme="light"] .main-content pre code {
    color: #26A269;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════════ */

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

/* Headings - Rajdhani */
h1, h2, h3, h4, h5, h6,
.hero h1,
.phase h2,
.lesson-card h3,
.lesson-header h1,
.lesson-header h2,
.section-title,
.control-group label {
    font-family: 'Rajdhani', sans-serif;
    color: var(--heading);
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 2rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }

/* Code - JetBrains Mono */
code, pre,
.terminal,
.terminal-input,
.terminal-output,
.terminal-prompt,
.calc-results,
.terminal-hints code,
.main-content code,
.main-content pre code,
.math-text {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

/* FIX ISSUE 1: Bold text styling */
.main-content strong,
.intuition strong,
.description strong,
.hook strong,
strong {
    font-weight: 600;
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

#app {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════════════════════ */

.hero {
    text-align: center;
    padding: 60px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}

.hero h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-gradient-end, #ffaa44));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.hero .subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 10px;
}

.hero .lesson-count {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE SECTIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.phase {
    margin-bottom: 50px;
}

.phase h2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LESSON CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.lesson-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lesson-card:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.lesson-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 12px;
}

.lesson-card h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    color: var(--heading);
    margin-bottom: 4px;
}

.lesson-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 10px;
}

.badge-terminal {
    background: rgba(68, 255, 136, 0.15);
    color: #44ff88;
}

.badge-calc {
    background: rgba(68, 136, 255, 0.15);
    color: #4488ff;
}

.badge-static {
    background: rgba(255, 170, 68, 0.15);
    color: #ffaa44;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LESSON VIEW
   ═══════════════════════════════════════════════════════════════════════════ */

.lesson-view {
    animation: fadeIn 0.3s ease;
}

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

.lesson-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.lesson-progress {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.back-btn, .nav-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--accent);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.back-btn:hover, .nav-btn:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
}

.lesson-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.lesson-icon-large {
    font-size: 4rem;
}

.phase-badge {
    display: inline-block;
    background: var(--accent-dim);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.lesson-header h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2.5rem;
    color: var(--heading);
    margin-bottom: 0;
}

.lesson-header .subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LESSON CONTENT
   ═══════════════════════════════════════════════════════════════════════════ */

.lesson-content section {
    margin-bottom: 40px;
}

.lesson-content h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.3rem;
    color: var(--accent);
    margin-bottom: 15px;
}

.description p,
.lead {
    font-size: 1.1rem;
    color: var(--text);
}

.intuition {
    background: var(--surface);
    border-left: 3px solid var(--accent);
    padding: 20px;
    border-radius: 0 8px 8px 0;
}

.intuition p {
    color: var(--text);
    font-style: italic;
}

/* Concepts */
.concept-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.concept {
    position: relative;
    cursor: help;
    background: var(--accent-dim);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.concept:hover {
    background: var(--accent);
    color: var(--surface);
}

/* Glossary terms with tooltips */
.glossary-term {
    position: relative;
    color: var(--accent);
    border-bottom: 1px dotted var(--accent);
    cursor: help;
}

/* Tooltip styling */
.glossary-term::after,
.concept[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--accent);
    padding: 8px 12px;
    border-radius: 6px;
    white-space: normal;
    max-width: 250px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    margin-bottom: 8px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-weight: normal;
}

.glossary-term:hover::after,
.concept[data-tooltip]:hover::after {
    opacity: 1;
}

/* Accessibility: show on focus too */
.glossary-term:focus::after,
.concept[data-tooltip]:focus::after {
    opacity: 1;
}

.glossary-term,
.concept[data-tooltip] {
    outline: none;
}

.glossary-term:focus,
.concept[data-tooltip]:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT (MARKDOWN)
   ═══════════════════════════════════════════════════════════════════════════ */

.main-content h2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.4rem;
    color: var(--accent);
    margin: 25px auto 15px;
    max-width: 75ch;
}

.main-content h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    color: var(--text);
    margin: 20px auto 10px;
    max-width: 75ch;
}

.main-content p {
    margin-bottom: 12px;
    color: var(--text);
    max-width: 75ch;
    margin-left: auto;
    margin-right: auto;
}

.main-content ul,
.main-content ol {
    max-width: 75ch;
    margin-left: auto;
    margin-right: auto;
}

.main-content blockquote {
    background: var(--surface);
    border-left: 3px solid var(--accent);
    padding: 15px 20px;
    margin: 15px auto;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-muted);
    max-width: 75ch;
}

.main-content pre {
    background: var(--canvas-bg);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin: 15px auto;
    max-width: 75ch;
}

.main-content pre code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #44ff88;
    background: none;
    padding: 0;
}

.main-content code {
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    color: #44ff88;
}

:root[data-theme="light"] .main-content code {
    color: #26A269;
}

.main-content ul, .main-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.main-content li {
    margin-bottom: 8px;
    color: var(--text);
}

.main-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.main-content td {
    padding: 10px;
    border: 1px solid var(--border);
    color: var(--text);
}

.main-content tr:first-child td {
    background: var(--surface);
    font-weight: 600;
}

.main-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 25px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TERMINAL SECTION
   ═══════════════════════════════════════════════════════════════════════════ */

.terminal-section {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.terminal {
    background: var(--canvas-bg);
    border-radius: 8px;
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    min-height: 300px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
}

.terminal-line {
    white-space: pre-wrap;
    word-break: break-all;
    color: #44ff88;
    line-height: 1.4;
}

.terminal-line.error {
    color: #ff6644;
}

.terminal-input-line {
    display: flex;
    align-items: center;
}

.terminal-prompt {
    color: #44ff88;
    white-space: nowrap;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    caret-color: #44ff88;
}

/* FIX ISSUE 4: Terminal hints alignment */
.terminal-hints {
    margin-top: 15px;
    padding: 12px;
    background: var(--accent-dim);
    border-radius: 6px;
}

.terminal-hints p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.8;
}

.terminal-hints code {
    background: var(--surface);
    padding: 4px 8px;
    margin: 0 4px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    color: #44ff88;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

:root[data-theme="light"] .terminal-hints code {
    color: #26A269;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SPLIT DEMO (TERMINAL + DIAGRAM)
   ═══════════════════════════════════════════════════════════════════════════ */

.split-demo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.terminal-half,
.diagram-half {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.diagram-half h3 {
    text-align: center;
    margin-bottom: 15px;
}

.diagram-half canvas {
    width: 100%;
    height: auto;
    border-radius: 4px;
    background: var(--canvas-bg);
}

@media (max-width: 900px) {
    .split-demo {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CALCULATOR SECTION
   ═══════════════════════════════════════════════════════════════════════════ */

.calculator-section {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.calculator {
    margin-top: 15px;
}

.calc-input {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.calc-input label {
    color: var(--text);
}

.calc-input input {
    background: var(--canvas-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    width: 100px;
}

.calc-input button {
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: opacity 0.2s;
}

.calc-input button:hover {
    opacity: 0.9;
}

.calc-results {
    background: var(--canvas-bg);
    border-radius: 8px;
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
}

/* FIX ISSUE 2: Partition calculator contrast */
.partition-bar {
    display: flex;
    height: 30px;
    border-radius: 4px;
    overflow: hidden;
    margin: 15px 0;
}

.partition-bar div {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--partition-text);
    text-shadow: var(--partition-text-shadow);
}

.partition-efi { background: var(--partition-efi); }
.partition-root { background: var(--partition-root); }
.partition-swap { background: var(--partition-swap); }
.partition-home { background: var(--partition-home); }

/* ═══════════════════════════════════════════════════════════════════════════
   RESOURCES SECTION
   ═══════════════════════════════════════════════════════════════════════════ */

.resources {
    margin: 40px 0;
}

.resources h2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.resource-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
    display: block;
}

.resource-card:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.resource-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.resource-card h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    color: var(--heading);
    margin-bottom: 4px;
}

.resource-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LESSON PROGRESS NAVIGATION (BUBBLES)
   ═══════════════════════════════════════════════════════════════════════════ */

.lesson-progress-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.progress-bubble {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    padding: 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-bubble.completed {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.progress-bubble.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 3px var(--accent-dim);
    transform: scale(1.2);
}

.progress-bubble.future {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}

.progress-bubble:hover {
    transform: scale(1.1);
    border-color: var(--accent);
}

.progress-bubble.current:hover {
    transform: scale(1.2);
}

.progress-line {
    width: 20px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
}

.progress-ellipsis {
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 0 8px;
}

/* Tooltip for bubble navigation */
.progress-bubble::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--accent);
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 0.8rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 8px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.progress-bubble:hover::after {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */

.lesson-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════════
   EXPANDABLE SECTIONS & MODALS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Expandable details/summary for deep dives */
.main-content details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    transition: all 0.3s ease;
}

.main-content details[open] {
    border-color: var(--accent);
    box-shadow: 0 2px 8px var(--accent-dim);
}

.main-content summary {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-content summary::-webkit-details-marker {
    display: none;
}

.main-content summary::before {
    content: '▶';
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.main-content details[open] summary::before {
    transform: rotate(90deg);
}

.main-content summary:hover {
    color: var(--heading);
}

.main-content details .detail-content {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Modal popup system */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border: 2px solid var(--accent);
    border-radius: 12px;
    max-width: 800px;
    max-height: 90vh;
    width: 90%;
    overflow-y: auto;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--accent);
}

.modal-header h2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.8rem;
    color: var(--accent);
    margin: 0;
}

.modal-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--accent);
    color: var(--surface);
    border-color: var(--accent);
}

.modal-body {
    color: var(--text);
    line-height: 1.8;
}

.modal-body p {
    text-align: justify;
    margin-bottom: 16px;
}

/* Info boxes for additional context */
.info-box {
    background: var(--surface);
    border-left: 4px solid var(--accent);
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.info-box.tip {
    border-left-color: #44ff88;
    background: rgba(68, 255, 136, 0.05);
}

.info-box.warning {
    border-left-color: #ffaa44;
    background: rgba(255, 170, 68, 0.05);
}

.info-box.danger {
    border-left-color: #ff6644;
    background: rgba(255, 102, 68, 0.05);
}

.info-box-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .hero h1 { font-size: 2rem; }
    .lesson-header {
        flex-direction: column;
        text-align: center;
    }
    .lesson-icon-large { font-size: 3rem; }
    .terminal { font-size: 12px; min-height: 250px; }
    .calc-input {
        flex-direction: column;
        align-items: stretch;
    }
    .calc-input input { width: 100%; }

    /* Mobile bubble navigation */
    .progress-bubble {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    .progress-line {
        width: 12px;
    }
    .progress-bubble::after {
        left: 0;
        transform: none;
        max-width: 150px;
        font-size: 0.7rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRINT STYLES (for cheat sheet)
   ═══════════════════════════════════════════════════════════════════════════ */

@media print {
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 10pt;
    }

    #theme-toggle, .back-btn, .nav-btn, .lesson-nav, .lesson-footer,
    .terminal-section, .calculator-section, footer, .badge {
        display: none !important;
    }

    #app {
        max-width: 100%;
        padding: 0;
    }

    .hero {
        padding: 20px 0;
        border-bottom: 2px solid #000;
    }

    .hero h1 {
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
        font-size: 24pt;
    }

    .phase h2 {
        color: #000 !important;
        border-bottom: 1px solid #000;
    }

    .lesson-card {
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .lesson-card h3 { color: #000 !important; }

    .resources, .resource-grid { display: none !important; }
}
