/* =========================================================
   ArabicLearn - Quiz
   ========================================================= */

.quiz-learn-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.quiz-hero {
    padding: 24px 28px;

    background:
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.84),
            rgba(255, 255, 255, 0.60)
        ),
        linear-gradient(135deg, #e8fbff, #fff5df);

    border: 1px solid #dcebf5;
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(31, 60, 90, 0.08);
}

.quiz-hero-kicker {
    margin-bottom: 8px;
    color: #109c9b;
    font-weight: 900;
}

.quiz-hero h2 {
    margin: 0;

    color: #102b56;
    font-size: clamp(1.8rem, 3.2vw, 2.7rem);
    font-weight: 900;
}

.quiz-hero p {
    margin: 10px 0 0;
    color: #44546a;
    font-size: 1.05rem;
}

.quiz-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.quiz-sidebar,
.quiz-main-panel {
    min-width: 0;

    background: white;
    border: 1px solid #e1e8ef;
    border-radius: 22px;
    box-shadow: 0 6px 18px rgba(31, 60, 90, 0.08);
}

.quiz-sidebar {
    position: sticky;
    top: 110px;
    padding: 18px;
}

.quiz-sidebar-title h3 {
    margin: 0 0 14px;

    color: #102b56;
    font-size: 1.1rem;
    font-weight: 900;
}

.quiz-theme-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.quiz-theme-button {
    width: 100%;
    padding: 12px 13px;

    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;

    border: 1px solid #dde7f0;
    border-radius: 15px;
    background: white;
    color: #102b56;

    text-align: left;
    font-weight: 900;
    cursor: pointer;
}

.quiz-theme-button:hover {
    border-color: #b8d7ea;
    background: #f7fbff;
}

.quiz-theme-button.active {
    border-color: #109c9b;
    background: #eefafa;
    box-shadow: 0 6px 16px rgba(16, 156, 155, 0.16);
}

.quiz-theme-arrow {
    color: #109c9b;
    font-size: 1.2rem;
}

.quiz-message {
    color: #66778a;
}

.quiz-main-panel {
    padding: 20px;
}

.quiz-mode-selector {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.quiz-mode-button {
    padding: 14px 16px;

    display: flex;
    flex-direction: column;
    gap: 4px;

    border: 1px solid #dde7f0;
    border-radius: 17px;
    background: #f9fcff;
    color: #102b56;

    text-align: left;
    cursor: pointer;
}

.quiz-mode-button strong {
    font-size: 1rem;
}

.quiz-mode-button span {
    color: #66778a;
    font-size: 0.85rem;
}

.quiz-mode-button.active {
    border-color: #109c9b;
    background: #eefafa;
    box-shadow: 0 6px 16px rgba(16, 156, 155, 0.14);
}

.quiz-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;

    margin-bottom: 20px;
}

.quiz-toolbar-label {
    color: #109c9b;
    font-size: 0.88rem;
    font-weight: 900;
}

.quiz-toolbar h3 {
    margin: 4px 0 0;

    color: #102b56;
    font-size: 1.55rem;
    font-weight: 900;
}

.quiz-toolbar-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.quiz-toolbar-stats span {
    padding: 7px 11px;

    border-radius: 999px;
    background: #eefafa;
    color: #109c9b;

    font-size: 0.85rem;
    font-weight: 900;
}

.quiz-empty-message {
    min-height: 300px;
    padding: 28px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;

    text-align: center;
    background: #f8fbfd;
    border: 1px dashed #c8d7e4;
    border-radius: 20px;
    color: #44546a;
}

.quiz-question {
    text-align: center;
}

.quiz-question-instruction {
    margin-bottom: 18px;

    color: #44546a;
    font-size: 1.05rem;
    font-weight: 800;
}

.quiz-question-image {
    width: min(480px, 100%);
    height: 330px;
    margin: 0 auto 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #f4f8fb;
    border: 1px solid #e1e8ef;
    border-radius: 24px;
    overflow: hidden;
}

.quiz-question-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.quiz-question-word {
    margin: 18px 0 28px;

    direction: rtl;
    text-align: center;

    color: #102b56;
    font-size: clamp(3rem, 7vw, 5rem);
    font-weight: 900;
    line-height: 1.15;
}

.quiz-word-options,
.quiz-image-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.quiz-answer-option {
    border: 2px solid #dde7f0;
    border-radius: 20px;
    background: white;

    cursor: pointer;
    transition:
        transform 0.12s ease,
        border-color 0.12s ease,
        background 0.12s ease,
        box-shadow 0.12s ease;
}

.quiz-answer-option:hover:not(:disabled) {
    transform: translateY(-3px);
    border-color: #109c9b;
    box-shadow: 0 9px 22px rgba(31, 60, 90, 0.12);
}

.quiz-answer-option.correct {
    border-color: #25a45a;
    background: #eaf9f0;
}

.quiz-answer-option.wrong {
    border-color: #d95858;
    background: #fff0f0;
}

.quiz-answer-option:disabled {
    cursor: default;
}

.quiz-word-option {
    min-height: 105px;
    padding: 16px;
}

