/* ========================================
   CX B2B/B2G — Unit Page Bundle
   Merged: unit-page + rich-content + learning-enhancer
   ======================================== */

/* ========================================
   Unit Detail Pages Styles
   ======================================== */

.unit-page {
    min-height: 100vh;
    background: var(--dark);
    padding-top: 80px;
}

/* Unit Hero */
.unit-hero {
    position: relative;
    padding: 60px 0 80px;
    overflow: hidden;
}

.unit-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.unit-hero[data-phase="foundation"]::before { background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.15) 0%, transparent 60%); }
.unit-hero[data-phase="intermediate"]::before { background: radial-gradient(ellipse at 50% 0%, rgba(6,182,212,0.15) 0%, transparent 60%); }
.unit-hero[data-phase="advanced"]::before { background: radial-gradient(ellipse at 50% 0%, rgba(245,158,11,0.15) 0%, transparent 60%); }
.unit-hero[data-phase="mastery"]::before { background: radial-gradient(ellipse at 50% 0%, rgba(239,68,68,0.15) 0%, transparent 60%); }

.unit-hero .container {
    position: relative;
    z-index: 1;
}

.unit-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.unit-breadcrumb a {
    color: var(--gray);
    text-decoration: none;
    transition: var(--transition);
}

.unit-breadcrumb a:hover { color: var(--primary-light); }
.unit-breadcrumb .sep { color: var(--dark-3); }
.unit-breadcrumb .current { color: var(--primary-light); }

.unit-hero-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: start;
}

.unit-hero-info .unit-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.unit-hero[data-phase="foundation"] .unit-badge { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.unit-hero[data-phase="intermediate"] .unit-badge { background: rgba(6,182,212,0.15); color: var(--secondary); }
.unit-hero[data-phase="advanced"] .unit-badge { background: rgba(245,158,11,0.15); color: var(--accent); }
.unit-hero[data-phase="mastery"] .unit-badge { background: rgba(239,68,68,0.15); color: var(--danger); }

.unit-hero-info h1 {
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--white);
    margin-bottom: 16px;
    line-height: 1.3;
}

.unit-hero-info .unit-desc {
    font-size: 1.1rem;
    color: var(--gray-light);
    margin-bottom: 24px;
    max-width: 650px;
    line-height: 1.8;
}

.unit-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.unit-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray);
    font-size: 0.9rem;
}

.unit-meta-item i {
    color: var(--primary-light);
}

.unit-hero-number {
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
    opacity: 0.15;
}

.unit-hero[data-phase="foundation"] .unit-hero-number { color: var(--primary); }
.unit-hero[data-phase="intermediate"] .unit-hero-number { color: var(--secondary); }
.unit-hero[data-phase="advanced"] .unit-hero-number { color: var(--accent); }
.unit-hero[data-phase="mastery"] .unit-hero-number { color: var(--danger); }

/* Sidebar Layout */
.unit-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    padding: 0 0 80px;
}

/* Sidebar */
.unit-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-left: 20px;
    border-left: 1px solid rgba(99,102,241,0.1);
}

.unit-sidebar::-webkit-scrollbar { width: 3px; }
.unit-sidebar::-webkit-scrollbar-track { background: transparent; }
.unit-sidebar::-webkit-scrollbar-thumb { background: var(--dark-3); border-radius: 3px; }

.sidebar-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
    margin-bottom: 16px;
    font-weight: 600;
}

.sidebar-nav {
    list-style: none;
    margin-bottom: 32px;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--gray-light);
    text-decoration: none;
    font-size: 0.88rem;
    transition: var(--transition);
    border-right: 3px solid transparent;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    color: var(--white);
    background: rgba(99,102,241,0.08);
    border-right-color: var(--primary);
}

.sidebar-nav li a i {
    width: 18px;
    font-size: 0.8rem;
    color: var(--primary-light);
}

.sidebar-units {
    list-style: none;
}

.sidebar-units li a {
    display: block;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--gray);
    text-decoration: none;
    font-size: 0.82rem;
    transition: var(--transition);
    border-right: 2px solid transparent;
}

.sidebar-units li a:hover { color: var(--primary-light); border-right-color: var(--primary); }
.sidebar-units li a.current { color: var(--white); background: rgba(99,102,241,0.1); border-right-color: var(--primary); font-weight: 600; }

/* Unit Content */
.unit-main-content {
    min-width: 0;
}

.content-block {
    margin-bottom: 48px;
    scroll-margin-top: 100px;
}

.content-block h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-block h2 i {
    color: var(--primary-light);
    font-size: 1.2rem;
}

.content-block h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
    margin: 20px 0 12px;
}

.content-block p {
    color: var(--gray-light);
    line-height: 1.9;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

/* Concept Cards */
.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.concept-card {
    background: rgba(30,41,59,0.5);
    border: 1px solid rgba(99,102,241,0.1);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: var(--transition);
}

.concept-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99,102,241,0.25);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.concept-card h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.concept-card h4 .en {
    font-size: 0.8rem;
    color: var(--primary-light);
    font-weight: 400;
}

.concept-card p {
    color: var(--gray);
    font-size: 0.88rem;
    line-height: 1.7;
}

