:root {
    /* Reference Palette - Pure Professional */
    --primary-bg: #f8fafc;
    --secondary-bg: #ffffff;
    --accent-blue: #3b82f6;
    /* Electric Blue */
    --accent-blue-active: #2563eb;
    --accent-blue-glow: rgba(59, 130, 246, 0.4);
    --navy-blue: #1a237e;
    /* Header/Footer Navy */
    --uworld-blue: #0277bd;
    /* Submit button / Active border */
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    /* Quiz Interface Specifics */
    --quiz-header-bg: #003366;
    /* Deep Navy */
    --quiz-footer-bg: #1a237e;
    --quiz-button-hover: rgba(255, 255, 255, 0.1);

    /* Sidebar - Premium Dark Glassmorphism */
    --sidebar-bg: #1e293b;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-text: #f8fafc;
    --sidebar-text-muted: #94a3b8;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active: rgba(59, 130, 246, 0.15);

    /* Components */
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.04), 0 8px 15px -6px rgba(0, 0, 0, 0.04);
    --glass-border: rgba(255, 255, 255, 0.2);
    --sidebar-width: 280px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-lg: 16px;
    --radius-md: 12px;
}

/* Dark Mode Variables */
:root.dark-mode {
    --primary-bg: #070912;
    --secondary-bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.05);
    --sidebar-bg: rgba(7, 9, 18, 0.98);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* --- Premium Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--sidebar-border);
    z-index: 1000;
    transition: var(--transition);
}

.logo-container {
    padding: 2.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 30%, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    padding: 0 1.25rem;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-item {
    padding: 0.85rem 1rem;
    margin-bottom: 0.4rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--sidebar-text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-item:hover {
    color: var(--sidebar-text);
    background-color: var(--sidebar-hover);
    transform: translateX(4px);
}

.nav-item.active {
    background-color: var(--sidebar-active);
    color: var(--accent-blue);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.nav-item i {
    width: 24px;
    text-align: center;
    font-size: 1.15rem;
    transition: var(--transition);
}

.nav-item.active i {
    color: var(--accent-blue);
    filter: drop-shadow(0 0 8px var(--accent-blue-glow));
}

.chevron {
    margin-left: auto;
    font-size: 0.75rem;
    opacity: 0.4;
    transition: transform 0.3s ease;
}

/* Accordion Submenu Styling */
.submenuShow {
    display: none;
    margin: 4px 0 12px 1.5rem;
    padding-left: 1rem;
    border-left: 1px solid var(--sidebar-border);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.submenuShow .nav-item {
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    border-radius: 10px;
    margin-bottom: 2px;
}

.submenuShow .nav-item i {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* --- Main Content --- */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 2.5rem 3rem;
    max-width: calc(100vw - var(--sidebar-width));
}

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

.header-title h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.7px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--secondary-bg);
    padding: 8px 12px 8px 20px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-blue), #1d4ed8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Welcome Banner - Premium Gradient */
.welcome-banner {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(25px);
    padding: 3.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}

.welcome-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
    opacity: 0.6;
    pointer-events: none;
}

.welcome-banner h2 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 24px;
    transition: var(--transition);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
}

.stat-card:hover::before {
    transform: translateX(100%);
}

.stat-card:hover {
    transform: translateY(-8px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
}

.stat-info span {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Buttons */
.btn-primary {
    background: var(--accent-blue) !important;
    color: white;
    padding: 0.85rem 1.75rem;
    border-radius: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: var(--secondary-bg);
    padding: 3rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    text-align: center;
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Custom Scrollbar Utility */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }

    .sidebar .logo-text,
    .sidebar span,
    .sidebar .chevron {
        display: none;
    }

    .nav-links {
        padding: 0 10px;
    }

    .nav-item {
        justify-content: center;
        padding: 1rem 0;
    }

    .main-content {
        margin-left: 80px;
        padding: 2rem;
    }
}

/* Quiz Overhaul Specific Classes */
.quiz-header {
    background: var(--quiz-header-bg);
    color: white;
    padding: 0.5rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.quiz-footer {
    background: var(--quiz-footer-bg);
    color: white;
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    position: fixed;
    bottom: 0;
    width: 100%;
}

.nav-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 5px 15px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    transition: 0.2s;
}

.nav-btn:hover {
    background: var(--quiz-button-hover);
}

.nav-btn i {
    font-size: 1.2rem;
    margin-bottom: 3px;
}

.option-card {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
}

.option-card:hover {
    background: #f1f5f9;
}

.option-card.active {
    border: 2px solid var(--uworld-blue);
    background: #eef2ff;
}

/* Reference Select Switch (Toggles) */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--uworld-blue);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* --- Assessment Tasks Redesign --- */
.assessment-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.assessment-title-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.assessment-icon-box {
    width: 64px;
    height: 64px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 15px rgba(3, 105, 161, 0.1);
}

.date-display-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--text-main);
    box-shadow: var(--card-shadow);
}

.filter-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select {
    width: 100%;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    color: var(--text-main);
    font-weight: 600;
    outline: none;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
}

.filter-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px var(--accent-blue-glow);
}

.btn-reset {
    background: #fee2e2;
    color: #b91c1c;
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    border: 1px solid #fecaca;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.btn-reset:hover {
    background: #fecaca;
    transform: translateY(-2px);
}

