:root {
    --bg: #faf9f6;
    --card-bg: #ffffff;
    --text: #333333;
    --gray: #7f8c8d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px;
}

.tmf-tests-shell.container {
    max-width: 1320px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
}

h1, h2 {
    text-align: center;
    color: var(--text);
}

/* --- MENU STYLY --- */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.menu-btn {
    border: none;
    padding: 24px;
    font-size: 1.1em;
    font-weight: bold;
    color: var(--text);
    background: white;
    border: 1px solid #e8e2d5;
    border-left: 4px solid var(--test-accent, #cba135);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    text-align: left;
    box-shadow: 0 3px 12px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-height: 120px;
    height: 100%;
}

    .menu-btn:hover {
        transform: translateY(-3px);
        border-color: #cba135;
        box-shadow: 0 6px 16px rgba(0,0,0,0.09);
    }

    .menu-btn span {
        font-weight: normal;
        font-size: 0.85em;
        margin-top: 8px;
        opacity: 0.9;
    }

/* --- TEST STYLY --- */
#quiz-interface {
    display: none;
}

.section-header {
    background-color: #ecf0f1;
    padding: 10px 15px;
    font-weight: bold;
    border-radius: 5px;
    margin-top: 25px;
    margin-bottom: 15px;
    color: var(--text);
   /* border-left: 5px solid #bdc3c7;*/
}

.question-block {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.question-text {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 1.05em;
}

.scale-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.scale-label {
    font-size: 0.8em;
    color: var(--gray);
    width: 120px;
}

    .scale-label.right {
        text-align: right;
    }

.options {
    display: flex;
    gap: 15px;
}

.radio-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

    .radio-wrapper input {
        width: 20px;
        height: 20px;
        cursor: pointer;
        margin-bottom: 5px;
    }

.back-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 20px;
}

    .back-btn:hover {
        background: #7f8c8d;
    }

.evaluate-btn {
    width: 100%;
    padding: 15px;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    cursor: pointer;
    margin-top: 30px;
    font-weight: bold;
}

/* VÝSLEDKY */
#result-box {
    display: none;
    margin-top: 30px;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid transparent;
}

.result-score {
    font-size: 2.5em;
    font-weight: bold;
    margin: 10px 0;
}

.res-low {
    background: #fadbd8;
    border-color: #c0392b;
    color: #c0392b;
}

.res-mid {
    background: #fdebd0;
    border-color: #f39c12;
    color: #d35400;
}

.res-high {
    background: #d5f5e3;
    border-color: #27ae60;
    color: #27ae60;
}

@media (max-width: 600px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }

    .scale-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .options {
        width: 100%;
        justify-content: space-between;
        margin: 10px 0;
    }

    .scale-label {
        width: 100%;
        text-align: left !important;
        font-style: italic;
    }
}

/* Stejny prostredni sloupec pro pole i skaly dotazniku. */
#quiz-content .question-row {
    margin-bottom: 20px;
}

#quiz-content .question-row-inline,
#quiz-content .scale-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 32rem) minmax(0, 1fr);
    align-items: center;
    column-gap: 16px;
}

#quiz-content .question-row-inline > .question-text {
    grid-column: 1;
    margin-bottom: 0;
}

#quiz-content .question-row-inline > .scale-container {
    display: contents;
}

#quiz-content .question-row-inline .scale-label {
    display: none;
}

#quiz-content .scale-label {
    width: auto;
    min-width: 0;
}

#quiz-content .scale-label.right {
    grid-column: 3;
}

#quiz-content .options {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    min-width: 0;
    width: 100%;
    margin: 0;
}

#quiz-content .quiz-option {
    margin: 0;
    white-space: nowrap;
}

#quiz-content .quiz-option-field {
    flex: 0 1 100%;
    min-width: 0;
    text-align: center;
}

#quiz-content .quiz-option-field .form-control {
    width: 100%;
    max-width: 32rem;
    margin: 0 auto;
}

#quiz-content .quiz-option-field input[type="number"] {
    max-width: 8rem;
}

#quiz-content .quiz-option-field .form-check-label:empty {
    display: none;
}

#quiz-content .question-row-inline .options {
    grid-column: 2 / -1;
    justify-content: flex-start;
}

#quiz-content .question-row-inline .quiz-option-field {
    text-align: left;
}

#quiz-content .question-row-inline .quiz-option-field .form-control {
    margin-left: 0;
    margin-right: 0;
}

#quiz-content .question-row-inline .quiz-option-field .form-control:not([type="number"]) {
    width: 30ch;
    max-width: 100%;
}

@media (max-width: 600px) {
    #quiz-content .question-row-inline,
    #quiz-content .scale-container {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        row-gap: 8px;
    }

    #quiz-content .question-row-inline > .question-text {
        grid-column: 1 / -1;
    }

    #quiz-content .options,
    #quiz-content .question-row-inline .options {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    #quiz-content .scale-label.right {
        grid-column: 2;
    }
}

/* Vstupni stranka testu v barvach TMF. */
.tmf-tests-hero {
    display: flex;
    align-items: center;
    min-height: 280px;
    aspect-ratio: 4 / 1;
    background: #f7f4ed url('../images/kategories/testy_1_4.png') right center / cover no-repeat;
    border-radius: 6px;
}

