/* ================================================
   LESSON MODAL — Full Content Display
   ================================================ */

.lesson-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(12px);
    padding: 1.5rem;
}
.lesson-modal-overlay.open {
    display: flex;
    animation: fadeInModal 0.25s ease;
}
@keyframes fadeInModal { from { opacity: 0; } to { opacity: 1; } }

.lesson-modal {
    width: 860px;
    max-width: 98vw;
    max-height: 90vh;
    background: rgba(12, 14, 22, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    animation: slideUpModal 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
@keyframes slideUpModal {
    from { opacity: 0; transform: translateY(40px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal Header */
.lm-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    flex-shrink: 0;
}
.lm-header-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    flex-shrink: 0;
}
.lm-header-meta { flex: 1; }
.lm-breadcrumb {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.lm-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.3rem; }
.lm-subtitle { font-size: 0.88rem; color: var(--text-muted); }
.lm-close-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}
.lm-close-btn:hover { background: rgba(255,255,255,0.15); color: white; }

/* Modal Nav Tabs (sections within lesson) */
.lm-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 0 2rem;
    flex-shrink: 0;
    overflow-x: auto;
}
.lm-nav-btn {
    padding: 0.8rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
    background: none;
    border-top: none; border-left: none; border-right: none;
}
.lm-nav-btn:hover { color: var(--text-main); }
.lm-nav-btn.active {
    color: var(--text-main);
    border-bottom-color: var(--primary-color);
}

/* Modal Scrollable Body */
.lm-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.lm-body::-webkit-scrollbar { width: 6px; }
.lm-body::-webkit-scrollbar-track { background: transparent; }
.lm-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.lm-section { display: none; }
.lm-section.active { display: flex; flex-direction: column; gap: 1.5rem; }

/* Objective Box */
.lm-objective {
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid rgba(0, 210, 255, 0.25);
    border-radius: var(--border-radius-md);
    padding: 1.2rem 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.lm-objective-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 0.1rem; }
.lm-objective-text h4 { font-size: 0.95rem; margin-bottom: 0.4rem; color: var(--accent-blue); }
.lm-objective-text p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; }

/* Theory Block */
.lm-theory {
    background: rgba(255,255,255,0.03);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    border: 1px solid rgba(255,255,255,0.06);
}
.lm-theory h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.lm-theory h4 i { color: var(--primary-color); }
.lm-theory p, .lm-theory li {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 0.5rem;
}
.lm-theory ul { padding-left: 1.2rem; }
.lm-theory strong { color: var(--text-main); }

/* Step-by-step */
.lm-steps { display: flex; flex-direction: column; gap: 1rem; }
.lm-step {
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
    padding: 1.2rem;
    background: rgba(255,255,255,0.03);
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255,255,255,0.05);
    transition: var(--transition-fast);
}
.lm-step:hover { background: rgba(138,43,226,0.08); border-color: rgba(138,43,226,0.3); }
.lm-step-num {
    width: 36px; height: 36px;
    background: var(--grad-primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.lm-step-content h5 { font-size: 0.95rem; margin-bottom: 0.3rem; }
.lm-step-content p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }
.lm-step-tip {
    margin-top: 0.5rem;
    background: rgba(0,255,136,0.08);
    border-left: 3px solid var(--accent-green);
    padding: 0.5rem 0.8rem;
    border-radius: 0 6px 6px 0;
    font-size: 0.82rem;
    color: var(--accent-green);
}

/* Exercise Block */
.lm-exercise {
    background: linear-gradient(135deg, rgba(138,43,226,0.12), rgba(0,210,255,0.08));
    border: 1px solid rgba(138,43,226,0.3);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
}
.lm-exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.lm-exercise-header h4 { font-size: 1rem; display: flex; gap: 0.5rem; align-items: center; }
.lm-exercise-header h4 i { color: var(--accent-pink); }
.lm-exercise-xp {
    background: linear-gradient(135deg, #f6d365, #fda085);
    color: #000;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
}
.lm-exercise p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}
.lm-exercise-items { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.lm-exercise-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 1rem;
    background: rgba(255,255,255,0.04);
    border-radius: var(--border-radius-sm);
    font-size: 0.88rem;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.06);
    transition: var(--transition-fast);
}
.lm-exercise-item:hover { background: rgba(255,255,255,0.08); }
.lm-exercise-item.checked { background: rgba(0,255,136,0.1); border-color: rgba(0,255,136,0.3); }
.lm-exercise-item.checked .excheck { background: var(--accent-green); border-color: var(--accent-green); }
.lm-exercise-item.checked .excheck::after { content: '✓'; color: #000; font-weight: 800; }
.excheck {
    width: 22px; height: 22px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

/* Tips Grid */
.lm-tips-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}
.lm-tip-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}
.lm-tip-icon { font-size: 1.3rem; flex-shrink: 0; }
.lm-tip-card h5 { font-size: 0.88rem; margin-bottom: 0.2rem; }
.lm-tip-card p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }

