/* ═══════════════════════════════════════════════════════
   COURSE PAGE STYLES
   ═══════════════════════════════════════════════════════ */

/* ─── Header ─── */
.course-header {
    padding: 80px 0 40px;
    background: var(--gradient-hero);
}

.course-header__grid {
    display: grid;
    grid-template-areas:
        "nav ."
        "info visual";
    grid-template-columns: 1fr auto;
    gap: 0 clamp(24px, 5vw, 60px);
    align-items: flex-start;
}

.course-header__back {
    grid-area: nav;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s var(--ease-out);
    opacity: 0.8;
}

.course-header__back:hover {
    color: var(--primary);
    transform: translateX(-4px);
    opacity: 1;
}

.course-header__back svg {
    transition: transform 0.3s var(--ease-out);
}

.course-header__info {
    grid-area: info;
}

.course-header__visual {
    grid-area: visual;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
    margin-top: 14px;
    /* Align precisely with the top of the title text capital letters */
    line-height: 1;
}

.course-header__number {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    opacity: 0.12;
    line-height: 1;
    color: var(--text);
}

.course-header__icon {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    opacity: 0.6;
    flex-shrink: 0;
    line-height: 0;
}

.course-header__icon svg {
    width: 1em;
    height: 1em;
    stroke: var(--course-color, currentColor);
}

.course-header__title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--text);
    margin: 0;
    margin-bottom: 8px;
    line-height: 1.1;
}

.course-header__slogan {
    font-size: 1.15rem;
    color: var(--red);
    font-weight: 600;
    margin-bottom: 12px;
}

.course-header__desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    width: 100%;
}

.course-header__meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.meta-tag {
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ─── Progress ─── */
.course-progress {
    padding: 24px 0;
    background: var(--surface-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 90;
}

.course-progress__bar {
    height: 10px;
    background: var(--border);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 8px;
}

.course-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--amber), var(--red));
    border-radius: 100px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.course-progress__text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ─── Lessons List ─── */
.course-lessons {
    padding: 48px 0 32px;
}

.lessons-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ─── Lesson Card ─── */
.lesson-card {
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow 0.3s;
    scroll-margin-top: 120px;
}

.lesson-card:hover {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.lesson-card--locked {
    opacity: 0.5;
}

.lesson-card--locked .lesson-card__header {
    cursor: not-allowed;
}

.lesson-card__check.locked {
    opacity: 0.8;
}

.lesson-card__header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 28px;
    cursor: pointer;
    user-select: none;
}

.lesson-card__num {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.lesson-card__titles {
    flex: 1;
}

.lesson-card__title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.lesson-card__subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.lesson-card__check {
    font-size: 1.2rem;
    opacity: 0.3;
    flex-shrink: 0;
    transition: opacity 0.3s;
}

.lesson-card__check.done {
    opacity: 1;
}

.lesson-card__arrow {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.3s;
    flex-shrink: 0;
}

/* ─── Lesson Body (Accordion) ─── */
.lesson-card__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.lesson-card__body.open {
    max-height: 3000px;
}

.lesson-card__content {
    padding: 0 28px 8px;
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

/* ─── Content Blocks ─── */
.lc-text {
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 16px;
}

.lc-heading {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin: 24px 0 12px;
}

.lc-subheading {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin: 20px 0 6px;
}

.lc-list {
    margin: 0 0 16px;
    padding-left: 0;
    list-style-position: inside;
}

.lc-list li {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 6px;
    position: relative;
}

.lc-list li::marker {
    color: var(--amber);
}

.lc-warning {
    background: #FFF3E0;
    border-left: 4px solid #FF9800;
    padding: 16px 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 16px 0;
    color: #7A4A00;
}

.lc-tip {
    background: #E8F5E9;
    border-left: 4px solid #4CAF50;
    padding: 16px 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 16px 0;
    color: #1B5E20;
}

.lc-formula {
    background: var(--surface-dark);
    color: white;
    font-family: monospace;
    font-size: 1.2rem;
    text-align: center;
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 16px 0;
    font-weight: 600;
}

.lc-table-wrap {
    overflow-x: auto;
    margin: 16px 0;
}

.lc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.lc-table th,
.lc-table td {
    padding: 12px 16px;
    border: 1px solid var(--border);
    text-align: left;
}

.lc-table th {
    background: var(--surface-bg);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ─── Quiz ─── */
.quiz {
    padding: 24px 28px 28px;
    background: var(--surface-bg);
    border-top: 1px solid var(--border);
}

.quiz__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.quiz__question {
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--text);
}

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

.quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    color: var(--text);
}

.quiz-option:hover {
    border-color: var(--accent, var(--amber));
    background: rgba(250, 174, 65, 0.05);
}

.quiz-option__letter {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--surface-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.quiz-option.correct {
    border-color: #4CAF50;
    background: #E8F5E9;
}

.quiz-option.correct .quiz-option__letter {
    background: #4CAF50;
    color: white;
}

.quiz-option.wrong {
    border-color: #F44336;
    background: #FFEBEE;
}

.quiz-option.wrong .quiz-option__letter {
    background: #F44336;
    color: white;
}

.quiz__reset {
    /* Base styles come from .btn and .btn--primary now */
    border: none;
    padding: 14px 32px !important;
    /* Force lg style */
    font-size: 0.95rem;
    font-weight: 700;
}

/* ─── Final Test ─── */
.course-test {
    padding: 48px 0;
}

.course-test__card {
    text-align: center;
    background: var(--gradient-hero);
    border-radius: var(--radius-xl);
    padding: 60px 40px;
}

.course-test__icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.course-test__title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.course-test__desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ─── Footer ─── */
.course-footer {
    padding: 40px 0 60px;
    text-align: center;
}

/* ─── Back link ─── */
.navbar__back {
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.navbar__back:hover {
    color: var(--red);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .course-header__grid {
        grid-template-areas:
            "nav visual"
            "info info";
        grid-template-columns: 1fr auto;
        gap: 24px 16px;
        align-items: center;
    }

    .course-header__back {
        margin-bottom: 0;
    }

    .course-header__visual {
        margin-top: 0;
        gap: 12px;
    }

    .course-header__number {
        font-size: 2.5rem;
    }

    .course-header__icon {
        font-size: 2.5rem;
    }

    .course-header__info {
        text-align: center;
    }

    .course-header__meta {
        justify-content: center;
    }

    .lesson-card__content {
        padding: 0 20px 8px;
        padding-top: 20px;
    }

    .quiz {
        padding: 20px;
    }


    .course-test__card {
        padding: 40px 24px;
    }
}

/* Navbar styles are inherited from style.css */