/**
 * ShiningBits LMS - Production Design System & Stylesheet
 * Responsive, brandable, high-contrast modern dark/light UI
 * Includes styles for Custom Video Player, Drip Timeline, Admin Tables, and Auth Flows.
 */

:root {
    /* Brand Color Palette */
    --brand-primary: #6366f1;         /* Indigo */
    --brand-primary-hover: #4f46e5;
    --brand-primary-light: #818cf8;
    --brand-accent: #06b6d4;          /* Cyan accent */
    --brand-accent-hover: #0891b2;
    --brand-success: #10b981;         /* Emerald */
    --brand-warning: #f59e0b;         /* Amber */
    --brand-danger: #ef4444;          /* Rose/Red */
    
    /* Surface & Background */
    --bg-app: #0b0f19;                /* Deep Obsidian */
    --bg-surface: #111827;            /* Surface Slate */
    --bg-surface-elevated: #1f2937;   /* Elevated Card */
    --bg-surface-glass: rgba(17, 24, 39, 0.75);
    --border-subtle: #374151;
    --border-highlight: rgba(99, 102, 241, 0.3);

    /* Typography */
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

    /* Radii & Shadows */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 9999px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
}

/* Reset & Global */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand-primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: #a5b4fc;
    text-decoration: underline;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* Layout Utilities */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
    text-decoration: none;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.brand-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    background: rgba(99, 102, 241, 0.15);
    color: var(--brand-primary-light);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(99, 102, 241, 0.3);
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.user-badge {
    background: var(--bg-surface-elevated);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

/* Common Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: var(--brand-primary-hover);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);
    text-decoration: none;
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    border-color: var(--border-subtle);
}

.btn-secondary:hover:not(:disabled) {
    background: #283548;
    border-color: var(--text-muted);
    text-decoration: none;
}

.btn-success {
    background: var(--brand-success);
    color: #ffffff;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-approved {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-locked {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.badge-unlocked {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Forms & Inputs */
.auth-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: radial-gradient(circle at top, rgba(99, 102, 241, 0.12), transparent 60%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-main);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.35rem;
}

.id-preview-box {
    background: rgba(99, 102, 241, 0.08);
    border: 1px dashed rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    padding: 0.875rem;
    margin-bottom: 1.25rem;
}

.id-preview-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
}

.id-preview-row:last-child {
    margin-bottom: 0;
}

.id-preview-label {
    color: var(--text-muted);
}

.id-preview-val {
    font-family: var(--font-mono);
    color: var(--brand-accent);
    font-weight: 600;
}

/* Alerts & Notifications */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.alert-info {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #c7d2fe;
}

/* ==========================================================================
   LANDING PAGE (index.html)
   ========================================================================== */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
    align-items: center;
}

.hero-content h1 {
    font-size: 3.25rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -0.03em;
}

.hero-content h1 span {
    background: linear-gradient(135deg, var(--brand-primary-light), var(--brand-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 2rem auto 5rem auto;
    padding: 0 2rem;
}

.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: transform var(--transition-base), border-color var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-primary);
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.12);
    color: var(--brand-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ==========================================================================
   STUDENT PORTAL & DRIP ENGINE (dashboard.html)
   ========================================================================== */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    max-width: 1440px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Pending Approval State Screen */
.pending-state-container {
    max-width: 640px;
    margin: 4rem auto;
    padding: 3rem 2rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.pending-pulse-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem auto;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.12);
    border: 2px solid rgba(245, 158, 11, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fbbf24;
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px 5px rgba(245, 158, 11, 0.2); }
}

.pending-state-container h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.pending-state-container p {
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    line-height: 1.6;
}

.student-card-info {
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 2rem;
    text-align: left;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.info-item-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-item-val {
    font-size: 0.9375rem;
    font-family: var(--font-mono);
    color: var(--text-main);
    font-weight: 600;
}

/* Active Video Stage */
.video-stage-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.lecture-header-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.lecture-title-box h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.lecture-title-box p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.cohort-chip {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-family: var(--font-mono);
}

/* Curriculum Sidebar */
.curriculum-sidebar {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    position: sticky;
    top: 90px;
    overflow: hidden;
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.sidebar-header p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.curriculum-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Curriculum Lecture Card */
.curriculum-item {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    user-select: none;
}

.curriculum-item:hover:not(.is-locked) {
    border-color: var(--brand-primary);
    background: #253346;
}

.curriculum-item.is-active {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.08);
}

.curriculum-item.is-locked {
    opacity: 0.55;
    cursor: not-allowed;
    background: rgba(17, 24, 39, 0.4);
    border-style: dashed;
}

.item-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.item-order {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
}

.item-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    line-height: 1.35;
}

.item-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   CUSTOM BRANDED VIDEO PLAYER (player.js UI)
   ========================================================================== */
.custom-branded-player-wrapper {
    width: 100%;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000000;
    box-shadow: var(--shadow-lg);
}

.player-surface {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000000;
}

.player-surface.is-fullscreen {
    padding-top: 0;
    height: 100vh;
    width: 100vw;
}