/* Progress Bar in Modal */
.lm-progress-section { margin-top: 0.5rem; }
.lm-progress-label {
    display: flex; justify-content: space-between;
    font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.5rem;
}
.lm-progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.07);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.3rem;
}
.lm-progress-fill {
    height: 100%;
    background: var(--grad-primary);
    border-radius: 4px;
    transition: width 1s ease;
}

/* Video Placeholder */
.lm-video-placeholder {
    width: 100%;
    height: 240px;
    background: rgba(0,0,0,0.4);
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}
.lm-video-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(138,43,226,0.15), transparent 70%);
}
.lm-video-play-btn {
    width: 64px; height: 64px;
    background: rgba(138,43,226,0.3);
    border: 2px solid rgba(138,43,226,0.6);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
}
.lm-video-play-btn:hover { background: var(--primary-color); transform: scale(1.08); }

/* Modal Footer */
.lm-footer {
    padding: 1.2rem 2rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.lm-footer-info { font-size: 0.82rem; color: var(--text-muted); }
.lm-footer-actions { display: flex; gap: 0.8rem; }

/* Highlight text */
.lm-highlight {
    display: inline-block;
    background: rgba(138,43,226,0.15);
    color: var(--primary-color);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9em;
}

/* Warning box */
.lm-warning {
    background: rgba(255,154,0,0.1);
    border: 1px solid rgba(255,154,0,0.3);
    border-radius: var(--border-radius-sm);
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}
.lm-warning i { color: #ff9a00; flex-shrink: 0; margin-top: 0.1rem; }
.lm-warning span { color: var(--text-muted); line-height: 1.5; }

/* Scale visual */
.lm-scale-display {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    padding: 1rem;
    background: rgba(0,0,0,0.3);
    border-radius: var(--border-radius-sm);
    justify-content: center;
    flex-wrap: wrap;
}
.lm-scale-note {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    transition: var(--transition-fast);
}
.lm-scale-note:hover .note-key { background: var(--primary-color); transform: translateY(-4px); }
.note-key {
    width: 44px; height: 70px;
    background: linear-gradient(180deg, #c8c8c8, #fff);
    border-radius: 0 0 6px 6px;
    border: 1px solid #aaa;
    display: flex; flex-direction: column; justify-content: flex-end;
    align-items: center; padding-bottom: 4px;
    transition: var(--transition-fast);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.note-key span { font-size: 0.65rem; font-weight: 700; color: rgba(0,0,0,0.6); }
.note-label { font-size: 0.75rem; font-weight: 700; }
.note-sol { font-size: 0.68rem; color: var(--text-muted); }

/* Checklist completion */
.lm-completion-bar {
    background: rgba(255,255,255,0.05);
    border-radius: var(--border-radius-sm);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.lm-completion-bar .progress-track { flex: 1; }
.lm-completion-pct { font-family: var(--font-heading); font-weight: 800; font-size: 1.2rem; color: var(--accent-green); white-space: nowrap; }
