:root {
    --bg: #0a0a0b;
    --surface: #18181b;
    --surface2: #232327;
    --border: #27272a;
    --text: #f4f4f5;
    --muted: #a1a1aa;
    --primary: #ee72f1;
    --primary2: #ec4899;
    --primary-glow: rgba(238, 114, 241, 0.18);
    --danger: #f85149;
    --danger2: #da3633;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: clamp(18px, 1.25vw, 24px);
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Navbar ─────────────────────────────────────────────────────────── */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    padding: 0 clamp(24px, 4vw, 64px);
    gap: 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 24px rgba(238, 114, 241, 0.06);
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.navbar-brand:hover {
    color: var(--primary);
}

.nav-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-name {
    font-size: clamp(18px, 1.4vw, 26px);
    font-weight: 600;
    color: var(--text);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.navbar-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: clamp(15px, 1.2vw, 20px);
    line-height: 1;
    transition: color 0.1s;
}

.navbar-links a:hover,
.navbar-links .nav-link-btn:hover {
    color: var(--primary);
}

.nav-logout-form {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.navbar-links .nav-link-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font: inherit;
    font-size: clamp(15px, 1.2vw, 20px);
    padding: 0;
    line-height: 1;
    transition: color 0.1s;
}

/* ── Layout ─────────────────────────────────────────────────────────── */

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 48px clamp(32px, 4vw, 80px);
}

/* ── Roadmaps ───────────────────────────────────────────────────────── */

.roadmap-tree {
    max-width: 900px;
    margin: 40px auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.roadmap-description {
    color: var(--muted);
    font-size: 22px;
    line-height: 1.7;
    text-align: center;
    max-width: 700px;
    margin: 12px auto 8px;
}

.roadmap-step-card {
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
    padding: 28px 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.roadmap-step-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 16px var(--primary-glow);
}

.roadmap-step-img {
    width: 160px;
    height: 100px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--bg);
    flex-shrink: 0;
    order: 1;
}

.roadmap-step-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.roadmap-step-title {
    font-size: 20px;
    font-weight: 600;
}

.roadmap-step-summary {
    font-size: 16px;
    color: var(--muted);
    line-height: 1.4;
}

.roadmap-step-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.roadmap-step-meta .difficulty-badge {
    position: static;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 6px;
}

.roadmap-step-stat {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.roadmap-step-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.roadmap-connector {
    display: flex;
    justify-content: center;
    padding: 16px 0;
}

.roadmap-connector svg {
    filter: drop-shadow(0 0 4px var(--primary-glow));
    stroke: var(--primary);
    opacity: 0.7;
}

.roadmap-branch-selector {
    display: flex;
    gap: 12px;
    width: 100%;
    margin: 4px 0;
}

.roadmap-branch-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1 1 0;
    min-width: 0;
    padding: 28px 24px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--muted);
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.roadmap-branch-icon {
    font-size: 32px;
    line-height: 1;
}

.roadmap-branch-option:hover {
    border-color: var(--muted);
    color: var(--text);
}

.roadmap-branch-option.active {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.roadmap-branch-path {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-bar-fill.complete {
    background: #3fb950;
}

.progress-percent.complete {
    color: #3fb950;
}

@media (max-width: 600px) {
    .roadmap-step-img {
        display: none;
    }

    .roadmap-branch-selector {
        flex-direction: column;
        gap: 8px;
    }
}

/* ── Learn page ────────────────────────────────────────────────────── */

.learn-page {
    max-width: 900px;
    margin: 0 auto;
}

.learn-header {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 48px;
}

.learn-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.learn-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
}

.learn-lecture-count {
    font-size: 14px;
    color: var(--muted);
}

.learn-progress {
    display: flex;
    align-items: center;
    gap: 16px;
}

.learn-progress-bar {
    flex: 1;
    height: 10px;
    background: var(--surface2);
    border-radius: 5px;
    overflow: hidden;
}

.learn-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 5px;
    transition: width 0.3s;
}

.learn-progress-fill.complete {
    background: #3fb950;
}

.learn-progress-text {
    font-size: 16px;
    color: var(--muted);
    white-space: nowrap;
}

.learn-progress-text.complete {
    color: #3fb950;
}

.learn-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.learn-meta-item {
    font-size: 16px;
    color: var(--muted);
}

.learn-meta-date {
    color: var(--primary);
    font-weight: 600;
}

