/* Vyuka pouziva stejny layout, barvy a ovladaci principy jako hlavni aplikace. */

.edu-page {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    min-width: 0;
    background: transparent;
}

#app-container {
    width: min(100%, 1120px);
    max-width: 100%;
    min-height: 0;
    min-width: 0;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

#edu-header {
    width: 100%;
    min-width: 0;
    padding: 0 0 18px;
}

#edu-main-content,
#view-dashboard,
#view-lesson {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.course-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 6vw, 52px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--surface) 92%, transparent), var(--primary-soft)),
        var(--surface);
    box-shadow: var(--shadow-2);
}

.course-hero::after {
    position: absolute;
    right: -60px;
    bottom: -90px;
    width: 260px;
    height: 260px;
    border: 42px solid rgba(26, 115, 232, 0.10);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.course-eyebrow,
.course-section-kicker,
.lesson-step {
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.course-hero h1 {
    position: relative;
    z-index: 1;
    max-width: 650px;
    margin: 8px 0 12px;
    font-size: clamp(32px, 6vw, 48px);
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}

.course-hero > p {
    position: relative;
    z-index: 1;
    max-width: 660px;
    margin: 0;
    color: var(--on-surface-variant);
    font-size: 17px;
    overflow-wrap: anywhere;
}

.course-overall {
    position: relative;
    z-index: 1;
    max-width: 560px;
    margin-top: 28px;
}

.course-overall-copy {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 9px;
    color: var(--on-surface-variant);
    font-size: 14px;
}

.course-overall-track,
.progress-bar-bg {
    overflow: hidden;
    height: 9px;
    border-radius: 999px;
    background: #d7e3f7;
}

#course-overall-progress,
.progress-bar-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width 260ms ease;
}

#progress-container {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 44px;
}

.progress-bar-bg {
    flex: 1;
}

.close-btn {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 28px;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus-visible {
    background: var(--surface-container);
    color: var(--text);
}

#view-dashboard {
    padding: 0 0 56px;
}

.course-instruction {
    margin: 4px 0 24px;
    color: var(--muted);
    font-size: 15px;
}

.course-section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.course-section + .course-section {
    margin-top: 28px !important;
    padding-top: 28px !important;
    border-top-style: solid !important;
}

.course-section-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.course-section-number {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 18px;
    font-weight: 800;
}

.course-section-heading h3 {
    margin: 2px 0 0;
    font-size: 21px;
}

.lesson-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.lesson-card {
    position: relative;
    min-width: 0;
    min-height: 104px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.lesson-card:hover,
.lesson-card:focus-visible {
    border-color: var(--primary);
    box-shadow: var(--shadow-2);
    outline: none;
    transform: translateY(-1px);
}

.lesson-card.active {
    border-color: #8ab4f8;
    background: var(--primary-soft);
}

.lesson-card.locked {
    background: var(--surface-container-low);
    color: var(--muted);
    cursor: not-allowed;
    box-shadow: none;
}

.lesson-card.locked:hover,
.lesson-card.locked:focus-visible {
    border-color: var(--line);
    box-shadow: none;
    transform: none;
}

.lesson-card-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 24px;
}

.lesson-card.completed .lesson-card-icon {
    background: var(--good-bg);
    color: var(--good);
}

.lesson-card.locked .lesson-card-icon {
    background: var(--surface-container-high);
    color: var(--muted);
}

.lesson-card-title {
    margin: 0 0 3px;
    font-size: 16px;
    overflow-wrap: anywhere;
}

.lesson-card-desc {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.lesson-card-status {
    color: var(--primary);
    font-size: 18px;
    font-weight: 800;
    text-align: center;
}

.lesson-card.completed .lesson-card-status {
    color: var(--good);
}

#view-lesson {
    flex: 1;
    padding: 12px 0 124px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

#question-container,
#lesson-complete {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: clamp(26px, 5vw, 44px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-2);
}

.lesson-step {
    margin-bottom: 10px;
}

#question-title {
    margin: 0 0 12px;
    font-size: clamp(25px, 4vw, 32px);
    letter-spacing: -0.02em;
}

#question-text {
    margin: 0 0 28px;
    color: var(--text);
    font-size: 18px;
    line-height: 1.65;
    white-space: pre-line;
}

.options-grid {
    display: grid;
    gap: 12px;
}

.edu-page .option-card {
    position: relative;
    width: 100%;
    min-height: 68px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 15px 16px;
    overflow: hidden;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    box-shadow: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.edu-page .option-card::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: transparent;
    content: "";
}