.quiz-option-arabic {
    direction: rtl;

    color: #102b56;
    font-size: 2.2rem;
    font-weight: 900;
}

.quiz-image-option {
    height: 220px;
    padding: 10px;
    overflow: hidden;
}

.quiz-image-option img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
}

.quiz-feedback {
    min-height: 56px;
    margin-top: 18px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;

    text-align: center;
}

.quiz-feedback.correct {
    color: #218a4c;
}

.quiz-feedback.wrong {
    color: #bc3f3f;
}

.quiz-feedback strong {
    font-size: 1.05rem;
}

.quiz-feedback span {
    color: #44546a;
}

.quiz-actions {
    margin-top: 14px;
    text-align: center;
}

.quiz-primary-button {
    padding: 11px 20px;

    border: none;
    border-radius: 999px;
    background: #102b56;
    color: white;

    font-weight: 900;
    cursor: pointer;
}

.quiz-primary-button:hover {
    background: #173a73;
}

.quiz-result {
    min-height: 300px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.quiz-result-label {
    color: #109c9b;
    font-weight: 900;
}

.quiz-result-score {
    margin-top: 8px;

    color: #102b56;
    font-size: 4rem;
    font-weight: 900;
}

.quiz-result p {
    color: #44546a;
    font-size: 1.1rem;
}

@media (max-width: 900px) {
    .quiz-layout {
        grid-template-columns: 1fr;
    }

    .quiz-sidebar {
        position: static;
    }

    .quiz-theme-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .quiz-word-options,
    .quiz-image-options {
        grid-template-columns: 1fr;
    }

    .quiz-image-option {
        height: 190px;
    }

    .quiz-toolbar {
        display: block;
    }

    .quiz-toolbar-stats {
        margin-top: 10px;
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .quiz-mode-selector,
    .quiz-theme-list {
        grid-template-columns: 1fr;
    }

    .quiz-question-image {
        height: 250px;
    }
}
/* =========================================================
   Sélection multiple : thèmes et niveaux
   ========================================================= */

.quiz-sidebar-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.quiz-sidebar-title h3 {
    margin-bottom: 3px;
}

.quiz-selection-count {
    color: #66778a;
    font-size: 0.78rem;
    font-weight: 700;
}

.quiz-sidebar-actions {
    display: flex;
    gap: 5px;
}

.quiz-small-action {
    padding: 6px 9px;
    border: 1px solid #d8e4ed;
    border-radius: 999px;
    background: #ffffff;
    color: #52647a;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 900;
    cursor: pointer;
}

.quiz-small-action:hover:not(:disabled) {
    border-color: #109c9b;
    background: #eefafa;
    color: #102b56;
}

.quiz-small-action:disabled {
    opacity: 0.45;
    cursor: default;
}

.quiz-theme-marker {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #edf3f8;
    color: #688096;
    font-size: 0.9rem;
    font-weight: 900;
}

.quiz-theme-button.active .quiz-theme-marker {
    background: #109c9b;
    color: #ffffff;
}

.quiz-level-section {
    margin-bottom: 20px;
    padding: 15px 16px;
    border: 1px solid #e1e8ef;
    border-radius: 18px;
    background: #f8fbfd;
}

.quiz-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.quiz-section-heading h3 {
    margin: 3px 0 0;
    color: #102b56;
    font-size: 1.05rem;
    font-weight: 900;
}

.quiz-level-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quiz-level-button {
    min-height: 42px;
    padding: 7px 13px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #d8e4ed;
    border-radius: 999px;
    background: #ffffff;
    color: #102b56;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 900;
    cursor: pointer;
}

.quiz-level-button:hover {
    border-color: #109c9b;
    background: #eefafa;
}

.quiz-level-button.active {
    border-color: #109c9b;
    background: #109c9b;
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(16, 156, 155, 0.16);
}

.quiz-level-stars {
    color: #f2b01e;
    letter-spacing: 1px;
}

.quiz-level-button.active .quiz-level-stars {
    color: #fff4bd;
}

.quiz-start-panel {
    margin-bottom: 20px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid #dce8f1;
    border-radius: 18px;
    background: #ffffff;
}

.quiz-start-panel h3 {
    margin: 4px 0 0;
    color: #102b56;
    font-size: 1rem;
    font-weight: 900;
}

.quiz-primary-button:disabled {
    opacity: 0.45;
    cursor: default;
}

.quiz-question-context {
    display: inline-block;
    margin: -8px auto 16px;
    padding: 6px 11px;
    border-radius: 999px;
    background: #f4f8fb;
    color: #657286;
    font-size: 0.8rem;
    font-weight: 800;
}

@media (max-width: 700px) {
    .quiz-section-heading,
    .quiz-start-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .quiz-start-panel .quiz-primary-button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .quiz-sidebar-title {
        flex-direction: column;
    }

    .quiz-sidebar-actions {
        width: 100%;
    }

    .quiz-small-action {
        flex: 1;
    }

    .quiz-level-list {
        display: grid;
        grid-template-columns: 1fr;
    }

    .quiz-level-button {
        justify-content: center;
    }
}