.learn-detail-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 17px;
    text-decoration: none;
    transition: color 0.2s;
}

.learn-detail-link:hover {
    color: var(--primary);
}

.learn-header-image {
    flex-shrink: 0;
}

.learn-header-image img {
    width: 240px;
    height: auto;
    border-radius: 10px;
}

.learn-toc {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.learn-module {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.learn-module:hover {
    border-color: var(--muted);
}

.learn-module-header {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 20px 24px;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 16px;
    text-align: left;
}

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

.learn-module-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-glow);
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.learn-module-title {
    font-weight: 600;
    font-size: 18px;
}

.learn-module-count {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.learn-module.module-completed .learn-module-number {
    background: rgba(63, 185, 80, 0.18);
    color: #3fb950;
}

.learn-module.module-completed .learn-module-title {
    color: #3fb950;
}

.learn-module.module-completed .learn-module-count {
    color: #3fb950;
}

.learn-module-chevron {
    transition: transform 0.2s;
    color: var(--muted);
    flex-shrink: 0;
}

.learn-module.open .learn-module-chevron {
    transform: rotate(180deg);
}

.learn-module-lessons {
    list-style: none;
    padding: 0 24px 16px 70px;
    display: none;
}

.learn-module.open .learn-module-lessons {
    display: block;
}

.learn-lesson {
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.learn-lesson-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.learn-lesson:first-child {
    border-top: none;
}

.learn-lesson-icon {
    color: var(--muted);
    flex-shrink: 0;
    display: flex;
}

.learn-lesson-link.completed .learn-lesson-icon {
    color: #3fb950;
}

.learn-lesson-link.completed .learn-lesson-title {
    color: #3fb950;
}

.learn-lesson-title {
    font-size: 15px;
    color: var(--muted);
}

.learn-lesson:hover .learn-lesson-title {
    color: var(--text);
}

.learn-lesson:hover .learn-lesson-icon {
    color: var(--primary);
}

@media (max-width: 600px) {
    .learn-header {
        flex-direction: column-reverse;
        gap: 24px;
    }

    .learn-title {
        font-size: 28px;
    }

    .learn-header-image img {
        width: 100%;
        height: auto;
    }

    .learn-module-lessons {
        padding-left: 48px;
    }
}

@media (max-height: 800px) and (min-width: 769px) {
    .learn-title {
        font-size: 28px;
    }

    .learn-meta-item {
        font-size: 13px;
    }

    .learn-progress-text {
        font-size: 13px;
    }

    .learn-detail-link {
        font-size: 14px;
    }

    .lecture-empty {
        padding: 2rem 1rem;
    }

    .lecture-empty-art {
        font-size: 20px;
    }

    .lecture-empty-title {
        font-size: 1.2rem;
    }

    .lecture-empty-subtitle {
        font-size: 1rem;
    }
}

@media (min-width: 1200px) {
    .learn-page {
        max-width: 1600px;
    }

    .learn-title {
        font-size: 48px;
    }

    .learn-progress-bar {
        height: 14px;
        border-radius: 7px;
    }

    .learn-progress-fill {
        border-radius: 7px;
    }

    .learn-progress-text {
        font-size: 16px;
    }

    .learn-header-image img {
        width: 320px;
    }

    .learn-module-header {
        padding: 24px 32px;
    }

    .learn-module-title {
        font-size: 22px;
    }

    .learn-module-number {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .learn-module-count {
        font-size: 15px;
    }

    .learn-lesson-title {
        font-size: 17px;
    }

    .learn-module-lessons {
        padding: 0 32px 20px 86px;
    }

    .learn-lesson {
        padding: 14px 0;
    }
}

/* ── Lecture page ──────────────────────────────────────────────────── */

.lecture-layout {
    display: flex;
    gap: 0;
    max-width: 100%;
}

.lecture-sidebar {
    display: none;
}

.lecture-main {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    min-width: 0;
    transition: max-width 0.2s;
}

.lecture-header {
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lecture-course-title {
    font-size: 28px;
    font-weight: 700;
}

.lecture-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.lecture-breadcrumb-module {
    color: var(--muted);
}

.lecture-breadcrumb-lesson {
    color: var(--text);
    font-weight: 600;
}

.lecture-breadcrumb svg {
    color: var(--muted);
}

.lecture-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lecture-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    transition: text-shadow 0.15s;
}

.lecture-nav-link:hover {
    text-shadow: 0 0 8px var(--primary-glow);
}

.lecture-video {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 40px;
    background: #000;
}

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

#shaka-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#shaka-video {
    width: 100%;
    height: 100%;
    background: #000;
}

.shaka-play-button {
    padding: calc(7% / 2) !important;
    background-size: 60% !important;
    background-color: var(--primary) !important;
}

.shaka-controls-container[shown="true"] .shaka-play-button {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.shaka-controls-container:not([shown="true"]) .shaka-play-button {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.shaka-bottom-controls {
    padding: 8px 12px !important;
}

.shaka-controls-button-panel {
    font-size: 24px !important;
}

.shaka-controls-button-panel button {
    width: 44px !important;
    height: 44px !important;
}

.shaka-controls-button-panel .material-svg-icon {
    width: 32px !important;
    height: 32px !important;
}

.shaka-seek-bar-container {
    height: 12px !important;
    top: 0 !important;
    border: none !important;
}

.shaka-range-element {
    height: 16px !important;
    top: calc((12px - 16px) / 2) !important;
}

.shaka-range-element::-webkit-slider-thumb {
    width: 0 !important;
    height: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.shaka-range-element::-moz-range-thumb {
    width: 0 !important;
    height: 0 !important;
    appearance: none !important;
}

.shaka-volume-bar-container.shaka-volume-bar-container-allow-hiding {
    width: 80px !important;
    opacity: 1 !important;
}

.shaka-volume-bar-container {
    width: 80px !important;
    height: 12px !important;
    margin: auto 6px !important;
    top: -2px !important;
    position: relative !important;
}

.shaka-volume-bar-container .shaka-range-element {
    top: calc((12px - 16px) / 2) !important;
}


.shaka-current-time {
    font-size: 16px !important;
    white-space: nowrap !important;
}

.shaka-overflow-quality-mark,
.shaka-overflow-playback-rate-mark {
    display: none !important;
}


.lecture-section {
    margin-bottom: 40px;
}

.lecture-section-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 16px;
}

.lecture-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--muted);
}

.lecture-empty-art {
    font-size: 36px;
    line-height: 1.3;
    display: inline-block;
    text-align: left;
    color: var(--primary);
    opacity: 0.6;
}

.lecture-empty-title {
    font-size: 2rem;
    margin-top: 1.5rem;
}

.lecture-empty-subtitle {
    font-size: 1.5rem;
    margin-top: 0.5rem;
}

.lecture-introduction {
    color: var(--text);
    font-size: 18px;
    line-height: 1.7;
}

.lecture-assets {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lecture-asset {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.15s;
}

.lecture-asset:hover {
    border-color: var(--muted);
}

.lecture-asset-icon {
    color: var(--primary);
    flex-shrink: 0;
    display: flex;
}

.lecture-asset-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lecture-asset-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.lecture-asset-meta {
    font-size: 12px;
    color: var(--muted);
}

.lecture-asset-download {
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
}

.lecture-slide {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.lecture-slide iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.lecture-description {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.8;
}

.lecture-description p {
    font-size: 24px;
    margin-bottom: 16px;
}

.lecture-description p:last-child {
    margin-bottom: 0;
}

.lecture-references {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lecture-reference {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.15s;
}

.lecture-reference:hover {
    border-color: var(--primary);
}

.lecture-reference svg {
    color: var(--muted);
    flex-shrink: 0;
}

.lecture-reference a {
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
}

.lecture-reference:hover a {
    color: var(--primary);
}

/* ── Exercises ──────────────────────────────────────────────────────── */

.exercise-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.exercise-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.exercise-question {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.6;
}

.exercise-answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.exercise-answer {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text);
    font-size: 18px;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
}

.exercise-answer:hover:not(.correct):not(.wrong) {
    border-color: var(--primary);
    background: var(--primary-glow);
}

.exercise-answer-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--border);
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.exercise-answer-text {
    flex: 1;
}

.answered .exercise-answer {
    cursor: default;
    opacity: 0.6;
}

.answered .exercise-answer.correct {
    opacity: 1;
    border-color: #3fb950;
    background: rgba(63, 185, 80, 0.1);
}

.answered .exercise-answer.correct .exercise-answer-marker {
    background: #3fb950;
    color: #fff;
}

.answered .exercise-answer.wrong {
    opacity: 1;
    border-color: var(--danger);
    background: rgba(248, 81, 73, 0.1);
}

.answered .exercise-answer.wrong .exercise-answer-marker {
    background: var(--danger);
    color: #fff;
}

.exercise-feedback {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 600;
}

.exercise-feedback.correct {
    background: rgba(63, 185, 80, 0.1);
    color: #3fb950;
}

.exercise-feedback.wrong {
    background: rgba(248, 81, 73, 0.1);
    color: var(--danger);
}

/* ── Project Ideas ─────────────────────────────────────────────────── */

.project-card {
    display: flex;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

.project-icon {
    flex-shrink: 0;
    color: var(--primary);
    margin-top: 2px;
}

.project-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
}

.project-description {
    font-size: 18px;
    color: var(--muted);
    line-height: 1.6;
}

/* Sidebar ToC */

.lecture-toc-module-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 6px;
    display: block;
}

.lecture-toc-module {
    margin-bottom: 16px;
}

.lecture-toc-lessons {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lecture-toc-lesson a {
    display: block;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.1s, background 0.1s;
}

.lecture-toc-lesson a:hover {
    color: var(--text);
    background: var(--surface2);
}

.lecture-toc-lesson.current a {
    color: var(--primary);
    background: var(--primary-glow);
    font-weight: 600;
}

.lecture-toc-lesson.completed a::before {
    content: '✓ ';
    color: #3fb950;
}

.lecture-breadcrumb-lesson.lesson-completed {
    color: #3fb950;
}

.lecture-breadcrumb-lesson.lesson-completed::after {
    content: ' ✓';
}

/* Toggle button (small screens) */

.lecture-toc-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    position: static;
    z-index: 30;
    margin-bottom: 12px;
    padding: 5px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s;
}

.lecture-toc-toggle:hover {
    border-color: var(--primary);
}

/* Modal overlay (small screens) */

.lecture-toc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lecture-toc-overlay.open {
    display: flex;
}

.lecture-toc-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lecture-toc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.lecture-toc-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.lecture-toc-modal-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
}

.lecture-toc-modal-close:hover {
    color: var(--text);
}

.lecture-toc-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.lecture-toc-modal-body::-webkit-scrollbar {
    width: 6px;
}

.lecture-toc-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.lecture-toc-modal-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.lecture-toc-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* Sidebar header & hide/show buttons */

.lecture-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.lecture-sidebar-hide {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.lecture-sidebar-hide:hover {
    color: var(--text);
    background: var(--surface2);
}

.lecture-sidebar-show {
    display: none;
    align-items: center;
    gap: 6px;
    position: sticky;
    top: 90px;
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.15s, border-color 0.15s;
    z-index: 10;
}

.lecture-sidebar-show:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* Large screens: show sidebar, hide toggle */

@media (min-width: 1200px) {
    .lecture-layout {
        gap: 40px;
    }

    .lecture-sidebar {
        display: block;
        width: 260px;
        flex-shrink: 0;
        position: sticky;
        top: 90px;
        max-height: calc(100vh - 110px);
        overflow-y: auto;
        padding-right: 16px;
        transition: width 0.2s, opacity 0.2s;
    }

    .lecture-sidebar.hidden {
        width: 0;
        opacity: 0;
        overflow: hidden;
        padding: 0;
        margin: 0;
    }

    .lecture-layout.sidebar-hidden .lecture-main {
        max-width: 1600px;
    }

    .lecture-sidebar-show.visible {
        display: flex;
        position: fixed;
        top: 140px;
        left: 32px;
    }

    .lecture-layout.sidebar-hidden {
        gap: 0;
        padding-left: 80px;
    }

    .lecture-sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .lecture-sidebar::-webkit-scrollbar-track {
        background: transparent;
    }

    .lecture-sidebar::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 3px;
    }

    .lecture-sidebar::-webkit-scrollbar-thumb:hover {
        background: var(--muted);
    }

    .lecture-sidebar {
        scrollbar-width: thin;
        scrollbar-color: var(--border) transparent;
    }

    .lecture-sidebar-title {
        font-size: 14px;
        font-weight: 700;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 0;
    }

    .lecture-toc-toggle {
        display: none;
    }

    .lecture-main {
        max-width: 1600px;
        margin: 0 auto;
    }

    .lecture-course-title {
        font-size: 36px;
    }

    .lecture-section-title {
        font-size: 26px;
    }

    .lecture-description {
        font-size: 18px;
    }
}

@media (min-width: 2000px) {
    .lecture-sidebar {
        width: 420px;
    }

    .lecture-sidebar-title {
        font-size: 16px;
    }

    .lecture-toc-module-title {
        font-size: 15px;
    }

    .lecture-toc-lesson a {
        font-size: 15px;
        padding: 8px 14px;
    }
}

@media (max-width: 600px) {
    .lecture-course-title {
        font-size: 22px;
    }

    .lecture-description {
        font-size: 14px;
    }

    .lecture-description p {
        font-size: 16px;
    }

    .lecture-toc-toggle {
        display: none;
    }

    .lecture-asset {
        flex-wrap: wrap;
    }

    .lecture-asset-download {
        width: 100%;
        justify-content: center;
    }
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.footer {
    border-top: 1px solid var(--border);
    padding: 48px clamp(32px, 4vw, 80px);
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 100%;
    margin: 0 auto;
    justify-items: center;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-col h4 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.footer-col p,
.footer-col a {
    font-size: 14px;
    color: var(--muted);
    text-decoration: none;
    line-height: 1.6;
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-email {
    color: var(--primary) !important;
}

.footer-credit {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin-top: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        justify-items: start;
    }

    .footer {
        padding: 32px 24px;
        margin-top: 40px;
    }

    .footer-col h4 {
        font-size: 18px;
    }
}

/* ── Page title ─────────────────────────────────────────────────────── */

.page-title {
    font-size: 38px;
    font-weight: 600;
    margin-bottom: 20px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Account subnav ─────────────────────────────────────────────────── */

.account-subnav {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.account-subnav-link {
    padding: 12px 24px;
    font-size: 20px;
    font-weight: 500;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
}

.account-subnav-link:hover {
    color: var(--text);
}

.account-subnav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ── Profile card ───────────────────────────────────────────────────── */

.profile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto 20px;
    max-width: 1000px;
}

.profile-row {
    display: flex;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.profile-row:last-child {
    border-bottom: none;
}

.profile-label {
    width: 240px;
    color: var(--muted);
    font-size: 24px;
    flex-shrink: 0;
}

.profile-value {
    font-size: 24px;
}

.badge-admin {
    background: rgba(238, 114, 241, 0.15);
    color: var(--primary);
    border: 1px solid rgba(238, 114, 241, 0.35);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-note {
    color: var(--muted);
    font-size: 18px;
    max-width: 1000px;
    margin: 0 auto;
}

.profile-note + .profile-note {
    margin-top: 6px;
}

.profile-note a {
    color: var(--primary);
}

/* ── Progress page ──────────────────────────────────────────────────── */

.progress-section {
    max-width: 1000px;
    margin: 0 auto 40px;
}

.progress-section-title {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 16px;
}

.progress-card {
    display: block;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    overflow: hidden;
    margin-bottom: 16px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.progress-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 16px var(--primary-glow);
}

.progress-card-top {
    margin-bottom: 16px;
}

.progress-card-title {
    font-size: 24px;
    font-weight: 600;
}

.progress-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 20px;
}

.progress-card-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-stat {
    display: flex;
    gap: 12px;
    align-items: baseline;
}

.progress-stat-label {
    font-size: 15px;
    color: var(--muted);
    min-width: 140px;
}

.progress-stat-value {
    font-size: 17px;
    font-weight: 500;
}

.progress-card-img {
    position: absolute;
    top: 20px;
    right: 220px;
    width: 240px;
    height: 135px;
    object-fit: contain;
    background: var(--bg);
    border-radius: 8px;
}

.progress-card-bottom {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-bar-container {
    flex: 1;
    height: 10px;
    background: var(--surface2);
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 5px;
    transition: width 0.3s;
}

.progress-card.completed .progress-bar-fill {
    background: #3fb950;
}

.progress-percent {
    font-size: 18px;
    font-weight: 700;
    color: var(--muted);
    min-width: 50px;
    text-align: right;
}

.progress-card.completed .progress-percent {
    color: #3fb950;
}

@media (max-width: 600px) {
    .profile-row {
        padding: 12px 16px;
    }

    .profile-label {
        width: 100px;
        font-size: 14px;
    }

    .profile-value {
        font-size: 14px;
    }

    .profile-note {
        font-size: 13px;
    }

    .progress-section-title {
        font-size: 18px;
    }

    .progress-card {
        padding: 16px;
    }

    .progress-card-title {
        font-size: 16px;
    }

    .progress-stat-label {
        font-size: 12px;
        min-width: 100px;
    }

    .progress-stat-value {
        font-size: 13px;
    }

    .progress-percent {
        font-size: 14px;
    }

    .progress-card-img {
        display: none;
    }
}

/* ── Hero ───────────────────────────────────────────────────────────── */

.hero {
    text-align: center;
    padding: 120px 0;
}

.hero h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 12px;
}

.muted {
    color: var(--muted);
}

/* ── Buttons ────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
    text-decoration: none;
}

.btn:hover {
    border-color: var(--muted);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
    font-size: 18px;
    font-weight: 700;
    padding: 14px 28px;
    box-shadow: 0 0 16px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary2);
    border-color: var(--primary2);
}

.btn-enrolled {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
    padding: 14px 28px;
}

.btn-enrolled:hover {
    background: var(--primary);
    color: #000;
}

.btn-completed {
    background: transparent;
    border-color: #3fb950;
    color: #3fb950;
    font-size: 18px;
    font-weight: 700;
    padding: 14px 28px;
}

.btn-completed:hover {
    background: #3fb950;
    color: #000;
}

/* ── Cards ──────────────────────────────────────────────────────────── */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}

/* ── Catalog stats ─────────────────────────────────────────────────── */

.catalog-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin: 32px 0 16px;
    padding: 24px 0;
}

.catalog-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.catalog-stat-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.catalog-stat-label {
    font-size: 15px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.catalog-stat-separator {
    font-size: 32px;
    color: var(--muted);
    font-weight: 300;
}

@media (max-width: 600px) {
    .catalog-stats {
        gap: 20px;
    }

    .catalog-stat-value {
        font-size: 24px;
    }

    .catalog-stat-label {
        font-size: 12px;
    }

}

/* ── Course grid ────────────────────────────────────────────────────── */

.course-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 40px;
}

.course-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.course-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.course-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg);
}

.wip-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(210, 153, 34, 0.9);
    color: #fff;
    z-index: 1;
}

.difficulty-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.difficulty-principiante {
    background: rgba(63, 185, 80, 0.9);
    color: #fff;
}

.difficulty-intermedio {
    background: rgba(210, 153, 34, 0.9);
    color: #fff;
}

.difficulty-avanzato {
    background: rgba(248, 81, 73, 0.9);
    color: #fff;
}

.difficulty-dots {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    background: none !important;
    border: none;
    padding: 0;
}

.difficulty-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.difficulty-dots.difficulty-principiante .dot {
    background: #3fb950;
}

.difficulty-dots.difficulty-intermedio .dot {
    background: #d29922;
}

.difficulty-dots.difficulty-avanzato .dot {
    background: #f85149;
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.course-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.course-title {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
}

.course-title.course-completed {
    color: #3fb950;
}

.course-completed-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(63, 185, 80, 0.18);
    color: #3fb950;
    padding: 2px 8px;
    border-radius: 4px;
    vertical-align: middle;
}

.course-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.tag:hover {
    border-color: var(--primary);
    color: var(--text);
}

.tag.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-glow);
}