/* Headless IFrame Wrapper */
.player-iframe-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Disables YouTube native clicks/ads */
    transition: opacity 0.2s ease;
}

.player-iframe-container iframe,
.player-iframe-container > div {
    width: 100% !important;
    height: 100% !important;
}

.iframe-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Click Catcher: transparent layer over iframe to capture user clicks */
.player-click-catcher {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 60px); /* Leave controls clickable */
    z-index: 10;
    cursor: pointer;
}

/* Poster Overlay */
.player-poster-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(11, 15, 25, 0.4) 0%, rgba(11, 15, 25, 0.95) 100%), #111827;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.poster-badge {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--brand-accent);
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    margin-bottom: 1rem;
}

.poster-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #ffffff;
    max-width: 680px;
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.poster-desc {
    color: var(--text-muted);
    font-size: 0.9375rem;
    max-width: 500px;
    margin-bottom: 2rem;
}

.poster-play-button {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--brand-primary);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
    transition: transform 0.2s ease, background 0.2s ease;
}

.poster-play-button:hover {
    transform: scale(1.1);
    background: var(--brand-primary-hover);
}

.poster-play-icon {
    margin-left: 4px;
}

.poster-meta {
    position: absolute;
    bottom: 1.5rem;
    left: 2rem;
    right: 2rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-dim);
}

/* Center Pulse Feedback */
.player-pulse-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 25;
    opacity: 0;
}

.pulse-icon {
    width: 64px;
    height: 64px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    backdrop-filter: blur(8px);
}

.pulse-active {
    animation: pulseFade 0.5s ease-out forwards;
}

@keyframes pulseFade {
    0% { transform: scale(0.7); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.9; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* Custom Controls Container */
.player-controls-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    padding: 1.5rem 1.25rem 0.875rem 1.25rem;
    z-index: 20;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.controls-hidden {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

/* Scrubber / Progress Bar */
.player-scrubber {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-pill);
    cursor: pointer;
    margin-bottom: 0.875rem;
    transition: height 0.15s ease;
}

.player-scrubber:hover {
    height: 10px;
}

.scrubber-buffer {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-pill);
    pointer-events: none;
}

.scrubber-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
    border-radius: var(--radius-pill);
    pointer-events: none;
}

.scrubber-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.player-scrubber:hover .scrubber-thumb {
    opacity: 1;
}

/* Control Buttons & Row */
.player-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ctrl-group-left, .ctrl-group-right {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.player-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease, transform 0.15s ease;
}

.player-btn:hover {
    color: var(--brand-primary-light);
    transform: scale(1.08);
}

.player-time-display {
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    color: #d1d5db;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    user-select: none;
}

.time-sep {
    color: var(--text-dim);
}

/* Volume Slider */
.player-volume-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 70px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
}

/* Speed Dropdown */
.speed-control-wrapper {
    position: relative;
}

.text-btn {
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 38px;
}

.speed-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 4px;
    display: flex;
    flex-direction: column;
    min-width: 110px;
    box-shadow: var(--shadow-lg);
    z-index: 50;
}

.speed-dropdown button {
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 6px 12px;
    font-size: 0.8125rem;
    text-align: left;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease;
}

.speed-dropdown button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.speed-dropdown button.active {
    color: var(--brand-accent);
    font-weight: 700;
}

/* Custom Completion End State Overlay */
.player-completion-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.94);
    backdrop-filter: blur(12px);
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.completion-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    text-align: center;
    max-width: 480px;
    box-shadow: var(--shadow-glow);
}

.completion-badge-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem auto;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
    color: var(--brand-success);
    display: flex;
    align-items: center;
    justify-content: center;
}

.completion-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--brand-success);
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

.completion-heading {
    font-size: 1.75rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.completion-subheading {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.completion-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ==========================================================================
   ADMIN DASHBOARD (admin.html)
   ========================================================================== */
.admin-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    width: 100%;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.stat-title {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-main);
}

.table-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
}

.tab-btn {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--brand-primary-light);
    border-bottom-color: var(--brand-primary);
    background: var(--bg-surface);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 1rem 1.25rem;
    background: var(--bg-surface);
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
    padding: 1.125rem 1.25rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.table-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* Config Modal / Setup Banner */
.config-banner {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.2));
    border-bottom: 1px solid var(--border-highlight);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}

.config-banner a, .config-banner button {
    cursor: pointer;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1.5rem;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

/* Helper Utilities */
.hidden {
    display: none !important;
}

.mono {
    font-family: var(--font-mono);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .curriculum-sidebar {
        height: auto;
        max-height: 500px;
        position: static;
    }

    .hero-section {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        padding: 3rem 1.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .navbar {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.75rem;
    }

    .hero-content h1 {
        font-size: 2.25rem;
    }

    .student-card-info {
        grid-template-columns: 1fr;
    }

    .player-volume-wrapper {
        display: none; /* Hide volume slider on mobile, device volume handles it */
    }

    .poster-title {
        font-size: 1.25rem;
    }
}