/* Info Box */
.info-box {
    background: rgba(99,102,241,0.08);
    border-right: 4px solid var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 20px 24px;
    margin: 20px 0;
}

.info-box.warning {
    background: rgba(245,158,11,0.08);
    border-right-color: var(--accent);
}

.info-box.success {
    background: rgba(16,185,129,0.08);
    border-right-color: var(--success);
}

.info-box h4 {
    color: var(--white);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box p {
    color: var(--gray-light);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Objectives List */
.objectives-list {
    list-style: none;
    display: grid;
    gap: 12px;
    margin: 16px 0;
}

.objectives-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(30,41,59,0.4);
    border-radius: var(--radius-sm);
    color: var(--gray-light);
    font-size: 0.92rem;
    transition: var(--transition);
}

.objectives-list li:hover {
    background: rgba(30,41,59,0.7);
}

.objectives-list li .obj-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(99,102,241,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary-light);
    font-size: 0.75rem;
    font-weight: 700;
}

/* Steps / Process */
.process-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}

.step-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: rgba(30,41,59,0.4);
    border-radius: var(--radius-md);
    border: 1px solid rgba(99,102,241,0.08);
    transition: var(--transition);
}

.step-item:hover {
    border-color: rgba(99,102,241,0.2);
    background: rgba(30,41,59,0.6);
}

.step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

.step-content h4 {
    color: var(--white);
    margin-bottom: 4px;
}

.step-content p {
    color: var(--gray);
    font-size: 0.88rem;
    margin-bottom: 0;
}

/* Comparison Table */
.comparison-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 20px 0;
}

.comparison-table th {
    background: rgba(99,102,241,0.15);
    color: var(--white);
    padding: 14px 18px;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: right;
}

.comparison-table td {
    background: rgba(30,41,59,0.4);
    color: var(--gray-light);
    padding: 12px 18px;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.comparison-table tr:hover td {
    background: rgba(30,41,59,0.7);
}

/* Practical Exercise */
.exercise-box {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(6,182,212,0.1));
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin: 24px 0;
}

.exercise-box h3 {
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.exercise-box h3 i { color: var(--accent); }

.exercise-box .exercise-steps {
    list-style: none;
    counter-reset: exercise;
}

.exercise-box .exercise-steps li {
    counter-increment: exercise;
    padding: 8px 0;
    color: var(--gray-light);
    font-size: 0.92rem;
    padding-right: 32px;
    position: relative;
}

.exercise-box .exercise-steps li::before {
    content: counter(exercise);
    position: absolute;
    right: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(99,102,241,0.2);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Mini Mind Map */
.unit-mindmap {
    background: rgba(15,23,42,0.6);
    border: 1px solid rgba(99,102,241,0.1);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin: 24px 0;
    text-align: center;
}

.unit-mindmap h3 {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.mini-map {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    position: relative;
}

.mini-map-center {
    padding: 14px 24px;
    border-radius: var(--radius-md);
    background: var(--gradient-1);
    color: var(--white);
    font-weight: 700;
    font-size: 0.95rem;
    width: 100%;
    max-width: 300px;
    margin-bottom: 8px;
}

.mini-map-node {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    background: rgba(30,41,59,0.6);
    border: 1px solid rgba(99,102,241,0.15);
    color: var(--gray-light);
    font-size: 0.85rem;
    transition: var(--transition);
    cursor: default;
}

.mini-map-node:hover {
    border-color: rgba(99,102,241,0.4);
    color: var(--white);
    transform: translateY(-2px);
}

/* Navigation between units */
.unit-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 40px;
}

.unit-nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    background: rgba(30,41,59,0.5);
    border: 1px solid rgba(99,102,241,0.1);
    color: var(--gray-light);
    text-decoration: none;
    transition: var(--transition);
    max-width: 48%;
}

.unit-nav-btn:hover {
    background: rgba(99,102,241,0.1);
    border-color: rgba(99,102,241,0.3);
    color: var(--white);
}

.unit-nav-btn .nav-label {
    font-size: 0.75rem;
    color: var(--gray);
    display: block;
}

.unit-nav-btn .nav-title {
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
}

/* Responsive */
@media (max-width: 1024px) {
    .unit-layout {
        grid-template-columns: 1fr;
    }
    .unit-sidebar {
        position: static;
        max-height: none;
        border-left: none;
        padding-left: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 20px;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(99,102,241,0.1);
    }
    .sidebar-title { width: 100%; }
    .sidebar-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 0; }
    .sidebar-nav li a { padding: 8px 12px; font-size: 0.8rem; border-right: none; border-bottom: 2px solid transparent; }
    .sidebar-nav li a:hover, .sidebar-nav li a.active { border-right: none; border-bottom-color: var(--primary); }
    .sidebar-units { display: none; }
    .unit-hero-info h1 { font-size: 1.8rem; }
}

@media (max-width: 768px) {
    .unit-hero-grid {
        grid-template-columns: 1fr;
    }
    .unit-hero-number { display: none; }
    .unit-hero-info h1 { font-size: 1.6rem; }
    .unit-nav { flex-direction: column; }
    .unit-nav-btn { max-width: 100%; }
    .concept-grid { grid-template-columns: 1fr; }
}

/* ========================================
   Light Theme — Unit Page
   ======================================== */