.course-body .btn {
    margin-top: auto;
    text-align: center;
    justify-content: center;
}

/* ── Course detail ──────────────────────────────────────────────────── */

.course-detail {
    max-width: 1600px;
    margin: 0 auto;
}

.course-detail-header {
    margin-bottom: 56px;
}

.course-detail-header h1 {
    font-size: 52px;
    font-weight: 600;
    margin-bottom: 22px;
}

.course-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
}

.btn-enroll {
    display: inline-flex;
    font-size: 18px;
    font-weight: 700;
    padding: 14px 32px;
    margin: 24px 0;
    color: #000;
}

.enroll-form {
    margin: 0;
}

.course-detail-description {
    color: var(--muted);
    font-size: 24px;
    line-height: 1.8;
}

.course-detail-description ul,
.course-detail-description ol {
    padding-left: 40px;
}

.course-detail-description a {
    color: var(--primary);
    text-decoration: none;
}

.course-detail-description a:hover {
    color: var(--primary2);
}

.course-detail-thumbnail {
    float: right;
    margin: 0 0 24px 40px;
    width: 520px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg);
    border: 1px solid var(--border);
}

.course-detail-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.course-stats {
    display: flex;
    justify-content: space-around;
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

.course-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.course-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.course-stat-label {
    font-size: 15px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.course-section {
    margin-bottom: 48px;
}

.course-section h2 {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* ── Hierarchical TOC ───────────────────────────────────────────────── */

.course-toc {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.toc-module {
}

.toc-module-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
}

.toc-module-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
    min-width: 44px;
    text-align: center;
}

.toc-module-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text);
}

