/* ==========================================================================
   ICICI PO Learning & Assessment Platform - Master Design System
   Sleek Dark Theme with Glassmorphism, Vibrant Gradients & Micro-Animations
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-base: #070913;
    --bg-surface: #0e1322;
    --bg-surface-elevated: #151c32;
    --bg-glass: rgba(15, 23, 42, 0.75);
    --bg-glass-card: rgba(30, 41, 59, 0.45);
    --bg-input: rgba(10, 15, 29, 0.85);

    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-mid: rgba(255, 255, 255, 0.14);
    --border-focus: #6366f1;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* Accents */
    --accent-indigo: #6366f1;
    --accent-violet: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-sky: #38bdf8;
    --accent-rose: #f43f5e;
    --accent-amber: #f59e0b;
    --accent-emerald: #10b981;

    --status-success: #10b981;
    --status-warning: #f59e0b;
    --status-danger: #ef4444;

    /* Typography */
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Radius & Spacing */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --player-height: 74px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.dark-theme {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.has-bottom-player {
    padding-bottom: var(--player-height);
}

/* Glass Panel Utility */
.glass-panel {
    background: var(--bg-glass-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

/* ================= TOP HEADER ================= */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
    background: rgba(7, 9, 19, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 20px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-badge {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
}

.brand-meta h2 {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #fff;
}

.brand-meta h2 span {
    background: linear-gradient(135deg, #a5b4fc, var(--accent-sky));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-meta .sub-tag {
    font-size: 0.65rem;
    color: var(--text-dim);
    display: block;
}

/* Navigation Tabs */
.header-center {
    display: flex;
    align-items: center;
}

.nav-tabs {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    gap: 4px;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.nav-tab.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.15));
    color: #fff;
    border: 1px solid rgba(99, 102, 241, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.live-pulse-badge {
    padding: 2px 6px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--status-danger);
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: var(--radius-full);
}

/* Header User Zone */
.header-user-zone {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
}

.user-avatar-sm {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-violet));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-text-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.user-role-tag {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--accent-cyan);
    text-transform: uppercase;
    font-family: var(--font-mono);
}

.user-name-text {
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ================= BUTTONS ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-xs { padding: 4px 8px; font-size: 0.72rem; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-md { padding: 8px 16px; font-size: 0.88rem; }
.btn-lg { padding: 12px 20px; font-size: 0.95rem; }

.btn-block { width: 100%; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-violet));
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #7175f3, #9d74f7);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: var(--border-mid);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border-subtle);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: var(--border-mid);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-emerald), #059669);
    color: #fff;
}
.btn-success:hover {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-danger);
    border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: var(--status-danger);
    color: #fff;
}

.btn-glow {
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

/* ================= SPA VIEWS ================= */
.app-main-viewport {
    padding: 24px;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

.spa-view {
    display: none;
    animation: fadeIn 0.25s ease-out forwards;
}

.spa-view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================= VIEW 1: LOGIN ================= */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 160px);
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 32px;
    border: 1px solid var(--border-mid);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6);
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--accent-sky);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.login-header h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}

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

.quick-login-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
}

.quick-pill {
    padding: 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-pill:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.quick-pill.active {
    background: rgba(99, 102, 241, 0.18);
    border-color: var(--accent-indigo);
    color: #fff;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    height: 42px;
    background: var(--bg-input);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-md);
    padding: 0 14px;
    color: #fff;
    font-size: 0.88rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-group input:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.login-credentials-hint {
    margin-top: 20px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.login-credentials-hint code {
    color: var(--accent-sky);
    font-family: var(--font-mono);
}

/* ================= VIEW 2: LEARNER WORKSPACE ================= */
.learner-sub-view {
    display: none;
}
.learner-sub-view.active {
    display: block;
}

.learner-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 20px;
    flex-wrap: wrap;
}

.dash-greeting h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.4px;
}

.dash-greeting p {
    font-size: 0.84rem;
    color: var(--text-muted);
    max-width: 680px;
}

.dash-search-bar {
    position: relative;
    width: 320px;
}

.dash-search-bar svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

.dash-search-bar input {
    width: 100%;
    height: 38px;
    background: var(--bg-surface);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-full);
    padding: 0 14px 0 36px;
    color: #fff;
    font-size: 0.8rem;
    outline: none;
    transition: all 0.2s ease;
}

.dash-search-bar input:focus {
    border-color: var(--accent-sky);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title-row h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.badge-pill {
    padding: 3px 10px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--accent-sky);
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
}

