/* ============================================================
   THEORY REVIEW SCENE
   ============================================================ */

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

.theory-review-screen {
    position: absolute;

    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
   ============================================================ */

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

    background: #ffffff;

    display: flex;

    flex-direction: column;

    padding: 12px;

    box-sizing: border-box;

    animation:
        cardEnter 420ms ease-out forwards;
}

/* ============================================================
   HEADER
   ============================================================ */

.theory-review-header {
    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    margin-bottom: 10px;
}

.theory-review-header h2 {
    font-family: "Sora", sans-serif;

    font-size: 1.4rem;

    font-weight: 700;

    color: #0b2a3a;

    margin: 0;
}

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

    font-size: 12px;

    color: #6b7280;

    margin-top: 3px;
}

.theory-review-status {
    flex-shrink: 0;

    padding: 7px 12px;

    border-radius: 20px;

    background: #eef6ff;

    color: #0b3f91;

    font-family: "Chakra", sans-serif;

    font-size: 12px;

    font-weight: 700;

    text-transform: capitalize;
}

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

.theory-review-list {
    flex: 1;

    min-height: 0;

    overflow-y: auto;

    display: flex;

    flex-direction: column;

    gap: 10px;

    padding-right: 4px;

    padding-bottom: 28px;

    margin-bottom: 10px;

    scroll-padding-bottom: 28px;
}

.theory-review-list::-webkit-scrollbar {
    width: 8px;
}

.theory-review-list::-webkit-scrollbar-thumb {
    background: #d1d5db;

    border-radius: 8px;
}

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

.theory-review-card {
    flex-shrink: 0;

    background: #fbfbfb;

    border-radius: 10px;

    padding: 12px;

    border-left: 6px solid #0a2a43;

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

.theory-review-question-header {
    font-family: "Sora", sans-serif;

    font-weight: 700;

    font-size: 14px;

    color: #0a2a43;

    padding-bottom: 9px;

    margin-bottom: 10px;

    border-bottom: 1px solid #e5e7eb;
}

/* ============================================================
   PART
   ============================================================ */

.theory-review-part {
    background: #ffffff;

    border: 1px solid #e5e7eb;

    border-radius: 9px;

    padding: 10px;

    margin-bottom: 8px;
}

.theory-review-part:last-child {
    margin-bottom: 0;
}

.theory-review-part-header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 10px;

    margin-bottom: 7px;

    font-family: "Chakra", sans-serif;

    font-size: 12px;

    font-weight: 700;

    color: #374151;
}

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

    color: #0b2a3a;

    font-size: 14px;

    line-height: 1.55;

    margin-bottom: 9px;
}

.theory-review-text-b {
    font-family: "Inter", sans-serif;

    color: #374151;

    font-size: 13px;

    line-height: 1.5;

    margin-bottom: 9px;
}

/* ============================================================
   QUESTION IMAGES
   ============================================================ */

.theory-review-question-image {
    display: block;

    width: 100%;

    max-width: 500px;

    margin: 10px auto;

    border-radius: 9px;
}

/* ============================================================
   ANSWER LABEL
   ============================================================ */

.theory-review-answer-label {
    font-family: "Sora", sans-serif;

    font-size: 11px;

    font-weight: 700;

    color: #0a2a43;

    margin-bottom: 5px;

    text-transform: uppercase;

    letter-spacing: 0.4px;
}

/* ============================================================
   ANSWER
   ============================================================ */

.theory-review-answer {
    background: #eef6ff;

    border: 1px solid #d6e7fa;

    border-radius: 8px;

    padding: 9px;

    overflow-x: auto;
}

.theory-review-text-answer {
    font-family: "Inter", sans-serif;

    color: #1f2937;

    font-size: 14px;

    line-height: 1.6;

    white-space: pre-wrap;

    overflow-wrap: break-word;
}

.theory-review-empty-answer,
.theory-review-empty {
    font-family: "Inter", sans-serif;

    color: #6b7280;

    font-size: 13px;

    font-style: italic;
}

/* ============================================================
   UPLOADED IMAGES
   ============================================================ */

.theory-review-uploaded-image {
    display: block;

    width: 100%;

    max-width: 500px;

    margin: 4px auto;

    border-radius: 9px;

    border: 1px solid #d1d5db;
}

/* ============================================================
   TABLE
   ============================================================ */

.theory-review-table {
    width: 100%;

    min-width: 500px;

    border-collapse: collapse;

    font-family: "Inter", sans-serif;

    font-size: 13px;
}

.theory-review-table th,
.theory-review-table td {
    border: 1px solid #9ca3af;

    padding: 7px;

    text-align: left;

    vertical-align: top;
}

.theory-review-table th {
    background: #f1f5f9;

    font-weight: 700;

    text-align: center;
}

.theory-review-table td {
    background: #ffffff;

    white-space: pre-wrap;

    overflow-wrap: break-word;
}

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

.theory-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
   ============================================================ */

.theory-review-btn {
    width: 100%;

    min-height: 56px;

    box-sizing: border-box;

    padding: 10px 12px;

    border-radius: 12px;

    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;
}

.theory-review-btn:hover {
    transform: translateY(-1px);

    filter: brightness(1.08);
}

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

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

.theory-review-btn.back {
    background: #0a2a43;

    color: #cfd8e7;

    border: 1px solid #a3b8dc;
}

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

.theory-review-btn.retry {
    background: #087f5b;

    color: #ffffff;

    border: none;
}

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

.theory-review-btn.home {
    background: #1b4d8c;

    color: #ffffff;

    border: none;
}

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

@keyframes cardEnter {
    from {
        opacity: 0;

        transform:
            translateY(20px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }
}

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

@media (max-width: 600px) {
    .theory-review-container {
        padding: 10px;
    }

    .theory-review-header h2 {
        font-size: 1.2rem;
    }

    .theory-review-subtitle {
        font-size: 10px;
    }

    .theory-review-status {
        padding: 6px 9px;

        font-size: 10px;
    }

    .theory-review-buttons {
        grid-template-columns:
            repeat(3, 1fr);

        gap: 7px;
    }

    .theory-review-btn {
        min-height: 54px;

        padding: 9px 6px;

        font-size: 12px;

        line-height: 1.2;

        letter-spacing: 0;
    }

    .theory-review-list {
        padding-bottom: 28px;

        scroll-padding-bottom: 28px;
    }
}

@media (max-width: 380px) {
    .theory-review-container {
        padding: 8px;
    }

    .theory-review-header {
        gap: 6px;
    }

    .theory-review-header h2 {
        font-size: 1.05rem;
    }

    .theory-review-subtitle {
        font-size: 9px;
    }

    .theory-review-status {
        padding: 5px 7px;

        font-size: 9px;
    }

    .theory-review-buttons {
        gap: 5px;
    }

    .theory-review-btn {
        min-height: 52px;

        padding: 8px 4px;

        font-size: 11px;

        line-height: 1.15;
    }

    .theory-review-list {
        padding-bottom: 32px;

        scroll-padding-bottom: 32px;
    }

    .theory-review-card {
        padding: 9px;
    }

    .theory-review-part {
        padding: 8px;
    }
}