.toc-lessons {
    list-style: none;
    padding: 0 0 16px 58px;
    margin: 0;
}

.toc-lessons li {
    padding: 10px 0 10px 40px;
    font-size: 22px;
    color: var(--muted);
    position: relative;
}

.toc-lessons li::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.5;
}

/* ── Course link cards (prerequisites / next) ───────────────────────── */

.course-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
    gap: 32px;
}

.course-link-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.course-link-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 16px var(--primary-glow);
}

.course-link-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: var(--bg);
}

.course-link-body {
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.course-link-title {
    font-size: 22px;
    font-weight: 600;
}

@media (max-height: 800px) and (min-width: 601px) {
    .course-detail-header h1 {
        font-size: 34px;
        margin-bottom: 14px;
    }

    .course-detail-header {
        margin-bottom: 32px;
    }

    .course-detail-description {
        font-size: 17px;
        line-height: 1.6;
    }

    .course-detail-thumbnail {
        width: 360px;
    }

    .btn-enroll {
        font-size: 15px;
        padding: 10px 24px;
        margin: 16px 0;
    }

    .course-section {
        margin-bottom: 32px;
    }

    .course-section h2 {
        font-size: 24px;
        margin-bottom: 14px;
    }

    .toc-module-header {
        padding: 10px 0;
    }

    .toc-module-number {
        font-size: 24px;
        min-width: 32px;
    }

    .toc-module-title {
        font-size: 19px;
    }

    .toc-lessons {
        padding: 0 0 12px 44px;
    }

    .toc-lessons li {
        padding: 6px 0 6px 40px;
        font-size: 15px;
    }

    .course-link-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 20px;
    }

    .course-link-body {
        padding: 14px 16px;
    }

    .course-link-title {
        font-size: 16px;
    }
}