.tasks-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.tasks-card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tasks-card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.available-count {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.assessment-table {
    width: 100%;
    border-collapse: collapse;
}

.assessment-table th {
    background: #00a8e8;
    color: #ffffff;
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.assessment-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
}

.assessment-table tr:last-child td {
    border-bottom: none;
}

.assessment-table tr:hover td {
    background: #f8fafc;
}

.block-id-link {
    color: #0284c7;
    text-decoration: none;
    font-weight: 700;
}

.block-id-link:hover {
    text-decoration: underline;
}

.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
}

.badge-warning {
    background: #fef9c3;
    color: #854d0e;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-info {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

.action-btns {
    display: flex;
    gap: 12px;
}

.btn-action {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-resume {
    background: #f97316;
    color: white;
}

.btn-resume:hover {
    background: #ea580c;
    transform: scale(1.05);
}

.btn-analysis {
    background: linear-gradient(135deg, #14b8a6, #6366f1);
    color: white;
}

.btn-analysis:hover {
    opacity: 0.9;
    transform: scale(1.05);
}
/* Courses Library Styling */
.course-hero { background: var(--card-bg); border: 1px solid var(--glass-border); border-radius: 20px; padding: 2.5rem; margin-bottom: 2.5rem; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--card-shadow); }
.course-stats { display: flex; gap: 40px; }
.stat-pill { display: flex; flex-direction: column; }
.stat-pill .val { font-size: 1.8rem; font-weight: 900; color: var(--navy-blue); line-height: 1; }
.stat-pill .lbl { font-size: 0.8rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-top: 5px; }

.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 2rem; }
.course-card { background: white; border-radius: 20px; border: 1px solid #eef2f6; overflow: hidden; transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); cursor: pointer; display: flex; flex-direction: column; height: 100%; }
.course-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.08); border-color: var(--accent-blue); }
.course-visual { height: 160px; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.course-visual i { font-size: 4.5rem; opacity: 0.2; transform: rotate(-15deg); transition: all 0.4s; }
.course-card:hover .course-visual i { transform: rotate(0) scale(1.1); opacity: 0.3; }

.course-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.course-tag { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; display: inline-block; }
.course-title { font-size: 1.4rem; font-weight: 800; color: #1e293b; margin-bottom: 10px; }
.course-desc { color: #64748b; font-size: 0.95rem; line-height: 1.6; margin-bottom: 2rem; flex: 1; }

.course-progress-container { margin-bottom: 1.5rem; }
.progress-meta { display: flex; justify-content: space-between; font-size: 0.75rem; font-weight: 700; color: #94a3b8; margin-bottom: 8px; }
.progress-bar-bg { height: 6px; background: #f1f5f9; border-radius: 10px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 10px; transition: width 1s ease-out; }

.course-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 1.5rem; border-top: 1px solid #f1f5f9; }
.lesson-count { font-size: 0.85rem; font-weight: 700; color: #64748b; display: flex; align-items: center; gap: 6px; }

.btn-start { padding: 10px 20px; border-radius: 8px; font-weight: 800; font-size: 0.85rem; border: none; cursor: pointer; transition: all 0.3s; }
.btn-start.primary { background: var(--accent-blue); color: white; }
.btn-start.secondary { background: #f1f5f9; color: #475569; }
.btn-start:hover { filter: brightness(1.1); }

/* Course Viewer Professional CSS */
.viewer-container { display: flex; gap: 2rem; }
.video-pane { flex: 1; min-width: 0; }
.video-frame-container { position: relative; padding-bottom: 56.25%; height: 0; background: #000; border-radius: 20px; overflow: hidden; box-shadow: 0 30px 60px -12px rgba(0,0,0,0.25); border: 4px solid var(--card-bg); }
.video-frame-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

.syllabus-pane { width: 380px; flex-shrink: 0; display: flex; flex-direction: column; gap: 15px; }
.syllabus-card { background: var(--card-bg); border: 1px solid var(--glass-border); border-radius: 20px; padding: 1.5rem; box-shadow: var(--card-shadow); height: calc(100vh - 200px); display: flex; flex-direction: column; }
.syllabus-header { font-weight: 800; font-size: 1.1rem; color: var(--navy-blue); border-bottom: 1px solid var(--glass-border); padding-bottom: 1rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 10px; }
.lesson-scroll { flex: 1; overflow-y: auto; padding-right: 5px; }

.lesson-row { padding: 12px 15px; border-radius: 12px; cursor: pointer; transition: all 0.2s; border: 1px solid transparent; margin-bottom: 8px; display: flex; gap: 12px; align-items: center; }
.lesson-row:hover { background: rgba(59, 130, 246, 0.05); border-color: rgba(59, 130, 246, 0.1); }
.lesson-row.active { background: var(--accent-blue); border-color: var(--accent-blue); }
.lesson-row.active .l-title { color: white !important; }
.lesson-row.active .l-icon i { color: white !important; }
.lesson-row.active .l-meta { color: rgba(255,255,255,0.7) !important; }

.l-icon { width: 36px; height: 36px; border-radius: 10px; background: #f8fafc; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.l-info { flex: 1; min-width: 0; }
.l-title { font-size: 0.9rem; font-weight: 700; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-meta { font-size: 0.75rem; color: #94a3b8; font-weight: 600; margin-top: 2px; }

.viewer-info-box { background: white; border-radius: 20px; padding: 2.5rem; margin-top: 2rem; border: 1px solid #eef2f6; }
.viewer-title { font-size: 1.8rem; font-weight: 900; margin-bottom: 10px; color: #0f172a; }
.viewer-desc { color: #64748b; line-height: 1.8; font-size: 1.05rem; }

@media (max-width: 1200px) {
    .viewer-container { flex-direction: column; }
    .syllabus-pane { width: 100%; }
    .syllabus-card { height: auto; }
}