/* Breadcrumbs */
.learner-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.82rem;
}

.breadcrumb-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--accent-sky);
    font-weight: 600;
    cursor: pointer;
}

.breadcrumb-btn:hover {
    text-decoration: underline;
}

.bc-sep { color: var(--text-dim); }
.bc-course { color: #fff; font-weight: 600; }
.bc-module { color: var(--text-muted); }

/* Courses Card Grid */
.courses-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.course-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-indigo), var(--accent-cyan));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.course-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.course-card:hover::before {
    opacity: 1;
}

.course-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.course-card-tag {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    text-transform: uppercase;
}

.course-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin-top: 4px;
    line-height: 1.3;
}

.course-card p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-card-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.card-stat-pill {
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.course-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.card-progress-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-emerald);
    font-family: var(--font-mono);
}

/* Course Banner Detail */
.course-banner-card {
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
}

.banner-tag {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
}

.course-banner-card h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin: 4px 0 8px 0;
}

.course-banner-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    max-width: 720px;
}

.course-meta-pills {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.meta-pill {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.progress-ring-lg {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(var(--accent-emerald) calc(var(--pct, 0) * 1%), rgba(255, 255, 255, 0.08) 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
    position: relative;
}

.progress-ring-lg::after {
    content: '';
    position: absolute;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: var(--bg-surface);
}

.ring-val, .ring-sub {
    position: relative;
    z-index: 2;
}

.ring-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    font-family: var(--font-mono);
}

.ring-sub {
    font-size: 0.6rem;
    color: var(--text-dim);
    text-transform: uppercase;
}

/* Modules Accordion / List */
.modules-accordion-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.module-item-row {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.2s ease;
}

.module-item-row:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-mid);
}

.module-row-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.module-status-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
}

.module-status-icon.completed {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--status-success);
    color: var(--status-success);
}

.module-row-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.module-row-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.mod-badge {
    font-size: 0.68rem;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    color: var(--text-muted);
}

/* Module Hub Tabs */
.module-hub-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.module-badge-tag {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--accent-indigo);
    font-family: var(--font-mono);
}

.module-hub-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    margin: 2px 0;
}

.hub-course-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.module-tabs-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.mod-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mod-tab:hover {
    color: #fff;
}

.mod-tab.active {
    color: var(--accent-sky);
    border-bottom-color: var(--accent-sky);
}

.modtab-content {
    display: none;
}
.modtab-content.active {
    display: block;
}

/* Modality Cards */
.reading-materials-list,
.audio-hub-cards,
.slides-hub-cards,
.notes-hub-cards,
.quiz-hub-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.material-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    transition: all 0.2s ease;
}

.material-card:hover {
    border-color: var(--border-mid);
    background: rgba(255, 255, 255, 0.03);
}

.mat-card-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.mat-card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mat-card-icon.pdf { background: rgba(239, 68, 68, 0.15); color: var(--status-danger); }
.mat-card-icon.audio { background: rgba(99, 102, 241, 0.15); color: var(--accent-indigo); }
.mat-card-icon.slides { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.mat-card-icon.notes { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.mat-card-icon.quiz { background: rgba(16, 185, 129, 0.15); color: var(--status-success); }

.mat-card-meta h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.mat-card-meta p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.mat-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}

/* ================= GLOBAL BACKGROUND AUDIO PLAYER ================= */
.global-audio-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--player-height);
    background: rgba(10, 15, 29, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(99, 102, 241, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 9999;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.6);
    gap: 20px;
}

.audio-left-zone {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
    max-width: 320px;
}

.audio-art-badge {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-violet));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
}

.sound-wave-bars {
    display: none;
    position: absolute;
    bottom: 6px;
    gap: 2px;
}

.audio-art-badge.playing .sound-wave-bars {
    display: flex;
}

.sound-wave-bars span {
    width: 3px;
    height: 10px;
    background: #fff;
    border-radius: 2px;
    animation: waveAnim 0.6s infinite ease-in-out alternate;
}
.sound-wave-bars span:nth-child(2) { animation-delay: 0.2s; }
.sound-wave-bars span:nth-child(3) { animation-delay: 0.4s; }

@keyframes waveAnim {
    from { height: 3px; }
    to { height: 12px; }
}

.audio-meta-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.audio-track-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-course-badge {
    font-size: 0.68rem;
    color: var(--accent-sky);
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Audio Center Controls */
.audio-center-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    max-width: 580px;
}

.audio-buttons-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.audio-ctrl-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.2s ease;
}

.audio-ctrl-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

