/* =========================================================
   TeamElektro Lern-App
   pruefung.css

   Abschlussprüfung Netzwerkgrundlagen
   ========================================================= */


/* =========================================================
   1. PRÜFUNGSBEREICH
   ========================================================= */

.exam-container {
    padding: 3rem 0 5rem;
    background: var(--color-background, #f5f8fc);
}

.exam-container .content-container {
    width: min(100% - 2rem, 1000px);
    margin-inline: auto;
}


/* =========================================================
   2. PRÜFUNGSEINLEITUNG
   ========================================================= */

.exam-intro {
    margin-bottom: 2rem;
}

.exam-intro-card {
    position: relative;
    overflow: hidden;

    padding: 2rem;

    background: #ffffff;

    border: 1px solid #dce7f3;
    border-radius: 20px;

    box-shadow:
        0 10px 30px rgba(0, 63, 135, 0.08);
}

.exam-intro-card::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 5px;

    background: linear-gradient(
        90deg,
        #003f87,
        #006bb6
    );
}

.exam-intro-card h2 {
    margin-top: 0.4rem;
    margin-bottom: 0.75rem;

    color: #003f87;
}

.exam-intro-card > p {
    max-width: 760px;

    margin: 0;

    color: #526477;

    line-height: 1.7;
}


/* =========================================================
   3. PRÜFUNGS-METADATEN
   ========================================================= */

.exam-meta {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 1rem;

    margin-top: 1.75rem;
}

.exam-meta-item {
    display: flex;
    flex-direction: column;
    justify-content: center;

    min-height: 100px;

    padding: 1rem;

    text-align: center;

    background: #f5f8fc;

    border: 1px solid #dce7f3;
    border-radius: 14px;
}

.exam-meta-item strong {
    display: block;

    margin-bottom: 0.25rem;

    color: #003f87;

    font-size: 1.65rem;
    line-height: 1;
}

.exam-meta-item span {
    color: #5c6d7e;

    font-size: 0.9rem;
}


/* =========================================================
   4. PRÜFUNGSFORMULAR
   ========================================================= */

.exam-form {
    display: flex;
    flex-direction: column;

    gap: 1.5rem;
}


/* =========================================================
   5. FRAGEKARTE
   ========================================================= */

