/* ══════════════════════════════════════
   COURSE STATUS — Player page
══════════════════════════════════════ */
:root {
    --cst-accent:  #6366f1;
    --cst-dark:    #1e1b4b;
    --cst-green:   #059669;
    --cst-sidebar: #0f0e1a;
}

/* ── Wrapper grid ── */
.cstat-wrapper {
    display: grid;
    grid-template-columns: 1fr 340px;
    min-height: calc(100vh - 72px);
    margin-top: 72px;
    background: #0f0e1a;
}

/* ── Área principal (video + info) ── */
.cstat-main {
    background: #13121f;
    display: flex;
    flex-direction: column;
}

/* Video */
.cstat-video-box {
    width: 100%;
    background: #000;
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}
.cstat-video-box iframe,
.cstat-video-box > * {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    border: none;
}

/* Info panel bajo el video */
.cstat-info {
    padding: 22px 28px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex: 1;
}
.cstat-lesson-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: white;
    margin: 0 0 10px;
    line-height: 1.3;
}
.cstat-lesson-desc {
    font-size: .88rem;
    color: rgba(255,255,255,.55);
    line-height: 1.7;
    margin: 0 0 18px;
}

/* Toggle completado */
.cstat-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    transition: background .18s;
    user-select: none;
}
.cstat-toggle:hover { background: rgba(255,255,255,.09); }
.cstat-toggle-label {
    font-size: .83rem;
    font-weight: 700;
    color: rgba(255,255,255,.7);
}
.cstat-toggle i { font-size: 1.3rem; }
.cstat-toggle i.on  { color: var(--cst-accent); }
.cstat-toggle i.off { color: rgba(255,255,255,.3); }

/* Download */
.cstat-download {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(99,102,241,.12);
    border: 1px solid rgba(99,102,241,.25);
    color: #a5b4fc;
    font-size: .83rem;
    font-weight: 700;
    transition: background .18s;
    text-decoration: none;
}
.cstat-download:hover {
    background: rgba(99,102,241,.22);
    color: #c7d2fe;
    text-decoration: none;
}

/* Navegación prev/next */
.cstat-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-top: 1px solid rgba(255,255,255,.07);
    background: rgba(0,0,0,.25);
}
.cstat-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: .84rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: all .18s;
    border: none;
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.75);
}
.cstat-nav-btn:hover {
    background: rgba(255,255,255,.13);
    color: white;
    text-decoration: none;
}
.cstat-nav-btn.next {
    background: linear-gradient(135deg, var(--cst-accent), #7c3aed);
    color: white;
    box-shadow: 0 4px 14px rgba(99,102,241,.35);
}
.cstat-nav-btn.next:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 20px rgba(99,102,241,.45);
    color: white;
}

/* ── Sidebar ── */
.cstat-sidebar {
    background: var(--cst-sidebar);
    border-left: 1px solid rgba(255,255,255,.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Cabecera del sidebar */
.cstat-sidebar-head {
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}
.cstat-sidebar-course-title {
    font-size: .9rem;
    font-weight: 800;
    color: white;
    margin: 0 0 12px;
    line-height: 1.3;
}

/* Teacher */
.cstat-teacher {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.cstat-teacher-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(99,102,241,.4);
    object-fit: cover;
    flex-shrink: 0;
}

/* Progress bar */
.cstat-progress-label {
    font-size: .72rem;
    color: rgba(255,255,255,.45);
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}
.cstat-progress-label span { color: #a5b4fc; font-weight: 800; }
.cstat-progress-bg {
    height: 6px;
    background: rgba(255,255,255,.1);
    border-radius: 999px;
    overflow: hidden;
}
.cstat-progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--cst-accent), #a78bfa);
    border-radius: 999px;
    transition: width .5s ease;
}

/* Lista de secciones y lecciones */
.cstat-nav-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0 16px;
}
.cstat-nav-list::-webkit-scrollbar { width: 4px; }
.cstat-nav-list::-webkit-scrollbar-track { background: transparent; }
.cstat-nav-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.cstat-section-label {
    padding: 10px 18px 5px;
    font-size: .68rem;
    font-weight: 800;
    color: rgba(255,255,255,.35);
    text-transform: uppercase;
    letter-spacing: .1em;
}

.cstat-lesson-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    cursor: pointer;
    transition: background .12s;
    text-decoration: none;
    border-left: 3px solid transparent;
}
.cstat-lesson-link:hover {
    background: rgba(255,255,255,.05);
    text-decoration: none;
}
.cstat-lesson-link.active {
    background: rgba(99,102,241,.12);
    border-left-color: var(--cst-accent);
}

/* Indicador de estado */
.cstat-dot {
    width: 16px; height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.cstat-dot.done     { background: var(--cst-green); }
.cstat-dot.current  { background: transparent; border: 2px solid var(--cst-accent); }
.cstat-dot.pending  { background: rgba(255,255,255,.15); }
.cstat-dot i        { font-size: .5rem; color: white; }

.cstat-lesson-name {
    font-size: .8rem;
    color: rgba(255,255,255,.55);
    line-height: 1.35;
    flex: 1;
}
.cstat-lesson-link.active .cstat-lesson-name { color: rgba(255,255,255,.9); font-weight: 700; }
.cstat-lesson-link:hover .cstat-lesson-name  { color: rgba(255,255,255,.8); }

/* Quiz items en sidebar */
.cstat-quiz-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    text-decoration: none;
    transition: background .12s;
    border-left: 3px solid transparent;
}
.cstat-quiz-link:hover { background: rgba(255,255,255,.05); text-decoration: none; }
.cstat-quiz-link.approved { border-left-color: var(--cst-green); }
.cstat-quiz-name {
    font-size: .8rem;
    color: rgba(255,255,255,.55);
    flex: 1;
}
.cstat-quiz-link.approved .cstat-quiz-name { color: #6ee7b7; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .cstat-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }
    .cstat-sidebar {
        border-left: none;
        border-top: 1px solid rgba(255,255,255,.07);
        max-height: 420px;
    }
    .cstat-nav-list { max-height: 300px; }
}

@media (max-width: 640px) {
    .cstat-info { padding: 16px 18px; }
    .cstat-lesson-title { font-size: 1.05rem; }
    .cstat-nav { padding: 12px 18px; }
}