.ctrl-sub {
    font-size: 0.55rem;
    font-weight: 700;
    margin-top: -2px;
}

.audio-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    color: #070913;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.4);
}

.audio-play-btn:hover {
    transform: scale(1.08);
}

.audio-timeline-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.audio-time-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    min-width: 38px;
}

.audio-timeline-slider {
    flex: 1;
    height: 4px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
    transition: height 0.15s ease;
}

.audio-timeline-slider:hover {
    height: 6px;
}

.audio-timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-sky);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-sky);
}

/* Audio Right Tools */
.audio-right-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
    justify-content: flex-end;
}

.audio-tool-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 6px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.audio-tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.dropdown-wrapper {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-md);
    padding: 4px;
    display: none;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    z-index: 10000;
    min-width: 110px;
}

.dropdown-menu.show {
    display: flex;
}

.dropdown-menu button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 10px;
    font-size: 0.75rem;
    text-align: left;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.dropdown-menu button:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.dropdown-menu button.active {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-sky);
    font-weight: 700;
}

.volume-control-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.audio-volume-slider {
    width: 60px;
    height: 4px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}

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

/* ================= MODALS & EMBEDDED VIEWERS ================= */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.pdf-viewer-container,
.slides-viewer-container,
.notes-viewer-container {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-mid);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
    transition: all 0.25s ease;
}

.pdf-viewer-container.fullscreen,
.slides-viewer-container.fullscreen {
    max-width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
}

.pdf-viewer-header,
.slides-viewer-header,
.notes-viewer-header {
    height: 54px;
    background: rgba(13, 18, 34, 0.95);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
    gap: 16px;
}

.pdf-header-title,
.slides-header-title,
.notes-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

/* Interactive PDF Toolbar */
.pdf-toolbar-center {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.pdf-page-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.pdf-page-num-input {
    width: 44px;
    height: 26px;
    background: var(--bg-input);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-sm);
    color: #fff;
    text-align: center;
    font-size: 0.78rem;
    font-family: var(--font-mono);
    outline: none;
}

.pdf-page-num-input:focus {
    border-color: var(--accent-sky);
}

.toolbar-sep {
    color: var(--text-dim);
    margin: 0 2px;
}

.zoom-label {
    font-size: 0.72rem;
    color: var(--accent-sky);
    font-family: var(--font-mono);
    min-width: 40px;
    text-align: center;
}

.pdf-header-tools,
.slides-header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Canvas Scrolling Container */
.pdf-viewer-canvas-scroll {
    flex: 1;
    background: #090d18;
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 24px 12px;
}

/* Continuous Vertical Scroll Document Streamer */
.doc-continuous-pages-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    padding-bottom: 40px;
}

.doc-page-card {
    position: relative;
    background: #182032;
    border-radius: 6px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 480px;
    width: 820px;
    max-width: 96%;
    transition: width 0.15s ease-out;
}

.doc-page-card .page-number-watermark {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(10, 15, 29, 0.75);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-family: var(--font-mono);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    pointer-events: none;
    z-index: 5;
    border: 1px solid var(--border-subtle);
}

.doc-page-card .doc-page-img {
    width: 100%;
    height: auto;
    display: block;
    background: #ffffff;
    border-radius: 6px;
    user-select: none;
    -webkit-user-drag: none;
}

.doc-page-card.loading-card {
    background: linear-gradient(90deg, #151c32 25%, #242f4c 50%, #151c32 75%);
    background-size: 200% 100%;
    animation: skeletonWave 1.5s infinite;
}

@keyframes skeletonWave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.pdf-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 10;
    background: rgba(10, 15, 29, 0.8);
    padding: 20px 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.spinner-ring {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--accent-sky);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.notes-viewer-body {
    padding: 28px;
    overflow-y: auto;
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
    font-family: var(--font-mono);
}

.modal-close-x {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.modal-close-x:hover {
    color: #fff;
}

/* ================= QUIZ RUNNER INTERFACE ================= */
.quiz-runner-viewport {
    max-width: 1080px;
    margin: 0 auto;
}

.runner-header {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.runner-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.runner-title-group h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.runner-progress-sub {
    font-size: 0.72rem;
    color: var(--accent-sky);
    font-family: var(--font-mono);
}

.timer-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: var(--radius-full);
    color: var(--status-danger);
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.runner-body-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
}

.question-main-card {
    padding: 28px;
}

.question-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.q-number-pill {
    padding: 2px 8px;
    background: var(--accent-indigo);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
}

.q-marks-pill {
    font-size: 0.72rem;
    color: var(--text-dim);
}

.question-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.5;
    margin-bottom: 24px;
}

.choices-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.choice-option {
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.choice-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-mid);
}