.tmf-tests-hero-text {
    width: 55%;
    padding: 32px;
}

.tmf-tests-hero h1 {
    text-align: left;
    font-size: clamp(2rem, 4vw, 3rem);
    color: #8b6b1d;
    margin: 0 0 12px;
}

.tmf-tests-hero p {
    margin: 0;
    line-height: 1.6;
}

.tmf-tests-heading {
    margin: 28px 0 18px;
    text-align: left;
    font-size: 1.35rem;
}

.tmf-test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 20px;
}

.tmf-test-card {
    min-width: 0;
}

.tmf-test-divider {
    margin: 24px 0;
    border-top: 1px solid #e8e2d5;
}

.menu-btn:focus-visible {
    outline: 2px solid #cba135;
    outline-offset: 3px;
}

@media (max-width: 600px) {
    body.tmf-tests {
        padding: 12px;
    }

    .tmf-tests-shell.container {
        padding: 16px;
    }

    .tmf-tests-hero {
        min-height: 230px;
        aspect-ratio: auto;
        background-image: linear-gradient(90deg, rgba(255,255,255,.95), rgba(255,255,255,.45)), url('../images/kategories/testy_1_4.png');
    }

    .tmf-tests-hero-text {
        width: 78%;
        padding: 20px;
    }

    .tmf-test-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* Detail testu: klidne zvyrazneni bez zmeny ovladani. */
#quiz-interface {
    animation: tmf-quiz-enter .25s ease-out;
}

.tmf-quiz-hero {
    display: flex;
    align-items: center;
    min-height: 180px;
    margin-bottom: 24px;
    padding: 24px 32px;
    border-radius: 6px;
    background: #f7f4ed url('../images/kategories/testy_1_4.png') right center / cover no-repeat;
}

#quiz-title {
    max-width: 60%;
    margin: 0;
    text-align: left;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: #8b6b1d;
}

#main-menu .back-btn {
    display: inline-block;
    text-decoration: none;
}

#quiz-interface .back-btn,
#main-menu .back-btn {
    color: #70571a;
    background: #faf7ef;
    border: 1px solid #e3d6b3;
    border-radius: 6px;
    transition: background-color .18s ease, border-color .18s ease;
}

#quiz-interface .back-btn:hover,
#main-menu .back-btn:hover {
    background: #f2e8cf;
    border-color: #cba135;
}

#quiz-content .section-header {
    background: #f8f6f0;
    border-left: 4px solid #cba135;
    border-bottom: 1px solid var(--section-accent, #e8e2d5);
    padding: 14px 16px;
    font-size: 1.25rem;
}

#quiz-content .question-row {
    padding: 12px;
    border: 1px solid transparent;
    border-bottom-color: #eee9de;
    border-radius: 6px;
    transition: background-color .18s ease, border-color .18s ease;
}

#quiz-content .question-row:focus-within {
    background: #fcfaf4;
    border-color: #dfc77f;
}

#quiz-content .form-control {
    border-radius: 6px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

#quiz-content .form-control:focus {
    border-color: #cba135;
    box-shadow: 0 0 0 3px rgba(203,161,53,.16);
}

#quiz-content .quiz-option:has(input[type="radio"]),
#quiz-content .quiz-option:has(input[type="checkbox"]) {
    padding: 6px 9px;
    border-radius: 6px;
    transition: background-color .18s ease, box-shadow .18s ease;
}

#quiz-content .quiz-option:hover:has(input[type="radio"]),
#quiz-content .quiz-option:hover:has(input[type="checkbox"]) {
    background: #f7f3e7;
}

#quiz-content .quiz-option:has(input:checked) {
    background: #f5ebcd;
    box-shadow: inset 0 0 0 1px #cba135;
}

#quiz-content .form-check-input:checked {
    background-color: #ac8425;
    border-color: #ac8425;
}

#quiz-content .form-check-input:focus {
    border-color: #cba135;
    box-shadow: 0 0 0 3px rgba(203,161,53,.16);
}

#quiz-interface .evaluate-btn {
    color: #332b18;
    background: #dfbf67;
    border: 1px solid #cba135;
    border-radius: 6px;
    transition: background-color .18s ease, box-shadow .18s ease;
}

#quiz-interface .evaluate-btn:hover {
    background: #d5ae48;
    box-shadow: 0 4px 12px rgba(119,88,17,.16);
}

#quiz-interface .back-btn:focus-visible,
#main-menu .back-btn:focus-visible,
#quiz-interface .evaluate-btn:focus-visible {
    outline: 2px solid #ac8425;
    outline-offset: 3px;
}

@keyframes tmf-quiz-enter {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .tmf-quiz-hero {
        min-height: 150px;
        padding: 20px;
        background-image: linear-gradient(90deg, rgba(255,255,255,.95), rgba(255,255,255,.45)), url('../images/kategories/testy_1_4.png');
    }

    #quiz-title {
        max-width: 80%;
    }

    #quiz-content .question-row {
        padding: 10px 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #quiz-interface { animation: none; }
    #quiz-interface .back-btn,
    #main-menu .back-btn,
    #quiz-interface .evaluate-btn,
    #quiz-content .question-row,
    #quiz-content .form-control,
    #quiz-content .quiz-option { transition: none; }
}
