:root {
    --bb-bg-dark: #121212;
    --bb-card-bg: #1e1e1e;
    --bb-primary: #0d6efd;
    /* Placeholder Blue */
    --bb-text-main: #E2E8F0;
    /* Soft, cool grey-white */
    --bb-text-muted: #a0a0a0;
}

body {
    background-color: var(--bb-bg-dark);
    color: var(--bb-text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ... existing navbar styles ... */

/* Lesson View Redesign */
:root {
    --bb-bg-slate: #1E293B;
    --bb-text-reading: #E2E8F0;
    --bb-accent-gold: #FFD700;
}

.lesson-content-card {
    --paper-bg: #1E293B;
    /* Default Dark Slate */
    --paper-text: #E2E8F0;
    /* Default Light Grey */
    --paper-ui: #94A3B8;
    /* Default Icon Color */

    background-color: var(--paper-bg);
    color: var(--paper-text);
    transition: background-color 0.3s, color 0.3s;
    border-radius: 1rem;
}

.lesson-content-card.theme-light {
    --paper-bg: #FFFFFF;
    --paper-text: #1E293B;
    /* Dark Slate text */
    --paper-ui: #475569;
    /* Darker icons */
}

.lesson-content-card.theme-sepia {
    --paper-bg: #F8F1E3;
    /* Warm Cream */
    --paper-text: #2c241b;
    /* Very Dark Coffee Text */
    --paper-ui: #8C7B70;
    /* Muted Brown for icons/borders */
}

.lesson-text-container {
    --reading-font-sz: 1.15rem;
    /* Default */
    max-width: 68ch;
    /* Golden Ratio */
    margin: 0 auto;
    padding: 3rem 4rem;
}

@media (max-width: 768px) {
    .lesson-text-container {
        padding: 1.5rem;
    }
}

/* Study Mode Styling */
.lesson-content {
    --reading-font-family: 'Merriweather', serif;
    /* Default */
    font-family: var(--reading-font-family);
    font-weight: 300;
    font-size: var(--reading-font-sz);
    line-height: 1.9;
    color: var(--paper-text);
    /* Use variable */
}

.navbar {
    background-color: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: auto;
    /* Allow it to shrink to the content size */
}

.reader-toolbar {
    position: sticky;
    top: 0;
    background-color: var(--paper-bg);
    /* Use variable */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    /* Changed to space-between */
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
    margin-bottom: 0;
    transition: background-color 0.3s;
    /* Removed margin to sit flush if needed, or keep it */
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

/* Removed progress bar styles */

.btn-reader {
    background: transparent;
    border: 1px solid var(--paper-ui);
    /* Use variable */
    color: var(--paper-ui);
    /* Use variable */
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-reader:hover {
    border-color: var(--paper-text);
    color: var(--paper-text);
    background-color: rgba(125, 125, 125, 0.1);
}

.lesson-text-container h1 {
    font-family: 'Inter', sans-serif;
    color: var(--paper-text);
    /* Use variable */
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: calc(var(--reading-font-sz) * 2.2);
    line-height: 1.2;
}

.lesson-text-container h5 {
    font-family: 'Inter', sans-serif;
    color: var(--paper-ui);
    /* Use variable */
    /* Slate-400 */
    margin-bottom: 2rem;
    font-weight: 600;
    font-size: calc(var(--reading-font-sz) * 1.1);
    line-height: 1.2;
}

.lesson-content h2,
.lesson-content h3 {
    font-family: 'Inter', sans-serif;
    color: var(--paper-text);
    /* Use variable */
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.callout-box {
    background-color: #2D3748;
    border-left: 4px solid var(--bb-primary);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0.25rem;
}



.sidebar-lesson-item {
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-lesson-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

.sidebar-lesson-item.active {
    background-color: rgba(13, 110, 253, 0.2) !important;
    /* Semi-transparent blue */
    border-left: 3px solid var(--bb-primary);
}

.sidebar-lesson-item.completed {
    opacity: 0.6;
}

.btn-next-lesson {
    transition: transform 0.2s;
}

.btn-next-lesson:hover {
    transform: translateY(-2px);
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

/* Fix for Font Size Adjustment in Toast UI Viewer */
.lesson-content .toastui-editor-contents,
.lesson-content .toastui-editor-contents p,
.lesson-content .toastui-editor-contents li,
.lesson-content .toastui-editor-contents span {
    font-size: var(--reading-font-sz) !important;
}

/* Fix for Light/Sepia Mode Text Visibility in Toast UI Viewer */
.lesson-content-card.theme-light .toastui-editor-contents,
.lesson-content-card.theme-light .toastui-editor-contents *,
.lesson-content-card.theme-sepia .toastui-editor-contents,
.lesson-content-card.theme-sepia .toastui-editor-contents * {
    color: var(--paper-text) !important;
}

/* Allow the font-family variable to override Toast UI defaults */
#lesson-viewer .toastui-editor-contents,
#lesson-viewer .toastui-editor-contents * {
    font-family: var(--reading-font-family, 'Merriweather', serif) !important;
}

/* Glossary Highlighting */
.glossary-highlight {
    text-decoration: underline wavy #a0a0a0;
    /* Grey squiggly line */
    text-decoration-thickness: 2px;
    cursor: pointer;
    color: inherit;
    /* Keep text color same as paragraph */
    transition: color 0.2s ease;
}

.glossary-highlight:hover {
    color: #0d6efd;
    /* Turn blue on hover */
}