@media (max-width: 600px) {
    .course-detail-thumbnail {
        float: none;
        width: 100%;
        margin: 0 0 24px 0;
    }

    .course-detail-header h1 {
        font-size: 28px;
    }

    .course-detail-description {
        font-size: 16px;
        line-height: 1.6;
    }

    .toc-module-number {
        font-size: 24px;
        min-width: 32px;
    }

    .toc-module-title {
        font-size: 18px;
    }

    .toc-lessons {
        padding: 0 0 12px 40px;
    }

    .toc-lessons li {
        font-size: 15px;
        padding: 6px 0 6px 28px;
    }

    .course-link-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Teachers ───────────────────────────────────────────────────────── */

.teacher-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.teacher-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    padding: 32px 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 280px;
}

.teacher-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 16px var(--primary-glow);
}

.teacher-photo {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
}

.teacher-photo-placeholder {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: var(--muted);
}

.teacher-name {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.teacher-title {
    font-size: 16px;
    color: var(--muted);
    text-align: center;
    margin-top: 4px;
}

.teacher-detail {
    max-width: 900px;
    margin: 0 auto;
}

.teacher-detail-header {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-bottom: 40px;
}

.teacher-detail-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.teacher-detail-info h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.teacher-detail-title {
    font-size: 18px;
    color: var(--muted);
}

.teacher-detail-bio {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.8;
}

.teacher-detail-bio a {
    color: var(--primary);
    text-decoration: none;
}

.teacher-detail-bio a:hover {
    color: var(--primary2);
}

/* ── Filter bar ─────────────────────────────────────────────────────── */

.filter-bar {
    margin-top: 24px;
}

.filter-toggle {
    font-size: 15px;
    padding: 10px 22px;
    cursor: pointer;
}

.filter-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.filter-panel.open {
    display: flex;
}

.filter-group {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.filter-group-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
    min-width: 90px;
    flex-shrink: 0;
}

.filter-group-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    font-size: 15px;
    padding: 7px 16px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s, color 0.1s;
}

