/* ReviewScene.css - Fullscreen refined layout */

/* ============================================================
   SCORE SUMMARY HEADER
   ============================================================ */

.review-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.summary-box {
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
}

.summary-number {
    font-family: "Chakra", sans-serif;
    display: block;
    font-size: 1.2rem;
}

.summary-label {
    font-family: "Inter", sans-serif;
    font-size: 0.8rem;
    opacity: 0.85;
}

.summary-box.correct {
    background: #e8f6ea;
    color: #0a6b2d;
}

.summary-box.wrong {
    background: #fdecea;
    color: #9d2a2a;
}

.summary-box.skipped {
    background: #fff4db;
    color: #8a5a00;
}

.summary-box.score {
    font-family: "Chakra", sans-serif;
    background: #eef6ff;
    color: #0b3f91;
}

/* ============================================================
   REVIEW QUESTION IMAGE
   ============================================================ */

.review-question-image {
    width: 100%;
    max-width: 420px;
    margin: 8px 0 10px;
    border-radius: 8px;
    display: block;
    pointer-events: none;
}

/* ============================================================
   FULLSCREEN REVIEW SCREEN
   ============================================================ */

.review-screen.overlay-screen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;

    display: flex;
    justify-content: center;
    align-items: stretch;

    background: rgba(0, 0, 0, 0.45);

    box-sizing: border-box;
}

/* ============================================================
   MAIN CONTAINER
   ============================================================ */

.review-container {
    width: 100%;
    height: 100%;

    background: #ffffff;

    border-radius: 0;

    display: flex;
    flex-direction: column;

    padding: 10px;

    box-sizing: border-box;

    animation: cardEnter 420ms ease-out forwards;
}

/* ============================================================
   TITLE
   ============================================================ */

.review-title {
    font-family: "Sora", sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: #0b2a3a;
    margin: 0 0 10px 0;
    flex-shrink: 0;
}

/* ============================================================
   SCROLLABLE LIST
   ============================================================ */

.review-list {
    flex: 1;

    /*
     * Important for flexbox scrolling.
     * Allows this element to shrink correctly
     * instead of forcing the final content outside
     * the available space.
     */
    min-height: 0;

    overflow-y: auto;

    display: flex;
    flex-direction: column;

    gap: 8px;

    padding-right: 4px;

    /*
     * Extra bottom space ensures the final question card
     * can be scrolled completely above the button bar.
     */
    padding-bottom: 24px;

    margin-bottom: 10px;

    /*
     * Prevent the scrollbar from sitting directly
     * against the final card.
     */
    scroll-padding-bottom: 24px;
}

/* ============================================================
   QUESTION CARD
   ============================================================ */

.review-card-item {
    background: #fbfbfb;
    border-radius: 8px;
    padding: 10px;

    border-left: 6px solid #ddd;

    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.04);

    /*
     * Prevent flexbox from shrinking individual
     * question cards when the list becomes long.
     */
    flex-shrink: 0;
}

.review-question {
    font-family: "Inter", sans-serif;
    font-weight: 700;
    color: #0b2a3a;
    margin-bottom: 6px;
}

/* ============================================================
   ANSWERS
   ============================================================ */

.review-answers {
    font-family: "Inter", sans-serif;

    display: grid;
    grid-template-columns: 1fr;

    gap: 6px;
}

.review-your-answer.correct {
    background: #e8f6ea;
    color: #0a6b2d;

    padding: 8px;
    border-radius: 6px;
}

.review-your-answer.wrong {
    background: #fdecea;
    color: #9d2a2a;

    padding: 8px;
    border-radius: 6px;
}

.review-correct-answer {
    font-family: "Chakra", sans-serif;

    background: #eef6ff;
    color: #0b3f91;

    padding: 8px;
    border-radius: 6px;
}

/* ============================================================
   EXPLANATION
   ============================================================ */

.review-explanation {
    font-family: "Chakra", sans-serif;

    background: #f9f9f9;

    padding: 8px;
    border-radius: 6px;

    font-size: 0.95rem;

    /*
     * Make sure long explanations wrap instead of
     * overflowing horizontally.
     */
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* ============================================================
   BUTTON BAR
   ============================================================ */

.review-buttons {
    position: sticky;
    bottom: 0;

    background: #ffffff;

    padding: 12px 0 4px;

    display: grid;
    grid-template-columns: repeat(3, 1fr);

    gap: 10px;

    border-top: 1px solid #eee;

    flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.review-buttons .review-btn {
    width: 100%;
    min-height: 56px;

    box-sizing: border-box;

    padding: 10px 12px;

    border-radius: 12px;
    border: none;

    cursor: pointer;

    font-family: "Sora", sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.2;
    letter-spacing: 0.2px;

    transition:
        transform 0.15s ease,
        filter 0.15s ease;

    -webkit-tap-highlight-color: transparent;
}

.review-buttons .review-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.review-buttons .review-btn:active {
    transform: translateY(0);
}

/* ============================================================
   BACK BUTTON
   ============================================================ */

.review-btn.back {
    background: #0a2a43;
    color: #cfd8e7;
    border: 1px solid #a3b8dc;
}

/* ============================================================
   RETRY BUTTON
   ============================================================ */

.review-btn.retry {
    background: #087f5b;
    color: #ffffff;
}

/* ============================================================
   HOME BUTTON
   ============================================================ */

.review-btn.home {
    background: #1b4d8c;
    color: #ffffff;
}

/* ============================================================
   SMALL SCREENS
   ============================================================ */

@media (max-width: 600px) {
    .review-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 7px;
    }

    .review-buttons .review-btn {
        min-height: 54px;
        padding: 9px 6px;
        font-size: 12px;
        line-height: 1.2;
        letter-spacing: 0;
    }

    .review-list {
        padding-bottom: 28px;
        scroll-padding-bottom: 28px;
    }
}

@media (max-width: 380px) {
    .review-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }

    .review-buttons .review-btn {
        min-height: 52px;
        padding: 8px 4px;
        font-size: 11px;
        line-height: 1.15;
    }

    .review-list {
        padding-bottom: 32px;
        scroll-padding-bottom: 32px;
    }
}

/* ============================================================
   ANIMATION
   ============================================================ */

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}