.exam-question {
    position: relative;

    padding: 1.75rem;

    background: #ffffff;

    border: 1px solid #dce7f3;
    border-radius: 18px;

    box-shadow:
        0 8px 24px rgba(0, 63, 135, 0.06);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.exam-question:hover {
    border-color: #b8cee5;

    box-shadow:
        0 12px 30px rgba(0, 63, 135, 0.09);
}

.exam-question h2 {
    margin: 1rem 0 1.35rem;

    color: #1d2d3d;

    font-size: 1.2rem;
    line-height: 1.5;
}


/* =========================================================
   6. FRAGENUMMER
   ========================================================= */

.exam-question-number {
    display: inline-block;

    margin-right: 0.5rem;

    color: #003f87;

    font-size: 0.85rem;
    font-weight: 700;

    letter-spacing: 0.03em;
}


/* =========================================================
   7. THEMENBADGE
   ========================================================= */

.exam-question-topic {
    display: inline-flex;
    align-items: center;

    padding: 0.35rem 0.75rem;

    color: #00569b;
    background: #e6f2ff;

    border-radius: 999px;

    font-size: 0.78rem;
    font-weight: 700;
}


/* =========================================================
   8. ANTWORTBEREICH

   VERBINDLICH:
   Alle Antworten stehen IMMER untereinander.
   ========================================================= */

.exam-options {
    display: grid;

    grid-template-columns: 1fr;

    gap: 0.85rem;

    width: 100%;
}


/* =========================================================
   9. EINZELNE ANTWORT
   ========================================================= */

.exam-option {
    display: flex;
    align-items: flex-start;

    gap: 0.85rem;

    width: 100%;

    padding: 1rem 1.1rem;

    color: #263849;
    background: #f8fafc;

    border: 2px solid #dce7f3;
    border-radius: 12px;

    cursor: pointer;

    line-height: 1.55;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
}

.exam-option:hover {
    background: #eef6ff;

    border-color: #8bb7df;

    transform: translateY(-1px);
}

.exam-option:focus-within {
    border-color: #006bb6;

    box-shadow:
        0 0 0 3px rgba(0, 107, 182, 0.14);
}


/* =========================================================
   10. RADIO BUTTON
   ========================================================= */

.exam-option input[type="radio"] {
    flex: 0 0 auto;

    width: 1.15rem;
    height: 1.15rem;

    margin: 0.18rem 0 0;

    accent-color: #006bb6;

    cursor: pointer;
}

.exam-option span {
    flex: 1;

    min-width: 0;
}


/* =========================================================
   11. AUSGEWÄHLTE ANTWORT
   ========================================================= */

.exam-option:has(
    input[type="radio"]:checked
) {
    color: #003f87;

    background: #e6f2ff;

    border-color: #006bb6;

    box-shadow:
        0 5px 16px rgba(0, 107, 182, 0.10);
}


/* JS-Fallback */

.exam-option.selected {
    color: #003f87;

    background: #e6f2ff;

    border-color: #006bb6;
}


/* =========================================================
   12. RICHTIGE ANTWORT
   ========================================================= */

.exam-option.correct,
.exam-option.is-correct {
    color: #165c32;

    background: #eaf8ef;

    border-color: #38a169;
}


/* =========================================================
   13. FALSCHE ANTWORT
   ========================================================= */

.exam-option.wrong,
.exam-option.incorrect,
.exam-option.is-wrong {
    color: #8c2f2f;

    background: #fff0f0;

    border-color: #d95c5c;
}


/* =========================================================
   14. FRAGE RICHTIG
   ========================================================= */

.exam-question.correct,
.exam-question.is-correct {
    border-color: #8fd0a6;
}


/* =========================================================
   15. FRAGE FALSCH
   ========================================================= */

.exam-question.wrong,
.exam-question.incorrect,
.exam-question.is-wrong {
    border-color: #e7a2a2;
}


/* Nach Auswertung keine Bewegung mehr */

.exam-question.answered .exam-option:hover,
.exam-question.is-evaluated .exam-option:hover {
    transform: none;
}


/* =========================================================
   16. WARNMELDUNG
   ========================================================= */

.exam-message {
    padding: 1rem 1.2rem;

    border-radius: 12px;

    line-height: 1.55;
}

.exam-message-warning {
    color: #7a5300;

    background: #fff7df;

    border: 1px solid #efd07c;
    border-left: 5px solid #e0a800;
}


/* =========================================================
   17. PRÜFUNGSAKTIONEN
   ========================================================= */

.exam-actions {
    display: flex;
    align-items: center;

    flex-wrap: wrap;

    gap: 0.85rem;

    margin-top: 0.5rem;
}

.exam-actions .button {
    min-width: 220px;
}


/* =========================================================
   18. ERGEBNIS
   ========================================================= */

.exam-result {
    position: relative;

    margin-top: 2.5rem;

    padding: 2.25rem;

    text-align: center;

    background: #ffffff;

    border: 2px solid #b9d5ed;
    border-radius: 20px;

    box-shadow:
        0 12px 35px rgba(0, 63, 135, 0.10);
}

.exam-result[hidden] {
    display: none;
}

.exam-result h2 {
    margin-bottom: 1rem;

    color: #003f87;
}


/* =========================================================
   19. ERGEBNISPUNKTE
   ========================================================= */

.exam-result-score {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 0.4rem;

    margin: 1rem 0;
}

.exam-result-score strong {
    color: #003f87;

    font-size: clamp(
        2.75rem,
        8vw,
        4.5rem
    );

    line-height: 1;
}

.exam-result-score span {
    color: #526477;

    font-size: 1rem;
    font-weight: 600;
}


/* =========================================================
   20. ERGEBNISTEXT
   ========================================================= */

.exam-result-status {
    max-width: 680px;

    margin: 1.25rem auto 0;

    font-size: 1.05rem;
    line-height: 1.65;
}


/* =========================================================
   21. BESTANDEN
   ========================================================= */

.exam-result.passed,
.exam-result.is-passed {
    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #f1fbf4 100%
        );

    border-color: #55b77a;
}

.exam-result.passed
    .exam-result-score strong,

.exam-result.is-passed
    .exam-result-score strong {

    color: #20804a;
}


/* =========================================================
   22. NICHT BESTANDEN
   ========================================================= */

.exam-result.failed,
.exam-result.is-failed {
    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fff6f6 100%
        );

    border-color: #d97979;
}

.exam-result.failed
    .exam-result-score strong,

.exam-result.is-failed
    .exam-result-score strong {

    color: #b23a3a;
}


/* =========================================================
   23. ERGEBNIS-AKTIONEN
   ========================================================= */

.exam-result-actions {
    display: flex;
    justify-content: center;

    flex-wrap: wrap;

    gap: 0.85rem;

    margin-top: 1.75rem;
}


/* =========================================================
   24. DEAKTIVIERTE ANTWORTEN
   ========================================================= */

.exam-option input:disabled {
    cursor: default;
}

.exam-option:has(input:disabled) {
    cursor: default;
}