body.light-theme .unit-hero {
    background: linear-gradient(135deg, rgba(99,102,241,0.06) 0%, rgba(6,182,212,0.04) 100%);
}

body.light-theme .unit-hero h1 {
    color: var(--dark);
}

body.light-theme .unit-hero .unit-desc {
    color: var(--gray);
}

body.light-theme .unit-badge {
    background: rgba(99, 102, 241, 0.08);
    color: #4f46e5;
}

body.light-theme .unit-breadcrumb a {
    color: #64748b;
}

body.light-theme .unit-sidebar {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(99, 102, 241, 0.1);
}

body.light-theme .sidebar-title {
    color: var(--dark);
}

body.light-theme .sidebar-nav li a {
    color: var(--gray);
}

body.light-theme .sidebar-nav li a:hover,
body.light-theme .sidebar-nav li a.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
}

body.light-theme .sidebar-units a {
    color: #64748b;
}

body.light-theme .sidebar-units a.current {
    color: var(--primary);
}

body.light-theme .content-block {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(99, 102, 241, 0.08);
}

body.light-theme .content-block h2 {
    color: var(--dark);
}

body.light-theme .concept-card {
    background: rgba(241, 245, 249, 0.8);
    border-color: rgba(99, 102, 241, 0.1);
}

body.light-theme .concept-card h4 {
    color: var(--dark);
}

body.light-theme .concept-card p {
    color: var(--gray);
}

body.light-theme .unit-nav-btn {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(99, 102, 241, 0.1);
    color: var(--dark-3);
}

body.light-theme .unit-nav-btn:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

body.light-theme .objectives-list li {
    color: var(--dark-3);
}

body.light-theme .exercise-box,
body.light-theme .comparison-table {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(99, 102, 241, 0.1);
}

body.light-theme .comparison-table th {
    background: rgba(99, 102, 241, 0.06);
    color: var(--dark);
}

body.light-theme .comparison-table td {
    border-color: rgba(99, 102, 241, 0.08);
    color: var(--dark-3);
}

body.light-theme .process-step {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(99, 102, 241, 0.1);
}

body.light-theme .takeaway-item {
    background: rgba(241, 245, 249, 0.8);
    color: var(--dark-3);
}

/* === rich-content.css === */
/* ========================================
   Rich Educational Content Styles
   Styles for: lessons, stats, tips, reflection, examples, etc.
   ======================================== */

/* ===== Rich Intro ===== */
.rich-intro-text {
    font-size: 1.05rem;
    color: var(--gray-light);
    line-height: 2;
    margin-bottom: 20px;
    padding: 20px 24px;
    background: rgba(30,41,59,0.3);
    border-radius: var(--radius-md);
    border-right: 3px solid var(--primary-light);
}

.rich-highlight-box {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(6,182,212,0.06));
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: var(--radius-md);
    margin-top: 16px;
}

.rich-highlight-box i {
    color: var(--primary-light);
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.rich-highlight-box p {
    color: var(--gray-light);
    font-size: 0.95rem;
    line-height: 1.9;
    margin: 0;
    font-style: italic;
}

/* ===== Stats Grid ===== */
.rich-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.rich-stat-card {
    background: rgba(30,41,59,0.5);
    border: 1px solid rgba(99,102,241,0.1);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    text-align: center;
    transition: var(--transition);
}

.rich-stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99,102,241,0.3);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.rich-stat-value {
    font-size: 2.4rem;
    font-weight: 900;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    line-height: 1.1;
}

.rich-stat-label {
    color: var(--gray-light);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 8px;
}

.rich-stat-source {
    color: var(--gray);
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ===== Lessons / Accordion ===== */
.rich-lesson {
    background: rgba(30,41,59,0.3);
    border: 1px solid rgba(99,102,241,0.08);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.rich-lesson:hover {
    border-color: rgba(99,102,241,0.2);
}

.rich-lesson.open {
    border-color: rgba(99,102,241,0.3);
    box-shadow: 0 4px 20px rgba(99,102,241,0.1);
}

.rich-lesson-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    cursor: pointer;
    transition: background 0.3s ease;
    user-select: none;
}

.rich-lesson-header:hover {
    background: rgba(99,102,241,0.05);
}

.rich-lesson-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.rich-lesson-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-weight: 700;
    font-size: 1rem;
}

.rich-lesson-title i {
    color: var(--primary-light);
    font-size: 0.9rem;
}

.rich-lesson-arrow {
    color: var(--gray);
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.rich-lesson.open .rich-lesson-arrow {
    transform: rotate(180deg);
    color: var(--primary-light);
}

.rich-lesson-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.3s ease;
    padding: 0 22px;
}

.rich-lesson.open .rich-lesson-body {
    max-height: 5000px;
    padding: 4px 22px 28px;
}

/* ===== Rich Content Blocks ===== */
.rich-paragraph {
    color: var(--gray-light);
    font-size: 0.95rem;
    line-height: 2;
    margin-bottom: 16px;
}

.rich-subheading {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(99,102,241,0.1);
}

/* Keypoint */
.rich-keypoint {
    background: linear-gradient(135deg, rgba(245,158,11,0.06), rgba(245,158,11,0.02));
    border: 1px solid rgba(245,158,11,0.15);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 20px 0;
}

