/* ═══════════════════════════════════════════════════════════════
   UMWEKA ACADEMY — Lesson Player CSS
═══════════════════════════════════════════════════════════════ */

/* ── Root ──────────────────────────────────────────────────────── */
.lp-body {
    background: var(--dark);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Top Bar ───────────────────────────────────────────────────── */
.lp-topbar {
    height: 56px;
    background: var(--dark-2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 12px;
    flex-shrink: 0;
    z-index: 100;
}

.lp-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.lp-sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.lp-sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,0.07); }

.lp-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.lp-topbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    flex-shrink: 0;
}

.lp-course-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
    transition: color 0.2s;
}
.lp-course-title:hover { color: #fff; }

.lp-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.lp-topbar-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}
.lp-tp-label {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}
.lp-tp-bar {
    width: 100px;
    height: 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 100px;
    overflow: hidden;
}
.lp-tp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #6f42c1);
    border-radius: 100px;
    transition: width 0.5s ease;
}
.lp-tp-pct {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.lp-dash-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s;
    white-space: nowrap;
}
.lp-dash-btn:hover { color: #fff; border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.05); }

/* ── Wrap ──────────────────────────────────────────────────────── */
.lp-wrap {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────────── */
.lp-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: var(--dark-2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.25s ease, transform 0.25s ease;
}
.lp-sidebar.collapsed {
    width: 0;
    border-right: none;
}

.lp-sidebar-head {
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.lp-sidebar-head-title {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
}
.lp-sidebar-head-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.lp-lesson-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.lp-lesson-list::-webkit-scrollbar { width: 4px; }
.lp-lesson-list::-webkit-scrollbar-track { background: transparent; }
.lp-lesson-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.lp-lesson-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    border-left: 2px solid transparent;
    min-width: 0;
}
.lp-lesson-item:hover { background: rgba(255,255,255,0.04); }
.lp-lesson-item.active {
    background: rgba(13,110,253,0.1);
    border-left-color: var(--primary);
}
.lp-lesson-item.done .lp-li-check {
    background: rgba(74,222,128,0.12);
    border-color: rgba(74,222,128,0.3);
    color: #4ade80;
}

.lp-li-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all 0.2s;
    background: rgba(255,255,255,0.03);
}
.lp-lesson-item.active .lp-li-check {
    border-color: rgba(13,110,253,0.5);
    background: rgba(13,110,253,0.15);
    color: #60a5fa;
}
.lp-li-num { font-size: 10px; font-weight: 700; color: var(--text-muted); }

.lp-li-info { flex: 1; min-width: 0; }
.lp-li-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 3px;
    transition: color 0.2s;
}
.lp-lesson-item:hover .lp-li-title,
.lp-lesson-item.active .lp-li-title { color: #fff; }
.lp-lesson-item.done .lp-li-title { color: rgba(255,255,255,0.6); }

.lp-li-meta {
    font-size: 10px;
    color: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    gap: 4px;
}
.lp-li-type-icon { display: flex; align-items: center; color: rgba(255,255,255,0.4); }

/* ── Overlay ───────────────────────────────────────────────────── */
.lp-overlay {
    display: none;
    position: fixed;
    inset: 56px 0 0 0;
    background: rgba(0,0,0,0.6);
    z-index: 50;
}
.lp-overlay.visible { display: block; }

/* ── Main Content ──────────────────────────────────────────────── */
.lp-main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: none;
}
.lp-main.expanded { /* sidebar collapsed */ }

/* ── Player Area ───────────────────────────────────────────────── */
.lp-player {
    background: #000;
    width: 100%;
    position: relative;
    flex-shrink: 0;
}

/* Video player */
.lp-video-wrap {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    background: #000;
    max-height: calc(100vh - 56px - 200px);
}
.lp-video-wrap iframe,
.lp-video-wrap video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* PDF viewer */
.lp-pdf-wrap {
    width: 100%;
    height: calc(100vh - 56px - 140px);
    min-height: 400px;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lp-pdf-frame {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: all; /* allow scroll but not download */
}
.lp-pdf-locked {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.lp-pdf-locked-icon { font-size: 48px; margin-bottom: 16px; }

/* Audio player */
.lp-audio-wrap {
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    background: linear-gradient(135deg, var(--dark-2), var(--dark));
}
.lp-audio-art {
    width: 160px; height: 160px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(13,110,253,0.2), rgba(111,66,193,0.2));
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
}
.lp-audio-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    text-align: center;
}
.lp-audio-player {
    width: 100%;
    max-width: 480px;
    accent-color: var(--primary);
}

/* Quiz placeholder */
.lp-quiz-wrap {
    padding: 48px 32px;
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
}
.lp-quiz-header {
    font-family: 'DM Serif Display', serif;
    font-size: 28px;
    color: #fff;
    margin-bottom: 8px;
}
.lp-quiz-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; }

/* Live placeholder */
.lp-live-wrap {
    padding: 60px 32px;
    text-align: center;
    color: var(--text-muted);
}
.lp-live-icon { font-size: 56px; margin-bottom: 16px; }

/* Generic lesson (no content type matched) */
.lp-content-placeholder {
    padding: 60px 32px;
    text-align: center;
    color: var(--text-muted);
    background: var(--dark-2);
}

