/* ===== Results Screen ===== */

/* Student info box at the top of results */
.results-student-box {
    margin-bottom: 1.5rem;
    text-align: center;
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.results-student-box h3 {
    font-size: 1.5rem;
    color: #1e3a8a;
    margin: 0 0 0.35rem 0;
}

.results-student-box p {
    font-size: 0.95rem;
    color: #475569;
    margin: 0;
}

/* Score + total time block */
.results-summary {
    text-align: center;
    margin-bottom: 1.5rem;
}

.results-summary .results-score {
    font-size: 1.8rem;
    font-weight: bold;
    color: #1e3a8a;
    margin: 0 0 0.5rem 0;
}

/* Total time taken is placed directly BELOW the score */
.results-summary .results-total-time {
    font-size: 1.15rem;
    margin: 0.35rem 0 0.75rem 0;
    color: #1e293b;
}

.results-summary .results-total-time .results-time-good {
    color: #16a34a;
    font-weight: 800;
}

.results-summary .results-total-time .results-time-bad {
    color: #dc2626;
    font-weight: 800;
}

.results-summary .results-target-note {
    font-weight: normal;
    color: #64748b;
    font-size: 0.9rem;
}

.results-summary .results-thankyou {
    font-size: 1.05rem;
    color: #334155;
    font-style: italic;
    margin: 0;
}

.results-divider {
    margin: 1.5rem 0;
    border: 0;
    border-top: 1px solid #cbd5e1;
}

.results-table-heading {
    margin-bottom: 1rem;
    color: #1e293b;
    font-size: 1.2rem;
}

/* Wrapper so the table can scroll horizontally on small screens */
.results-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Per-question breakdown table: 4 columns
   Q#  |  Your Answer  |  Correct Answer  |  Time */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    table-layout: auto;
}

.results-table th,
.results-table td {
    border: 1px solid #cbd5e1;
    padding: 0.85rem;
    text-align: left;
    vertical-align: middle;
}

.results-table thead th {
    background: #f1f5f9;
    color: #1e293b;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    white-space: nowrap;
}

.results-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.results-table tbody tr:hover {
    background: #eff6ff;
}

/* Column: Q# */
.results-table td.result-qnum {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.1rem;
    width: 3rem;
    text-align: center;
}

/* Column: Your Answer */
.results-table td.result-user-col {
    white-space: normal;
}

/* Column: Correct Answer */
.results-table td.result-correct-col {
    color: #1e293b;
    font-weight: 600;
}

/* Column: Time */
.results-table td.result-time-col {
    white-space: nowrap;
    font-weight: 800;
}

/* Status icons */
.result-status-icon {
    font-weight: 900;
    font-size: 1.7rem;
    margin-right: 6px;
    vertical-align: middle;
    display: inline-block;
}

.result-status-icon.correct { color: #15803d; }
.result-status-icon.incorrect { color: #dc2626; }

/* Correct answer: black text on green highlighter */
.result-answer-correct {
    background-color: #bbf7d0;
    color: #000000 !important;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    display: inline-block;
}

/* Incorrect answer: solid red flag */
.result-answer-incorrect {
    background-color: #dc2626;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    display: inline-block;
}

/* Per-question time colouring */
.result-time-good {
    color: #16a34a;
    font-weight: 800;
}

.result-time-bad {
    color: #dc2626;
    font-weight: 800;
}

/* Responsive tweaks for the results table */
@media (max-width: 600px) {
    .results-table {
        font-size: 0.92rem;
    }
    .results-table th,
    .results-table td {
        padding: 0.6rem 0.5rem;
    }
    .result-status-icon {
        font-size: 1.35rem;
    }
    .results-summary .results-score {
        font-size: 1.45rem;
    }
    .results-summary .results-total-time {
        font-size: 1rem;
    }
}