.edu-page .option-card:hover:not(:disabled),
.edu-page .option-card:focus-visible:not(:disabled) {
    border-color: #8ab4f8;
    background: #f7faff;
    color: var(--text);
    outline: none;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.14);
}

.option-marker {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
}

.option-label {
    min-width: 0;
}

.option-state {
    display: none;
    min-height: 28px;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.edu-page .option-card.selected,
.edu-page .option-card.selected:hover:not(:disabled),
.edu-page .option-card.selected:focus-visible:not(:disabled) {
    border-color: var(--primary);
    background: #d2e3fc;
    color: #174ea6;
    box-shadow: 0 0 0 1px var(--primary), 0 5px 16px rgba(26, 115, 232, 0.18);
    transform: translateY(-1px);
}

.edu-page .option-card.selected::before {
    background: var(--primary);
}

.option-card.selected .option-marker {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.option-card.selected .option-state {
    display: inline-flex;
    background: var(--primary);
    color: #fff;
}

.edu-page .option-card.correct {
    border-color: var(--good);
    background: var(--good-bg);
    color: var(--good);
    box-shadow: 0 0 0 1px var(--good);
}

.edu-page .option-card.correct::before {
    background: var(--good);
}

.option-card.correct .option-marker,
.option-card.correct .option-state {
    border-color: var(--good);
    background: var(--good);
    color: #fff;
}

.option-card.correct .option-state,
.option-card.incorrect .option-state {
    display: inline-flex;
}

.edu-page .option-card.incorrect {
    border-color: var(--danger);
    background: var(--danger-bg);
    color: var(--danger);
    box-shadow: 0 0 0 1px var(--danger);
}

.edu-page .option-card.incorrect::before {
    background: var(--danger);
}

.option-card.incorrect .option-marker,
.option-card.incorrect .option-state {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}

.edu-page .option-card:disabled {
    cursor: default;
    opacity: 1;
}

.lesson-complete-content {
    padding: 22px 0;
    text-align: center;
}

.lesson-complete-symbol {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--good-bg);
    color: var(--good);
    font-size: 40px;
    font-weight: 800;
}

#lesson-footer {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 30;
    width: min(calc(100% - 40px), 760px);
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: 8px 8px 0 0;
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    box-shadow: 0 -4px 20px rgba(60, 64, 67, 0.10);
    backdrop-filter: blur(10px);
    transform: translateX(-50%);
}

#lesson-footer.state-correct {
    border-color: var(--good);
    background: var(--good-bg);
}

#lesson-footer.state-incorrect {
    border-color: var(--danger);
    background: var(--danger-bg);
}

#feedback-message {
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
}

.primary-btn {
    min-width: 156px;
    min-height: 46px;
    padding: 11px 24px;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.22);
}

.primary-btn:hover:not(:disabled),
.primary-btn:focus-visible:not(:disabled) {
    background: var(--primary-hover);
    color: #fff;
    outline: none;
    box-shadow: 0 3px 8px rgba(60, 64, 67, 0.24);
}

.primary-btn:disabled {
    background: var(--surface-container-high);
    color: var(--muted);
    box-shadow: none;
    cursor: not-allowed;
}

:root[data-theme="dark"] .course-hero {
    border-color: var(--line);
    background: linear-gradient(135deg, var(--surface), var(--primary-soft));
}

:root[data-theme="dark"] .course-overall-track,
:root[data-theme="dark"] .progress-bar-bg {
    background: var(--surface-container-high);
}

:root[data-theme="dark"] .edu-page .option-card:hover:not(:disabled) {
    background: var(--surface-container);
}

:root[data-theme="dark"] .edu-page .option-card.selected {
    background: var(--primary-soft);
    color: var(--text);
}

@media (max-width: 720px) {
    #app-container {
        width: 100%;
        min-height: 0;
    }

    #edu-header {
        padding-top: 0;
    }

    .course-hero,
    .course-section,
    #question-container,
    #lesson-complete {
        border-radius: 8px;
    }

    .course-hero,
    .course-section {
        padding: 22px;
    }

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

    .course-overall-copy {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    #question-text {
        font-size: 17px;
    }

    .edu-page .option-card {
        grid-template-columns: 28px minmax(0, 1fr);
        padding: 14px;
    }

    .option-state {
        grid-column: 2;
        justify-self: start;
        margin-top: 2px;
    }

    #lesson-footer {
        left: 0;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 0;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        transform: none;
    }

    .primary-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lesson-card,
    .edu-page .option-card,
    #course-overall-progress,
    .progress-bar-fill {
        transition: none;
    }
}