/* ── Lesson Info Bar ───────────────────────────────────────────── */
.lp-info-bar {
    background: var(--dark);
    border-top: 1px solid var(--border);
    padding: 20px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.lp-info-left {}
.lp-lesson-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.lp-lesson-type-badge.video  { background: rgba(13,110,253,0.12); color: #60a5fa; }
.lp-lesson-type-badge.audio  { background: rgba(111,66,193,0.12); color: #c084fc; }
.lp-lesson-type-badge.pdf    { background: rgba(245,166,35,0.12);  color: var(--accent); }
.lp-lesson-type-badge.quiz   { background: rgba(74,222,128,0.1);   color: #4ade80; }
.lp-lesson-type-badge.live   { background: rgba(248,113,113,0.1);  color: #f87171; }

.lp-lesson-title-main {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.lp-lesson-duration-label {
    font-size: 12px;
    color: var(--text-muted);
}

.lp-info-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Complete toggle button */
.lp-complete-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Sora', sans-serif;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.lp-complete-btn.mark {
    background: rgba(74,222,128,0.1);
    color: #4ade80;
    border: 1px solid rgba(74,222,128,0.25);
}
.lp-complete-btn.mark:hover {
    background: rgba(74,222,128,0.18);
    border-color: rgba(74,222,128,0.4);
}
.lp-complete-btn.done {
    background: rgba(74,222,128,0.15);
    color: #4ade80;
    border: 1px solid rgba(74,222,128,0.3);
}
.lp-complete-btn.done:hover {
    background: rgba(248,113,113,0.1);
    color: #f87171;
    border-color: rgba(248,113,113,0.25);
}

/* Nav buttons */
.lp-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Sora', sans-serif;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: transparent;
    transition: all 0.2s;
}
.lp-nav-btn:hover { color: #fff; border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.05); }
.lp-nav-btn.next {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(13,110,253,0.25);
}
.lp-nav-btn.next:hover { background: var(--primary-dark); }
.lp-nav-btn:disabled, .lp-nav-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ── Lesson Notes / Description ────────────────────────────────── */
.lp-notes {
    padding: 24px 28px;
    border-top: 1px solid var(--border);
    background: var(--dark);
    flex-shrink: 0;
}
.lp-notes-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}
.lp-notes-body {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.8;
}

/* ── Completion Toast ──────────────────────────────────────────── */
.lp-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--dark-3);
    border: 1px solid rgba(74,222,128,0.3);
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #fff;
    z-index: 999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 360px;
}
.lp-toast.show { transform: translateY(0); opacity: 1; }
.lp-toast-icon { font-size: 22px; flex-shrink: 0; }
.lp-toast-title { font-weight: 700; color: #4ade80; margin-bottom: 2px; }
.lp-toast-sub   { font-size: 12px; color: var(--text-muted); }

/* Course complete celebration */
.lp-celebrate {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 998;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.lp-celebrate.show { display: flex; }
.lp-celebrate-box {
    background: var(--dark-3);
    border: 1px solid rgba(245,166,35,0.3);
    border-radius: 24px;
    padding: 48px 40px;
    text-align: center;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
    animation: pop-in 0.4s ease;
}
@keyframes pop-in {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
.lp-celebrate-emoji { font-size: 64px; margin-bottom: 16px; }
.lp-celebrate-title {
    font-family: 'DM Serif Display', serif;
    font-size: 32px;
    color: #fff;
    margin-bottom: 10px;
}
.lp-celebrate-title em { color: var(--accent); font-style: italic; }
.lp-celebrate-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; line-height: 1.7; }
.lp-celebrate-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Progress bar (inline, within notes) ───────────────────────── */
.lp-course-progress-bar {
    background: rgba(255,255,255,0.07);
    border-radius: 100px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}
.lp-course-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #6f42c1);
    border-radius: 100px;
    transition: width 0.6s ease;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .lp-sidebar {
        position: fixed;
        top: 56px; bottom: 0; left: 0;
        z-index: 60;
        transform: translateX(-100%);
        width: 280px;
        transition: transform 0.25s ease;
    }
    .lp-sidebar:not(.collapsed) {
        transform: translateX(0);
    }
    .lp-sidebar.collapsed {
        width: 280px;
        transform: translateX(-100%);
    }
    .lp-main { margin-left: 0 !important; }
    .lp-course-title { display: none; }
    .lp-topbar-divider { display: none; }
    .lp-tp-bar { width: 60px; }
    .lp-info-bar { padding: 14px 16px; }
    .lp-notes { padding: 16px; }
    .lp-quiz-wrap { padding: 24px 16px; }
    .lp-audio-wrap { padding: 32px 16px; }
}

@media (max-width: 600px) {
    .lp-topbar-progress { display: none; }
    .lp-info-right { flex-wrap: wrap; }
    .lp-lesson-title-main { font-size: 15px; }
}

/* ── Stage 5 additions ──────────────────────────────────────── */

/* Progress header row */
.lp-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}
.lp-progress-label {
    font-size: 12px;
    color: var(--text-muted);
}
.lp-progress-label strong { color: #fff; }

/* About course block inside progress notes */
.lp-about-course {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.lp-about-course-body {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-top: 8px;
}