.exam-actions button:disabled {
    opacity: 0.55;

    cursor: not-allowed;

    transform: none;
}


/* =========================================================
   25. FORTSCHRITTSANZEIGE
   Optional für spätere Erweiterungen
   ========================================================= */

.exam-progress {
    position: sticky;
    top: 90px;

    z-index: 20;

    margin-bottom: 1.5rem;

    padding: 0.8rem 1rem;

    background: rgba(255, 255, 255, 0.96);

    border: 1px solid #dce7f3;
    border-radius: 12px;

    box-shadow:
        0 6px 20px rgba(0, 63, 135, 0.08);

    backdrop-filter: blur(8px);
}

.exam-progress-header {
    display: flex;
    justify-content: space-between;

    gap: 1rem;

    margin-bottom: 0.55rem;

    color: #3c5064;

    font-size: 0.85rem;
    font-weight: 700;
}

.exam-progress-track {
    overflow: hidden;

    width: 100%;
    height: 8px;

    background: #dfeaf5;

    border-radius: 999px;
}

.exam-progress-bar {
    width: 0;
    height: 100%;

    background: linear-gradient(
        90deg,
        #003f87,
        #006bb6
    );

    border-radius: inherit;

    transition: width 0.25s ease;
}


/* =========================================================
   26. VERSTECKTE ELEMENTE
   ========================================================= */

.exam-container [hidden] {
    display: none !important;
}


/* =========================================================
   27. TABLET
   ========================================================= */

@media (max-width: 760px) {

    .exam-container {
        padding-top: 2rem;
        padding-bottom: 4rem;
    }

    .exam-intro-card {
        padding: 1.5rem;
    }

    .exam-meta {
        grid-template-columns: 1fr;
    }

    .exam-meta-item {
        min-height: auto;
    }

    .exam-question {
        padding: 1.4rem;
    }

    /*
     * Auch auf Tablets:
     * Antworten immer untereinander.
     */

    .exam-options {
        grid-template-columns: 1fr;
    }

}


/* =========================================================
   28. SMARTPHONE
   ========================================================= */

@media (max-width: 560px) {

    .exam-container .content-container {
        width: min(
            100% - 1.2rem,
            1000px
        );
    }

    .exam-intro-card,
    .exam-question,
    .exam-result {
        border-radius: 14px;
    }

    .exam-intro-card {
        padding: 1.25rem;
    }

    .exam-question {
        padding: 1.2rem;
    }

    .exam-question-number {
        display: block;

        margin: 0 0 0.6rem;
    }

    .exam-question-topic {
        margin-bottom: 0.25rem;
    }

    .exam-question h2 {
        font-size: 1.08rem;
    }

    /*
     * Auch auf Smartphones:
     * exakt eine Antwort pro Zeile.
     */

    .exam-options {
        grid-template-columns: 1fr;

        gap: 0.7rem;
    }

    .exam-option {
        width: 100%;

        padding: 0.9rem;

        border-radius: 10px;
    }

    .exam-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .exam-actions .button {
        width: 100%;
        min-width: 0;
    }

    .exam-result {
        padding: 1.4rem;
    }

    .exam-result-actions {
        flex-direction: column;
    }

    .exam-result-actions .button {
        width: 100%;
    }

}


/* =========================================================
   29. SEHR KLEINE DISPLAYS
   ========================================================= */

@media (max-width: 380px) {

    .exam-question {
        padding: 1rem;
    }

    .exam-option {
        gap: 0.65rem;

        padding: 0.8rem;
    }

    .exam-meta-item strong {
        font-size: 1.4rem;
    }

}


/* =========================================================
   30. TOUCH-GERÄTE
   ========================================================= */

@media (hover: none) {

    .exam-option:hover {
        background: #f8fafc;

        border-color: #dce7f3;

        transform: none;
    }

    .exam-option:has(
        input[type="radio"]:checked
    ):hover {

        color: #003f87;

        background: #e6f2ff;

        border-color: #006bb6;
    }

}


/* =========================================================
   31. REDUZIERTE BEWEGUNG
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .exam-question,
    .exam-option,
    .exam-progress-bar {
        transition: none;
    }

}


/* =========================================================
   32. DRUCKANSICHT
   ========================================================= */

@media print {

    .exam-container {
        padding: 0;

        background: #ffffff;
    }

    .exam-intro-card,
    .exam-question,
    .exam-result {
        box-shadow: none;
    }

    .exam-question {
        break-inside: avoid;
    }

    .exam-option {
        color: #000000;
        background: #ffffff;

        border: 1px solid #999999;
    }

    .exam-actions,
    .exam-result-actions,
    .exam-progress {
        display: none !important;
    }

}