.filter-tag:hover {
    border-color: var(--muted);
    color: var(--text);
}

.filter-tag.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.filter-difficulty.difficulty-principiante {
    border-color: rgba(63, 185, 80, 0.5);
    color: #3fb950;
}

.filter-difficulty.difficulty-intermedio {
    border-color: rgba(210, 153, 34, 0.5);
    color: #d29922;
}

.filter-difficulty.difficulty-avanzato {
    border-color: rgba(248, 81, 73, 0.5);
    color: #f85149;
}

.filter-difficulty.difficulty-principiante.active {
    background: rgba(63, 185, 80, 0.9);
    border-color: #3fb950;
    color: #fff;
}

.filter-difficulty.difficulty-intermedio.active {
    background: rgba(210, 153, 34, 0.9);
    border-color: #d29922;
    color: #fff;
}

.filter-difficulty.difficulty-avanzato.active {
    background: rgba(248, 81, 73, 0.9);
    border-color: #f85149;
    color: #fff;
}

/* Admin */
.admin-student-header {
    margin-bottom: 32px;
}

.admin-section-title {
    font-size: 1.6rem;
    margin: 32px 0 16px;
    color: #e6edf3;
}

.admin-table-wrapper {
    overflow-x: auto;
}

.admin-table-centered {
    max-width: 900px;
    margin: 0 auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.3rem;
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #30363d;
}

