:root {
    /* Colors - HSL for easy theming */
    --primary-hue: 250;
    --primary-sat: 85%;
    --primary-light: 65%;

    --accent-hue: 160;
    --accent-sat: 80%;
    --accent-light: 50%;

    --bg-hue: 240;
    --bg-sat: 10%;
    --bg-light: 98%;

    --text-hue: 240;
    --text-sat: 10%;
    --text-light: 10%;

    /* Light Theme Variables */
    --clr-primary: hsl(var(--primary-hue), var(--primary-sat), var(--primary-light));
    --clr-primary-glow: hsla(var(--primary-hue), var(--primary-sat), var(--primary-light), 0.3);
    --clr-accent: hsl(var(--accent-hue), var(--accent-sat), var(--accent-light));
    --clr-bg: hsl(var(--bg-hue), var(--bg-sat), var(--bg-light));
    --clr-surface: hsl(0, 0%, 100%);
    --clr-text: hsl(var(--text-hue), var(--text-sat), var(--text-light));
    --clr-text-muted: hsl(var(--text-hue), var(--text-sat), 60%);
    --clr-border: hsl(var(--bg-hue), 10%, 90%);

    /* Spacing & Layout */
    --container-width: 1200px;
    --header-height: 80px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

    /* Animations */
    --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: 10%;
        --text-light: 90%;
        --clr-surface: hsl(var(--bg-hue), var(--bg-sat), 15%);
        --clr-border: hsl(var(--bg-hue), 10%, 25%);
    }
}

[data-theme="dark"] {
    --bg-light: 10%;
    --text-light: 90%;

    /* Re-evaluate derived colors with new base values */
    --clr-bg: hsl(var(--bg-hue), var(--bg-sat), var(--bg-light));
    --clr-text: hsl(var(--text-hue), var(--text-sat), var(--text-light));
    --clr-surface: hsl(var(--bg-hue), var(--bg-sat), 15%);
    --clr-border: hsl(var(--bg-hue), 10%, 25%);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--clr-bg);
    color: var(--clr-text);
    line-height: 1.6;
    transition: background-color 0.3s var(--ease-smooth), color 0.3s var(--ease-smooth);
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3 {
    line-height: 1.2;
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.05em;
}

h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

p {
    font-size: 1.125rem;
    color: var(--clr-text-muted);
    margin-bottom: 2rem;
    max-width: 60ch;
}

/* Utilities */
.highlight {
    color: var(--clr-primary);
}

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

.app-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    max-width: var(--container-width);
    margin: 0 auto;
    width: 100%;
    z-index: 10;
}

.app-header nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
}

.logo-container .icon {
    font-size: 2rem;
    color: var(--clr-primary);
}

#main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    max-width: var(--container-width);
    margin: 0 auto;
    width: 100%;
}

/* Hero Section */
.hero-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.badge {
    background: transparent;
    color: var(--clr-primary);
    border: 1px solid var(--clr-primary-glow);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.hero-section h2 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--clr-text) 0%, var(--clr-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

/* Buttons */
/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    /* More standard modern radius */
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    font-family: inherit;
    line-height: 1.5;
    letter-spacing: 0.01em;
}

.btn.sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

.primary-btn {
    background: linear-gradient(135deg, var(--clr-primary), hsl(var(--primary-hue), var(--primary-sat), 60%));
    color: white;
    box-shadow: 0 4px 6px -1px var(--clr-primary-glow), 0 2px 4px -1px var(--clr-primary-glow);
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 12px -1px var(--clr-primary-glow);
    filter: brightness(1.1);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Modern Text Link Button */
.text-btn {
    background: transparent;
    border: none;
    color: var(--clr-primary);
    padding: 0;
    margin: 0;
    font-weight: 600;
    cursor: pointer;
    font-size: inherit;
    position: relative;
    padding-bottom: 2px;
}

.text-btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--clr-primary);
    transition: width 0.3s ease;
}

.text-btn:hover::after {
    width: 100%;
}

.text-btn:hover {
    background: transparent;
    color: var(--clr-primary);
}

.outline-btn {
    background: transparent;
    border: 1px solid var(--clr-border);
    color: var(--clr-text);
}

.outline-btn:hover {
    border-color: var(--clr-primary);
    color: var(--clr-primary);
}

.theme-toggle {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    color: var(--clr-text);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    /* Square-ish modern look */
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    border-color: var(--clr-text);
    background: var(--clr-bg);
}

/* Decorative Background */
.hero-visuals {
    display: none;
    /* Removed as per user request */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    width: 120%;
    /* Extend beyond container */
    height: 150%;
    /* Extend beyond container */
    pointer-events: none;
    /* Use mask to fade edges seamlessly into background */
    mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
}

.decorative-circle {
    position: absolute;
    border-radius: 50%;
    background: var(--clr-primary);
    filter: blur(120px);
    /* Increased blur for softness */
    opacity: 0.15;
}