.rich-keypoint-title {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rich-keypoint-title i {
    font-size: 0.85rem;
}

.rich-keypoint p {
    color: var(--gray-light);
    font-size: 0.92rem;
    line-height: 1.9;
    margin: 0;
}

/* Roles Grid */
.rich-roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.rich-role-card {
    background: rgba(30,41,59,0.5);
    border: 1px solid rgba(99,102,241,0.1);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition);
}

.rich-role-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99,102,241,0.25);
}

.rich-role-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.rich-role-card h5 {
    color: var(--white);
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.rich-role-card p {
    color: var(--gray);
    font-size: 0.85rem;
    line-height: 1.8;
    margin: 0;
}

/* Levels */
.rich-levels {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.rich-level-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(30,41,59,0.4);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.rich-level-item:hover {
    background: rgba(30,41,59,0.6);
}

.rich-level-badge {
    padding: 4px 14px;
    border-radius: 50px;
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.rich-level-info h5 {
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.rich-level-info p {
    color: var(--gray);
    font-size: 0.88rem;
    line-height: 1.7;
    margin: 0;
}

/* Metrics */
.rich-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.rich-metric-card {
    background: rgba(30,41,59,0.5);
    border: 1px solid rgba(99,102,241,0.1);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition);
}

.rich-metric-card:hover {
    border-color: rgba(99,102,241,0.25);
}

.rich-metric-card h5 {
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.rich-metric-card p {
    color: var(--gray);
    font-size: 0.88rem;
    line-height: 1.7;
    margin-bottom: 10px;
}

.rich-formula {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(99,102,241,0.08);
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.rich-formula i {
    color: var(--primary-light);
    font-size: 0.8rem;
}

.rich-formula code {
    color: var(--primary-light);
    font-size: 0.82rem;
    font-family: 'Cairo', monospace;
    direction: rtl;
}

/* Example Box */
.rich-example-box {
    background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(6,182,212,0.04));
    border: 1px solid rgba(16,185,129,0.15);
    border-radius: var(--radius-md);
    padding: 24px;
    margin: 20px 0;
}

.rich-example-header {
    color: var(--success);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rich-example-header i {
    font-size: 0.9rem;
}

.rich-example-text {
    color: var(--gray-light);
    font-size: 0.92rem;
    line-height: 1.9;
}

/* Did You Know */
.rich-dyk-box {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    background: rgba(245,158,11,0.06);
    border: 1px solid rgba(245,158,11,0.12);
    border-radius: var(--radius-md);
    margin: 20px 0;
}

.rich-dyk-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.rich-dyk-text {
    color: var(--gray-light);
    font-size: 0.9rem;
    line-height: 1.8;
}

.rich-dyk-text strong {
    color: var(--accent);
}

/* ===== Tips Grid ===== */
.rich-tips-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.rich-tips-do, .rich-tips-dont {
    padding: 24px;
    border-radius: var(--radius-md);
}

.rich-tips-do {
    background: rgba(16,185,129,0.06);
    border: 1px solid rgba(16,185,129,0.15);
}

.rich-tips-dont {
    background: rgba(239,68,68,0.06);
    border: 1px solid rgba(239,68,68,0.15);
}

.rich-tips-do h4 {
    color: var(--success);
    font-size: 1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rich-tips-dont h4 {
    color: var(--danger);
    font-size: 1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rich-tips-do ul, .rich-tips-dont ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rich-tips-do li, .rich-tips-dont li {
    padding: 8px 0;
    color: var(--gray-light);
    font-size: 0.9rem;
    line-height: 1.7;
    padding-right: 20px;
    position: relative;
}

.rich-tips-do li::before {
    content: '✓';
    position: absolute;
    right: 0;
    color: var(--success);
    font-weight: 700;
}

.rich-tips-dont li::before {
    content: '✗';
    position: absolute;
    right: 0;
    color: var(--danger);
    font-weight: 700;
}

/* ===== Reflection Questions ===== */
.rich-reflection-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rich-reflection-item {
    background: rgba(30,41,59,0.4);
    border: 1px solid rgba(99,102,241,0.08);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.rich-reflection-item:hover {
    border-color: rgba(99,102,241,0.2);
}

.rich-reflection-item.open {
    border-color: rgba(99,102,241,0.3);
}

.rich-reflection-q {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    cursor: pointer;
    color: var(--gray-light);
    font-size: 0.93rem;
    line-height: 1.7;
    transition: background 0.3s ease;
}

.rich-reflection-q:hover {
    background: rgba(99,102,241,0.05);
}

.rich-reflection-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(99,102,241,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.rich-reflection-q i {
    color: var(--gray);
    font-size: 0.75rem;
    margin-right: auto;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.rich-reflection-item.open .rich-reflection-q i {
    transform: rotate(180deg);
    color: var(--primary-light);
}

.rich-reflection-hint {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 20px;
    color: var(--gray);
    font-size: 0.88rem;
    line-height: 1.8;
    background: rgba(99,102,241,0.03);
}

.rich-reflection-item.open .rich-reflection-hint {
    max-height: 200px;
    padding: 14px 20px;
}

.rich-reflection-hint i {
    color: var(--accent);
    margin-left: 6px;
}

/* ===== Table Wrapper (scroll on mobile) ===== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== Additional content blocks: checklist, quote ===== */
.rich-checklist {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.rich-checklist li {
    padding: 10px 0;
    color: var(--gray-light);
    font-size: 0.92rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.rich-checklist li i {
    color: var(--success);
    margin-top: 4px;
    flex-shrink: 0;
}

.rich-quote {
    padding: 24px;
    background: rgba(99,102,241,0.05);
    border-right: 4px solid var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 20px 0;
    font-style: italic;
    color: var(--gray-light);
    font-size: 0.95rem;
    line-height: 1.9;
}

.rich-quote cite {
    display: block;
    margin-top: 10px;
    color: var(--gray);
    font-size: 0.82rem;
    font-style: normal;
}

/* ===== Process Flow (visual) ===== */
.rich-process-flow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.rich-process-step {
    background: rgba(30,41,59,0.5);
    border: 1px solid rgba(99,102,241,0.1);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    text-align: center;
    position: relative;
    transition: var(--transition);
}

.rich-process-step:hover {
    transform: translateY(-2px);
    border-color: rgba(99,102,241,0.25);
}

.rich-process-step .step-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.rich-process-step h5 {
    color: var(--white);
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.rich-process-step p {
    color: var(--gray);
    font-size: 0.8rem;
    line-height: 1.6;
    margin: 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .rich-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rich-tips-grid {
        grid-template-columns: 1fr;
    }
    
    .rich-roles-grid {
        grid-template-columns: 1fr;
    }
    
    .rich-metrics {
        grid-template-columns: 1fr;
    }
    
    .rich-stat-value {
        font-size: 1.8rem;
    }
    
    .rich-lesson-header {
        padding: 14px 16px;
    }
    
    .rich-lesson-body {
        padding: 0 16px;
    }
    
    .rich-lesson.open .rich-lesson-body {
        padding: 4px 16px 24px;
    }

    .rich-process-flow {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .rich-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .rich-process-flow {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Light Theme — Rich Content
   ======================================== */
body.light-theme .rich-intro-text {
    color: var(--dark-3);
}

body.light-theme .rich-highlight-box {
    background: linear-gradient(135deg, rgba(99,102,241,0.06) 0%, rgba(6,182,212,0.04) 100%);
    border-color: rgba(99, 102, 241, 0.15);
    color: var(--dark-2);
}

body.light-theme .rich-stat-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(99, 102, 241, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-theme .rich-stat-value {
    color: var(--primary);
}

body.light-theme .rich-stat-label {
    color: var(--dark-3);
}

body.light-theme .rich-stat-source {
    color: var(--gray-light);
}

body.light-theme .rich-lesson {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(99, 102, 241, 0.1);
}

body.light-theme .rich-lesson-header {
    color: var(--dark);
}

body.light-theme .rich-lesson-header:hover {
    background: rgba(99, 102, 241, 0.04);
}

body.light-theme .rich-lesson-num {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
}

body.light-theme .rich-lesson-body {
    color: var(--dark-3);
    border-top-color: rgba(99, 102, 241, 0.08);
}

body.light-theme .rich-paragraph {
    color: var(--gray);
}

body.light-theme .rich-subheading {
    color: var(--dark);
}

body.light-theme .rich-keypoint {
    background: rgba(99, 102, 241, 0.04);
    border-color: rgba(99, 102, 241, 0.12);
}

body.light-theme .rich-keypoint-title {
    color: #4f46e5;
}

body.light-theme .rich-role-card,
body.light-theme .rich-metric-card {
    background: rgba(241, 245, 249, 0.8);
    border-color: rgba(99, 102, 241, 0.08);
}

body.light-theme .rich-role-card h5,
body.light-theme .rich-metric-card h5 {
    color: var(--dark);
}

body.light-theme .rich-role-card p,
body.light-theme .rich-metric-card p {
    color: var(--gray);
}

body.light-theme .rich-level-item {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(99, 102, 241, 0.08);
}

body.light-theme .rich-level-info h5 {
    color: var(--dark);
}

body.light-theme .rich-level-info p {
    color: var(--gray);
}

body.light-theme .rich-example-box {
    background: rgba(16, 185, 129, 0.04);
    border-color: rgba(16, 185, 129, 0.15);
}

body.light-theme .rich-didyouknow {
    background: rgba(245, 158, 11, 0.04);
    border-color: rgba(245, 158, 11, 0.15);
    color: #92400e;
}

body.light-theme .rich-formula code {
    background: rgba(99, 102, 241, 0.06);
    color: #4f46e5;
}

body.light-theme .rich-tips-grid .tip-do,
body.light-theme .rich-tips-grid .tip-dont {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(99, 102, 241, 0.08);
}

body.light-theme .rich-reflection-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(99, 102, 241, 0.08);
}

body.light-theme .rich-reflection-card h5 {
    color: var(--dark);
}

body.light-theme .rich-process-step {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(99, 102, 241, 0.08);
}

body.light-theme .rich-comparison-table th {
    background: rgba(99, 102, 241, 0.06);
    color: var(--dark);
}

body.light-theme .rich-comparison-table td {
    border-color: rgba(99, 102, 241, 0.06);
    color: var(--dark-3);
}

/* === learning-enhancer.css === */
/* ========================================
   Learning Enhancer Styles v1.0
   Covers: Reading Progress, Lesson Tracking, Highlights,
   Key Terms, Checkpoints, Scenarios, Study Timer, TTS
   ======================================== */

/* ===== 1. READING PROGRESS BAR ===== */
.le-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 100001;
    background: rgba(30, 41, 59, 0.3);
    pointer-events: none;
}

.le-reading-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-1, linear-gradient(90deg, #6366f1, #8b5cf6));
    transition: width 0.15s ease-out;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

/* ===== 2. READING TIME BADGE ===== */
.le-reading-time {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 18px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 100px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
    font-family: 'Tajawal', sans-serif;
}

.le-reading-time i {
    color: var(--primary);
    font-size: 0.85rem;
}

.le-reading-time strong {
    color: #a5b4fc;
}

/* ===== 3. LESSON COMPLETION TRACKING ===== */
.le-lesson-check {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: rgba(148, 163, 184, 0.5);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
}

.le-lesson-check:hover {
    color: rgba(99, 102, 241, 0.7);
    transform: scale(1.15);
}

.le-lesson-check.completed {
    color: var(--success);
    animation: le-check-pop 0.4s ease;
}

@keyframes le-check-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Lesson Progress Bar */
.le-lesson-progress-bar {
    margin: 12px 0 24px;
    padding: 16px 20px;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 12px;
}

.le-lpb-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--gray-light, #94a3b8);
}

.le-lpb-info i {
    margin-left: 6px;
    color: var(--primary);
}

.le-lpb-count {
    font-weight: 700;
    color: #a5b4fc;
}

.le-lpb-track {
    height: 6px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 3px;
    overflow: hidden;
}

.le-lpb-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #10b981);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.le-lpb-done {
    margin-top: 10px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--success);
    font-weight: 700;
}

.le-lpb-done i {
    margin-left: 6px;
}

/* ===== 4. TEXT HIGHLIGHTS ===== */
.le-highlight-tooltip {
    position: absolute;
    display: flex;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    z-index: 10000;
    transform: translateX(-50%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
}

.le-ht-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: transparent;
}

.le-ht-btn:hover { transform: scale(1.15); }

.le-ht-btn[data-color="yellow"] { color: #facc15; }
.le-ht-btn[data-color="yellow"]:hover { background: rgba(250, 204, 21, 0.15); }
.le-ht-btn[data-color="green"] { color: var(--success); }
.le-ht-btn[data-color="green"]:hover { background: rgba(16, 185, 129, 0.15); }
.le-ht-btn[data-color="blue"] { color: #60a5fa; }
.le-ht-btn[data-color="blue"]:hover { background: rgba(96, 165, 250, 0.15); }
.le-copy-btn { color: var(--gray-light); }
.le-copy-btn:hover { background: rgba(148, 163, 184, 0.15); }

/* Highlighted text */
.le-highlight {
    padding: 1px 4px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.le-hl-yellow { background: rgba(250, 204, 21, 0.25); color: inherit; }
.le-hl-green { background: rgba(16, 185, 129, 0.2); color: inherit; }
.le-hl-blue { background: rgba(96, 165, 250, 0.2); color: inherit; }

.le-hl-yellow:hover { background: rgba(250, 204, 21, 0.4); }
.le-hl-green:hover { background: rgba(16, 185, 129, 0.35); }
.le-hl-blue:hover { background: rgba(96, 165, 250, 0.35); }

/* ===== 5. KEY TERM POPOVERS ===== */
.le-term-link {
    color: #a5b4fc;
    border-bottom: 1px dashed rgba(165, 180, 252, 0.4);
    cursor: help;
    position: relative;
    transition: color 0.2s ease;
}

.le-term-link:hover {
    color: #818cf8;
    border-bottom-color: #818cf8;
}

.le-term-link::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    right: 50%;
    transform: translateX(50%);
    background: rgba(15, 23, 42, 0.97);
    color: var(--light-2);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.8rem;
    line-height: 1.7;
    width: max-content;
    max-width: 320px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    pointer-events: none;
    font-weight: 400;
}

.le-term-link:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ===== 6. LEARNING CHECKPOINTS ===== */
.le-checkpoint {
    margin: 20px 0;
    padding: 28px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(6, 182, 212, 0.04));
    border: 2px dashed rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    position: relative;
    transition: all 0.3s ease;
}

.le-checkpoint.answered {
    border-style: solid;
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.04), rgba(6, 182, 212, 0.02));
}

.le-checkpoint.correct-answer {
    animation: le-cp-glow 1s ease;
}

@keyframes le-cp-glow {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 20px 5px rgba(16, 185, 129, 0.2); }
    100% { box-shadow: none; }
}

.le-cp-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.le-cp-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.le-cp-label {
    color: var(--white, #f1f5f9);
    font-weight: 700;
    font-size: 0.95rem;
}

.le-cp-sublabel {
    color: var(--gray, #64748b);
    font-size: 0.8rem;
    margin-top: 2px;
}

.le-cp-question {
    color: var(--white, #f1f5f9);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.8;
    margin-bottom: 18px;
    padding-right: 8px;
}

.le-cp-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.le-cp-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--gray-light, #94a3b8);
    font-size: 0.9rem;
    line-height: 1.6;
}

.le-cp-option:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
    color: var(--white, #f1f5f9);
}

.le-cp-option input { display: none; }

.le-cp-radio, .le-cp-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s ease;
    position: relative;
}

.le-cp-checkbox { border-radius: 5px; }

.le-cp-option input:checked ~ .le-cp-radio,
.le-cp-option input:checked ~ .le-cp-checkbox {
    border-color: var(--primary);
    background: #6366f1;
}

.le-cp-option input:checked ~ .le-cp-radio::after,
.le-cp-option input:checked ~ .le-cp-checkbox::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
}

.le-cp-option.correct {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--success);
}

.le-cp-option.wrong {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--danger);
}

.le-cp-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.le-cp-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.le-cp-feedback {
    display: none;
    align-items: flex-start;
    gap: 12px;
    margin-top: 18px;
    padding: 18px 20px;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 12px;
    color: var(--gray-light, #94a3b8);
    font-size: 0.88rem;
    line-height: 1.8;
}

.le-cp-feedback.show { display: flex; }

.le-cp-feedback i {
    color: var(--accent);
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 3px;
}

/* ===== 7. STUDY TIMER ===== */
.le-study-timer {
    position: fixed;
    top: 80px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    z-index: 9999;
    backdrop-filter: blur(10px);
    font-family: 'Tajawal', sans-serif;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.le-study-timer:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.le-st-icon {
    color: var(--primary);
    font-size: 0.85rem;
}

.le-st-time {
    color: var(--light-2);
    font-size: 0.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    min-width: 42px;
    text-align: center;
}

.le-st-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    transition: all 0.2s ease;
    padding: 0;
}

.le-st-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    color: white;
}

/* ===== 8. SCENARIO SIMULATOR ===== */
.le-scenario { }

.le-sc-card {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 16px;
    padding: 28px;
    margin-top: 20px;
}

.le-sc-title {
    color: var(--white, #f1f5f9);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.le-sc-title::before {
    content: '🎭';
    font-size: 1.3rem;
}

.le-sc-text {
    color: var(--gray-light, #94a3b8);
    font-size: 0.95rem;
    line-height: 2;
    padding: 20px;
    background: rgba(99, 102, 241, 0.04);
    border-radius: 12px;
    border-right: 3px solid #6366f1;
    margin-bottom: 24px;
}

.le-sc-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.le-sc-choice {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--gray-light, #94a3b8);
    font-family: 'Tajawal', sans-serif;
    font-size: 0.92rem;
    line-height: 1.7;
    text-align: right;
    width: 100%;
}

.le-sc-choice:hover:not(.disabled) {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--white, #f1f5f9);
    transform: translateX(-4px);
}

.le-sc-num {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
}

.le-sc-choice.disabled { pointer-events: none; opacity: 0.6; }
.le-sc-choice.selected-good { border-color: var(--success); background: rgba(16, 185, 129, 0.1); opacity: 1; color: var(--success); }
.le-sc-choice.selected-bad { border-color: var(--danger); background: rgba(239, 68, 68, 0.1); opacity: 1; color: var(--danger); }
.le-sc-choice.selected-neutral { border-color: var(--accent); background: rgba(245, 158, 11, 0.1); opacity: 1; color: var(--accent); }

.le-sc-result {
    margin-top: 24px;
    animation: le-fade-in 0.5s ease;
}

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

.le-sc-score {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.le-sc-good { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.2); }
.le-sc-bad { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.2); }
.le-sc-neutral { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.2); }

.le-sc-score-num {
    font-size: 2rem;
    font-weight: 900;
    direction: ltr;
}

.le-sc-good .le-sc-score-num { color: var(--success); }
.le-sc-bad .le-sc-score-num { color: var(--danger); }
.le-sc-neutral .le-sc-score-num { color: var(--accent); }

.le-sc-score-label {
    color: var(--gray-light, #94a3b8);
    font-size: 0.95rem;
    font-weight: 600;
}

.le-sc-feedback {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
    background: rgba(99, 102, 241, 0.04);
    border-radius: 12px;
    margin-bottom: 16px;
}

.le-sc-feedback i {
    color: var(--primary);
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 3px;
}

.le-sc-feedback p {
    color: var(--gray-light, #94a3b8);
    font-size: 0.9rem;
    line-height: 1.9;
    margin: 0;
}

.le-sc-all-scores {
    padding: 16px 20px;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 12px;
}

.le-sc-all-scores strong {
    color: var(--gray, #64748b);
    font-size: 0.82rem;
    display: block;
    margin-bottom: 10px;
}

.le-sc-alt {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 0.82rem;
    color: var(--gray, #64748b);
}

.le-sc-alt.chosen {
    background: rgba(99, 102, 241, 0.06);
    color: var(--gray-light, #94a3b8);
    font-weight: 600;
}

.le-sc-alt-score {
    font-weight: 800;
    font-size: 0.85rem;
    direction: ltr;
    min-width: 50px;
    text-align: center;
    padding: 2px 8px;
    border-radius: 6px;
}

.le-sc-alt-score.le-sc-good { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.le-sc-alt-score.le-sc-bad { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.le-sc-alt-score.le-sc-neutral { background: rgba(245, 158, 11, 0.1); color: var(--accent); }

/* ===== 9. TEXT-TO-SPEECH BUTTON ===== */
.le-tts-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.le-tts-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    color: white;
    transform: scale(1.1);
}

.le-tts-btn.playing {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    animation: le-tts-pulse 1.5s infinite;
}

@keyframes le-tts-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2); }
    50% { box-shadow: 0 0 8px 3px rgba(239, 68, 68, 0.15); }
}

/* ===== 10. TOAST NOTIFICATION ===== */
.le-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 23, 42, 0.95);
    color: var(--light-2);
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-family: 'Tajawal', sans-serif;
    z-index: 200000;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.le-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   LIGHT THEME OVERRIDES
   ======================================== */
body.light-theme .le-reading-progress {
    background: rgba(226, 232, 240, 0.5);
}

body.light-theme .le-reading-time {
    background: rgba(99, 102, 241, 0.08);
    color: var(--gray);
}

body.light-theme .le-reading-time strong {
    color: var(--primary);
}

body.light-theme .le-lesson-check {
    color: rgba(148, 163, 184, 0.6);
}

body.light-theme .le-lesson-check.completed {
    color: #059669;
}

body.light-theme .le-lesson-progress-bar {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.1);
}

body.light-theme .le-lpb-count { color: var(--primary); }
body.light-theme .le-lpb-track { background: var(--light-2); }

body.light-theme .le-highlight-tooltip {
    background: rgba(255, 255, 255, 0.97);
    border-color: var(--light-2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

body.light-theme .le-term-link {
    color: var(--primary);
    border-bottom-color: rgba(99, 102, 241, 0.3);
}

body.light-theme .le-term-link::after {
    background: rgba(255, 255, 255, 0.98);
    color: var(--dark-3);
    border-color: var(--light-2);
}

body.light-theme .le-checkpoint {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.04), rgba(6, 182, 212, 0.02));
    border-color: rgba(99, 102, 241, 0.15);
}

body.light-theme .le-checkpoint.answered {
    border-color: rgba(16, 185, 129, 0.25);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.03), rgba(6, 182, 212, 0.01));
}

body.light-theme .le-cp-question { color: var(--dark-2); }
body.light-theme .le-cp-option {
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--light-2);
    color: var(--gray);
}
body.light-theme .le-cp-option:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--dark-2);
}

body.light-theme .le-cp-feedback {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.12);
    color: var(--gray);
}

body.light-theme .le-study-timer {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--light-2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

body.light-theme .le-st-time { color: var(--dark-2); }

body.light-theme .le-sc-card {
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--light-2);
}

body.light-theme .le-sc-text {
    background: rgba(99, 102, 241, 0.03);
    color: var(--gray);
}

body.light-theme .le-sc-choice {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--light-2);
    color: var(--gray);
}

body.light-theme .le-sc-choice:hover:not(.disabled) {
    background: rgba(99, 102, 241, 0.05);
    color: var(--dark-2);
}

body.light-theme .le-sc-feedback {
    background: rgba(99, 102, 241, 0.03);
}

body.light-theme .le-sc-feedback p { color: var(--gray); }

body.light-theme .le-sc-all-scores {
    background: rgba(241, 245, 249, 0.7);
}

body.light-theme .le-toast {
    background: rgba(255, 255, 255, 0.97);
    color: var(--dark-2);
    border-color: var(--light-2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .le-study-timer {
        top: auto;
        bottom: 74px;
        left: 50%;
        transform: translateX(-50%);
        padding: 6px 12px;
    }

    .le-st-time { font-size: 0.8rem; }

    .le-checkpoint { padding: 20px; }
    .le-cp-question { font-size: 0.95rem; }
    .le-cp-option { padding: 12px 14px; font-size: 0.85rem; }

    .le-sc-card { padding: 20px; }
    .le-sc-text { padding: 14px; font-size: 0.88rem; }
    .le-sc-choice { padding: 12px 16px; font-size: 0.85rem; }
    .le-sc-score-num { font-size: 1.5rem; }

    .le-term-link::after {
        max-width: 260px;
        right: 0;
        transform: none;
    }

    .le-highlight-tooltip {
        position: fixed;
        bottom: 80px;
        top: auto;
        left: 50%;
    }
}

@media (max-width: 480px) {
    .le-reading-time { font-size: 0.75rem; padding: 6px 12px; }
    .le-sc-score { flex-direction: column; text-align: center; }
}

/* ========================================
   PRINT
   ======================================== */
@media print {
    .le-reading-progress,
    .le-study-timer,
    .le-highlight-tooltip,
    .le-tts-btn,
    .le-lesson-check,
    .le-cp-submit,
    .le-toast { display: none !important; }

    .le-checkpoint { border-style: solid; page-break-inside: avoid; }
    .le-sc-card { page-break-inside: avoid; }
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .le-reading-fill,
    .le-lpb-fill,
    .le-highlight,
    .le-cp-option,
    .le-sc-choice,
    .le-sc-result {
        transition: none !important;
        animation: none !important;
    }
}