.admin-table th {
    color: #8b949e;
    font-weight: 600;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table th[data-sort] {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 28px;
    transition: color 0.15s;
}

.admin-table th[data-sort]:hover {
    color: #e6edf3;
}

.admin-table th[data-sort]::after {
    content: '⇅';
    position: absolute;
    right: 8px;
    opacity: 0.3;
    font-size: 0.85em;
}

.admin-table th.sort-asc::after {
    content: '↑';
    opacity: 1;
    color: #ee72f1;
}

.admin-table th.sort-desc::after {
    content: '↓';
    opacity: 1;
    color: #ee72f1;
}

.admin-table td {
    color: #c9d1d9;
}

.admin-table-row-link {
    cursor: pointer;
    transition: background 0.15s;
}

.admin-table-row-link:hover {
    background: #161b22;
}

.admin-status-complete {
    color: #3fb950;
    font-weight: 600;
}

.admin-status-progress {
    color: #d29922;
    font-weight: 600;
}

.admin-subnav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid #30363d;
    padding-bottom: 8px;
}

.admin-subnav a {
    padding: 8px 16px;
    color: #8b949e;
    text-decoration: none;
    border-radius: 6px 6px 0 0;
    font-size: 1.4rem;
    transition: color 0.15s, background 0.15s;
}