.decorative-circle.lg {
    width: 800px;
    height: 800px;
    top: -30%;
    right: -20%;
    background: radial-gradient(circle, var(--clr-primary), transparent);
}

.decorative-circle.sm {
    width: 600px;
    height: 600px;
    bottom: -20%;
    left: -20%;
    background: var(--clr-accent);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.8s var(--ease-smooth) forwards;
    opacity: 0;
    transform: translateY(20px);
}

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

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--clr-text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--clr-border);
    margin-top: auto;
}

/* --- Dynamic Views --- */

/* Category Selection */
.category-section {
    text-align: center;
    width: 100%;
}

.category-section p {
    margin-left: auto;
    margin-right: auto;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.category-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.category-card:hover {
    border-color: var(--clr-primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.category-card .icon {
    font-size: 3rem;
    color: var(--clr-accent);
    background: hsla(var(--accent-hue), var(--accent-sat), var(--accent-light), 0.1);
    padding: 1rem;
    border-radius: 50%;
}

/* Quiz Interface */
.quiz-container {
    width: 100%;
    max-width: 800px;
}

.quiz-header {
    margin-bottom: 2rem;
}

.progress-bar {
    height: 8px;
    background: var(--clr-border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--clr-primary);
    transition: width 0.5s var(--ease-smooth);
}

.question-count {
    font-size: 0.875rem;
    color: var(--clr-text-muted);
    font-weight: 500;
}

.question-card {
    background: var(--clr-surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--clr-border);
}

.question-text {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.options-grid {
    display: grid;
    gap: 1rem;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: transparent;
    border: 2px solid var(--clr-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.125rem;
    color: var(--clr-text);
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--clr-primary);
    background: hsla(var(--primary-hue), var(--primary-sat), var(--primary-light), 0.05);
}

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

.opt-letter {
    font-weight: 700;
    color: var(--clr-primary);
    background: var(--clr-primary-glow);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.875rem;
}

/* States */
.option-btn.correct {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
}

.option-btn.wrong {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Results */
.results-section {
    text-align: center;
    background: var(--clr-surface);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--clr-border);
    max-width: 500px;
    margin: 0 auto;
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 10px solid var(--clr-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 2rem auto;
    background: var(--clr-bg);
}

.score-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--clr-primary);
    line-height: 1;
}

.score-label {
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    color: var(--clr-text-muted);
}




/* Auth & Forms */
.auth-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--clr-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--clr-border);
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.form-group {
    text-align: left;
}

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

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--clr-border);
    background: var(--clr-bg);
    color: var(--clr-text);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px var(--clr-primary-glow);
}

.auth-footer {
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--clr-text-muted);
}

/* Admin Dashboard */
.admin-dashboard {
    width: 100%;
    max-width: var(--container-width);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--clr-border);
}

.admin-grid {
    display: grid;
    gap: 2rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--clr-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--clr-border);
    vertical-align: middle;
}

.data-table th {
    background: var(--clr-bg);
    font-weight: 600;
    color: var(--clr-text-muted);
}

.badge-role {
    padding: 0.25rem 0.5rem;
    background: var(--clr-primary-glow);
    color: var(--clr-primary);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* --- UI / Notifications --- */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
    /* Allow clicking through container */
}

.toast {
    background: var(--clr-surface);
    color: var(--clr-text);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    border-left: 4px solid var(--clr-primary);
    pointer-events: auto;
    animation: slideInRight 0.3s ease forwards;
}

.toast-success {
    border-color: #10b981;
}

.toast-error {
    border-color: #ef4444;
}

.toast-warning {
    border-color: #f59e0b;
}

.toast .material-symbols-rounded {
    font-size: 1.25rem;
}

.toast-success .material-symbols-rounded {
    color: #10b981;
}

.toast-error .material-symbols-rounded {
    color: #ef4444;
}

.toast-warning .material-symbols-rounded {
    color: #f59e0b;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal {
    background: var(--clr-surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--clr-border);
}

.modal h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.modal p {
    color: var(--clr-text-muted);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* --- Courses Grid --- */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
    justify-content: center;
    /* Ensure centering if items are few and max-width constrains */
}

.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--clr-primary);
}

.course-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
}

.course-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.courses-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s;
}

.course-card:hover .play-overlay {
    opacity: 1;
}

.play-overlay span {
    font-size: 3rem;
    color: #fff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.course-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.course-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

.course-info p {
    font-size: 0.9rem;
    color: var(--clr-text-muted);
    line-height: 1.5;
    flex: 1;
}

.course-info .meta {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--clr-primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    align-self: flex-start;
}

/* --- Player Layout --- */
.course-player-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: calc(100vh - 120px);
    /* Adjust based on header */
    max-height: 900px;
}