.choice-option.selected {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-indigo);
}

.choice-option.correct {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: var(--status-success) !important;
}

.choice-option.incorrect {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: var(--status-danger) !important;
}

.choice-id-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.choice-option.selected .choice-id-badge {
    background: var(--accent-indigo);
    color: #fff;
}

.choice-text {
    font-size: 0.9rem;
    color: var(--text-main);
}

/* Teaching Rationale Card */
.instant-explanation-card {
    padding: 18px 20px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    animation: fadeIn 0.25s ease;
}

.exp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--status-success);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.exp-body {
    font-size: 0.85rem;
    color: #e2e8f0;
    line-height: 1.6;
}

.runner-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.runner-actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Questions Matrix Grid */
.runner-grid-sidebar {
    padding: 20px;
    height: fit-content;
}

.runner-grid-sidebar h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}

.questions-matrix {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.q-dot-btn {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.q-dot-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.q-dot-btn.current {
    border-color: var(--accent-sky);
    color: var(--accent-sky);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.q-dot-btn.answered {
    background: rgba(99, 102, 241, 0.3);
    border-color: var(--accent-indigo);
    color: #fff;
}

.q-dot-btn.correct-dot {
    background: rgba(16, 185, 129, 0.25) !important;
    border-color: var(--status-success) !important;
    color: #6ee7b7 !important;
}

.q-dot-btn.incorrect-dot {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: var(--status-danger) !important;
    color: #fca5a5 !important;
}

/* Quiz Scorecard View */
.quiz-scorecard-card {
    padding: 40px;
    text-align: center;
}

.scorecard-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.quiz-scorecard-card h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
}

.scorecard-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 600px;
    margin: 28px auto;
}

.sc-metric-box {
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.sc-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.sc-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    font-family: var(--font-mono);
}

/* ================= EDUCATOR COCKPIT VIEWS ================= */
.edu-sub-view {
    display: none;
}
.edu-sub-view.active {
    display: block;
}

.cockpit-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.bar-title h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
}

.bar-title p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.bar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Educator Course Tree */
.edu-courses-tree {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.edu-course-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.edu-course-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 14px;
    margin-bottom: 14px;
}

/* Analytics KPIs */
.analytics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 18px;
}

.kpi-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}

.kpi-val {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    font-family: var(--font-mono);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: calc(var(--player-height) + 16px);
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10000;
}

.toast {
    padding: 10px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 0.8rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    animation: toastSlide 0.25s ease forwards;
}

@keyframes toastSlide {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE DESIGN SYSTEM (SMARTPHONES, TABLETS & MONITORS)
   ========================================================================== */

/* 1. Large Tablets & Small Laptops (<= 1024px) */
@media (max-width: 1024px) {
    .app-main {
        padding: 20px 16px;
    }
    .courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
    .materials-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 14px;
    }
    .runner-body-layout {
        gap: 16px;
    }
    .audio-left-zone {
        min-width: 180px;
        max-width: 240px;
    }
}