.admin-subnav a:hover {
    color: #e6edf3;
    background: #161b22;
}

.admin-subnav a.active {
    color: #e6edf3;
    border-bottom: 2px solid #ee72f1;
}

.admin-weekly {
    max-width: 900px;
    margin: 0 auto;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.admin-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 16px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
}

.admin-stat-value {
    font-size: 2.8rem;
    font-weight: 700;
    color: #ee72f1;
}

.admin-stat-label {
    font-size: 1.1rem;
    color: #8b949e;
}

.admin-top-courses {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-top-course {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    font-size: 1.2rem;
}

.admin-top-rank {
    font-weight: 700;
    color: #ee72f1;
    font-size: 1.4rem;
    min-width: 40px;
}

.admin-top-title {
    flex: 1;
    color: #e6edf3;
}

.admin-top-minutes {
    color: #8b949e;
    font-size: 1.1rem;
}

@media (max-width: 600px) {
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1400px) {
    .course-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .course-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .course-grid {
        grid-template-columns: 1fr;
    }

    .navbar {
        height: auto;
        padding: 12px clamp(16px, 4vw, 24px);
        flex-wrap: wrap;
    }

    .brand-name {
        font-size: 16px;
    }

    .navbar-links {
        gap: 16px;
    }

    .navbar-links a,
    .navbar-links .nav-link-btn {
        font-size: 14px;
        line-height: 1;
    }

    .container {
        padding: 24px 16px;
    }
}

.error-page {
    text-align: center;
    padding: 80px 20px;
}
.error-page h1 {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 16px;
}
.error-page p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.admin-sort-link {
    color: inherit;
    text-decoration: none;
}
.admin-sort-link:hover {
    text-decoration: underline;
}

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}
.admin-pagination-info {
    color: var(--text-muted);
}

.mobile-break {
    display: none;
}
@media (max-width: 600px) {
    .mobile-break {
        display: block;
    }
}