.player-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 0;
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.video-wrapper {
    background: #000;
    display: flex;
    flex-direction: column;
}

.embed-responsive {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    width: 100%;
    background: #000;
}

.embed-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-meta {
    padding: 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.playlist-sidebar {
    background: var(--bg-main);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.playlist-sidebar h3 {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    margin: 0;
}

.playlist {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex: 1;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.playlist-item.active {
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--clr-primary);
}

.playlist-item .index {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    border-radius: 50%;
    font-size: 0.8rem;
    color: var(--clr-text-muted);
    border: 1px solid var(--border-color);
}

.playlist-item.active .index {
    background: var(--clr-primary);
    color: #fff;
    border-color: var(--clr-primary);
}

.playlist-item .title {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.playlist-item .status {
    color: var(--clr-primary);
    font-size: 1.2rem;
}

/* Responsive Player */
@media (max-width: 900px) {
    .player-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        overflow-y: auto;
        display: block;
        /* Simplifies stacking */
    }

    .course-player-layout {
        height: auto;
    }

    .playlist-sidebar {
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
}

/* --- Dashboard View --- */
.dashboard-section {
    padding: 2rem 0;
    max-width: 900px;
    margin: 0 auto;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.dashboard-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--clr-primary), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dashboard-header p {
    font-size: 1.1rem;
    color: var(--clr-text-muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.dashboard-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--clr-primary);
}

.dashboard-card .card-icon {
    width: 80px;
    height: 80px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.dashboard-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
    background: var(--clr-primary);
}

.dashboard-card .card-icon span {
    font-size: 3rem;
    color: var(--clr-primary);
    transition: color 0.3s ease;
}

.dashboard-card:hover .card-icon span {
    color: #fff;
}

.dashboard-card h3 {
    font-size: 1.5rem;
    margin: 0;
}

.dashboard-card p {
    color: var(--clr-text-muted);
    line-height: 1.6;
}

.dashboard-card .btn {
    margin-top: auto;
    width: 100%;
}

/* --- Navigation Refactor --- */

.logo-container {
    white-space: nowrap;
    /* Prevent breaking */
    min-width: max-content;
}

.nav-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 2rem;
    flex: 1;
    /* Center takes available space if needed, or justify-content handles it */
}

/* User Menu & Dropdown */
.user-menu-container {
    position: relative;
    display: flex;
    align-items: center;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0.8rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50px;
    /* Pill shape */
    cursor: pointer;
    transition: all 0.2s;
}

.user-btn:hover,
.user-btn.active {
    background: var(--clr-surface);
    border-color: var(--clr-border);
    box-shadow: var(--shadow-sm);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--clr-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.user-name {
    font-weight: 500;
    color: var(--clr-text);
    font-size: 0.9rem;
    display: none;
    /* Hidden on mobile */
}

@media (min-width: 768px) {
    .user-name {
        display: block;
    }
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.2s var(--ease-smooth);
    z-index: 100;
    overflow: hidden;
    padding: 0.5rem;
}

.dropdown-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    padding: 0.8rem 1rem;
    border: none;
    background: transparent;
    color: var(--clr-text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.1s;
    text-decoration: none;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--clr-bg);
    color: var(--clr-primary);
}

.dropdown-item .material-symbols-rounded {
    font-size: 1.2rem;
    color: var(--clr-text-muted);
}

.dropdown-item:hover .material-symbols-rounded {
    color: var(--clr-primary);
}

.dropdown-divider {
    margin: 0.5rem 0;
}

/* --- Module Grid Styles --- */

.modules-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.module-card-mini {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.module-card-mini:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--clr-primary);
}

.mini-thumb {
    height: 120px;
    background: #000;
    position: relative;
    overflow: hidden;
}

.mini-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.module-card-mini:hover .mini-thumb img {
    opacity: 1;
}

.mini-play,
.mini-pdf {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.mini-pdf {
    background: #f3f4f6;
    color: #ef4444;
}

.mini-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mini-number {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--clr-text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.mini-content h4 {
    font-size: 0.95rem;
    margin: 0 0 1rem 0;
    color: var(--clr-text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.full-width-btn {
    width: 100%;
    margin-top: auto;
}


/* --- Robust Modal --- */

.course-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* Darker backdrop */
    z-index: 9999;
    /* Max Z-Index */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.course-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.course-modal-box {
    background: var(--clr-surface);
    width: 100%;
    max-width: 800px;
    /* Video optimized width */
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.course-modal-overlay.active .course-modal-box {
    transform: scale(1);
}

.modal-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--clr-bg);
    border-bottom: 1px solid var(--clr-border);
}

.modal-box-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--clr-text-muted);
    padding: 0 0.5rem;
}

.video-container-modal {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    background: #000;
}

.video-container-modal iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.pdf-container-modal {
    padding: 3rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