/* 2. Tablets & Phablets (<= 768px) */
@media (max-width: 768px) {
    :root {
        --player-height: 84px;
    }

    body.has-bottom-player {
        padding-bottom: calc(var(--player-height) + env(safe-area-inset-bottom, 0px) + 8px);
    }

    /* Top App Header */
    .app-header {
        height: auto;
        min-height: 56px;
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .brand-meta .sub-tag {
        display: none;
    }

    .brand-meta h2 {
        font-size: 0.95rem;
    }

    .brand-badge {
        width: 34px;
        height: 34px;
    }

    .header-center#educator-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .header-center#educator-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-tabs {
        display: flex;
        width: max-content;
        gap: 6px;
    }

    .nav-tab {
        padding: 6px 12px;
        font-size: 0.72rem;
        white-space: nowrap;
    }

    .user-badge {
        padding: 4px 8px;
    }

    .user-badge .user-meta {
        display: none;
    }

    /* Learner Hero */
    .learner-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-bottom: 18px;
    }

    .hero-text h1 {
        font-size: 1.3rem;
    }

    .hero-text p {
        font-size: 0.78rem;
    }

    .search-bar-wrapper {
        width: 100%;
        max-width: 100%;
    }

    .courses-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Course Detail Banner */
    .course-banner-detail {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px;
    }

    .banner-info h1 {
        font-size: 1.25rem;
    }

    .banner-progress {
        width: 100%;
        justify-content: space-between;
    }

    /* Module Hub */
    .module-hub-header {
        padding: 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .modality-tabs-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        width: 100%;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    .modality-tabs-bar::-webkit-scrollbar {
        display: none;
    }

    .modality-tab {
        padding: 6px 12px;
        font-size: 0.75rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

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

    /* Quiz Runner */
    .runner-body-layout {
        flex-direction: column;
        gap: 16px;
    }

    .runner-grid-sidebar {
        order: 2;
        width: 100%;
        max-height: 220px;
        overflow-y: auto;
    }

    .question-main-card {
        padding: 16px;
    }

    .question-text {
        font-size: 1rem;
    }

    .runner-actions-row {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .runner-actions-right {
        width: 100%;
        justify-content: space-between;
    }

    .scorecard-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Modals & Embedded Viewers on Mobile */
    .modal-backdrop {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }

    .pdf-viewer-container,
    .slides-viewer-container,
    .notes-viewer-container {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }

    .pdf-viewer-header,
    .slides-viewer-header,
    .notes-viewer-header {
        height: auto;
        min-height: 48px;
        padding: 6px 10px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .pdf-header-title,
    .slides-header-title,
    .notes-header-title {
        max-width: 140px;
        font-size: 0.78rem;
    }

    .pdf-toolbar-center {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 4px;
        padding-top: 4px;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    .pdf-viewer-canvas-scroll {
        padding: 8px 4px;
    }

    .doc-page-card {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 260px;
        border-radius: 4px;
    }

    /* Educator Cockpit */
    .cockpit-top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .bar-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .analytics-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .edu-table-wrapper,
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
}

/* 3. Smartphones (<= 640px) */
@media (max-width: 640px) {
    /* Global Audio Player Mobile 2-Row Layout */
    .global-audio-player {
        height: auto;
        min-height: 70px;
        padding: 8px 12px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        flex-wrap: wrap;
        gap: 6px;
    }

    .audio-left-zone {
        min-width: 0;
        flex: 1;
        max-width: calc(100% - 130px);
        gap: 8px;
    }

    .audio-art-badge {
        width: 34px;
        height: 34px;
    }

    .audio-track-title {
        font-size: 0.75rem;
    }

    .audio-course-badge {
        font-size: 0.62rem;
    }

    .audio-center-controls {
        order: 3;
        width: 100%;
        max-width: 100%;
        gap: 2px;
    }

    .audio-buttons-row {
        gap: 12px;
    }

    .audio-play-btn {
        width: 32px;
        height: 32px;
    }

    .audio-right-tools {
        min-width: auto;
        gap: 6px;
    }

    .volume-control-wrapper {
        display: none; /* Native hardware volume buttons on mobile */
    }

    .audio-tool-btn {
        padding: 5px 7px;
        font-size: 0.68rem;
    }

    /* Modal Notes Viewer */
    .notes-viewer-body {
        padding: 16px 12px;
        font-size: 0.85rem;
    }

    /* Quiz Scorecard */
    .scorecard-metrics-grid {
        grid-template-columns: 1fr;
    }

    .scorecard-header h2 {
        font-size: 1.25rem;
    }
}

/* 4. Extra Small Smartphones (<= 480px) */
@media (max-width: 480px) {
    .brand-meta h2 {
        font-size: 0.85rem;
    }

    .btn-sm {
        padding: 5px 8px;
        font-size: 0.72rem;
    }

    .btn-md {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .choice-card {
        padding: 10px 12px;
        font-size: 0.8rem;
        gap: 8px;
    }

    .choice-radio-circle {
        width: 18px;
        height: 18px;
    }

    .q-dot-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    .toast-container {
        left: 12px;
        right: 12px;
        bottom: calc(var(--player-height) + 12px + env(safe-area-inset-bottom, 0px));
    }
}

/* Danger Button */
.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
}

/* Live Screen Mirror Option Ticker & Modal Elements */
.radar-opt-chip {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-dim);
}
.radar-opt-chip.selected {
    background: var(--brand-accent);
    color: #fff;
    border-color: var(--brand-accent);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

.mirror-opt-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}
.mirror-opt-item.pending {
    border-color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}
.mirror-opt-item.correct {
    border-color: var(--status-success);
    background: rgba(16, 185, 129, 0.15);
}
.mirror-opt-item.incorrect {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.edu-module-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}
.edu-material-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    margin-right: 6px;
    margin-top: 4px;
}

