/* =========================================================
   THI THỬ GPLX A1 - M5S
   ========================================================= */


/* =========================================================
   KHUNG CHÍNH
   ========================================================= */

.exam-page {
    max-width: 1160px;
    margin: 30px auto;
    padding: 0 15px;
    box-sizing: border-box;
}


/* =========================================================
   HEADER
   ========================================================= */

.exam-header {
    background: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.exam-title h1 {
    margin: 0;
    padding: 0;
    font-size: 28px;
    line-height: 1.3;
    color: #111;
    font-weight: 600;
}

.exam-title p {
    margin: 6px 0 0;
    color: #777;
    font-size: 16px;
}


/* =========================================================
   ĐỒNG HỒ
   ========================================================= */

.exam-timer {
    min-width: 120px;
    text-align: center;
    background: #f5f5f5;
    padding: 10px 20px;
    box-sizing: border-box;
}

.exam-timer span {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 2px;
}

.exam-timer strong {
    display: block;
    font-size: 28px;
    line-height: 1.2;
    color: #d60000;
    font-weight: 700;
}


/* =========================================================
   LAYOUT
   ========================================================= */

.exam-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: stretch;
}


/* =========================================================
   KHUNG CÂU HỎI
   ========================================================= */

.exam-question-box {
    background: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    box-sizing: border-box;
    min-width: 0;
}

.question-number {
    font-size: 18px;
    color: #222;
    margin-bottom: 22px;
}

.question-number strong {
    font-weight: 700;
}

.question-content h2 {
    margin: 0 0 25px;
    padding: 0;
    font-size: 20px;
    line-height: 1.5;
    font-weight: 500;
    color: #111;
}


/* =========================================================
   ĐÁP ÁN
   ========================================================= */

#answers {
    width: 100%;
}

.answer {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    width: 100%;
    min-height: 52px;

    border: 1px solid #ddd;
    background: #fff;

    padding: 14px;
    margin-bottom: 10px;

    box-sizing: border-box;

    cursor: pointer;

    border-radius: 4px;

    transition: background .15s ease,
                border-color .15s ease;
}

.answer:hover {
    background: #f7f7f7;
    border-color: #bbb;
}

.answer input {
    flex: 0 0 auto;
    margin-top: 4px;
    cursor: pointer;
}

.answer-letter {
    flex: 0 0 auto;
    font-weight: 500;
    color: #111;
}

.answer-text {
    flex: 1;
    line-height: 1.5;
    color: #222;
}


/* Đáp án đang được chọn */

.answer.selected {
    background: #f5f5f5;
    border-color: #555;
}


/* =========================================================
   ĐIỀU HƯỚNG
   ========================================================= */

.exam-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 25px;
}

.exam-navigation button {
    border: 0;
    background: #333;
    color: #fff;

    padding: 11px 18px;

    font-size: 15px;

    cursor: pointer;

    border-radius: 0;
}

.exam-navigation button:hover {
    background: #222;
}

.exam-navigation button:disabled {
    opacity: .4;
    cursor: not-allowed;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.exam-sidebar {
    background: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    box-sizing: border-box;
}

.exam-sidebar h3 {
    margin: 0 0 15px;
    padding: 0;

    font-size: 18px;
    line-height: 1.3;

    color: #111;
    font-weight: 500;
}


/* =========================================================
   DANH SÁCH CÂU HỎI
   ========================================================= */

.question-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.question-list button {
    height: 40px;

    border: 1px solid #ccc;
    background: #fff;

    color: #222;

    font-size: 15px;

    cursor: pointer;

    padding: 0;
}

.question-list button:hover {
    background: #f3f3f3;
}


/* Câu hiện tại */

.question-list button.active {
    background: #222;
    color: #fff;
    border-color: #222;
}


/* Câu đã trả lời */

.question-list button.answered {
    background: #5cb85c;
    color: #fff;
    border-color: #5cb85c;
}


/* Nếu vừa hiện tại vừa đã trả lời */

.question-list button.active.answered {
    background: #222;
    color: #fff;
    border-color: #222;
}


/* =========================================================
   CHÚ THÍCH
   ========================================================= */

.question-note {
    margin-top: 20px;
    font-size: 13px;
    color: #444;
}

.question-note div {
    display: flex;
    align-items: center;
    margin-bottom: 9px;
}

.question-note i {
    display: inline-block;

    width: 12px;
    height: 12px;

    margin-right: 7px;

    border: 1px solid #aaa;

    box-sizing: border-box;
}


/* Câu hiện tại */

.question-current {
    background: #222;
    border-color: #222 !important;
}


/* Đã trả lời */

.question-done {
    background: #5cb85c;
    border-color: #5cb85c !important;
}


/* Chưa trả lời */

.question-empty {
    background: #fff;
}


/* =========================================================
   NÚT NỘP BÀI
   ========================================================= */

.submit-exam {
    display: block;

    width: 100%;

    margin-top: 20px;

    padding: 13px 10px;

    border: 0;

    background: #d9534f;
    color: #fff;

    font-size: 16px;
    font-weight: 700;

    cursor: pointer;
}

.submit-exam:hover {
    background: #c9302c;
}


/* =========================================================
   KẾT QUẢ
   ========================================================= */

.exam-result {
    margin-top: 20px;

    background: #fff;

    border: 1px solid #ddd;

    padding: 30px;

    text-align: center;

    box-sizing: border-box;
}

.exam-result h2 {
    margin: 0 0 15px;

    font-size: 24px;
    color: #111;
}

.result-status {
    font-size: 30px;
    font-weight: 700;

    margin: 20px 0;
}

.exam-result p {
    font-size: 16px;
    color: #444;
}

.exam-result p strong {
    font-weight: 700;
}

.result-message {
    margin-bottom: 20px;
}


/* =========================================================
   NÚT THI LẠI
   ========================================================= */

.retry-exam {
    border: 0;

    background: #333;
    color: #fff;

    padding: 11px 25px;

    font-size: 15px;

    cursor: pointer;
}

.retry-exam:hover {
    background: #222;
}


/* =========================================================
   HẾT GIỜ
   ========================================================= */

.exam-timer.time-warning strong {
    color: #e67e00;
}

.exam-timer.time-danger strong {
    color: #d60000;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .exam-page {
        margin: 15px auto;
        padding: 0 10px;
    }

    .exam-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .exam-title h1 {
        font-size: 23px;
    }

    .exam-title p {
        font-size: 14px;
    }

    .exam-timer {
        width: 100%;
    }

    .exam-layout {
        grid-template-columns: 1fr;
    }

    .exam-question-box,
    .exam-sidebar {
        padding: 15px;
    }

    .question-content h2 {
        font-size: 18px;
        line-height: 1.45;
    }

    .answer {
        padding: 12px;
    }

    .exam-navigation button {
        padding: 10px 13px;
        font-size: 14px;
    }

}


/* =========================================================
   MOBILE NHỎ
   ========================================================= */

@media (max-width: 480px) {

    .exam-title h1 {
        font-size: 21px;
    }

    .exam-timer strong {
        font-size: 25px;
    }

    .question-number {
        font-size: 16px;
    }

    .question-content h2 {
        font-size: 17px;
    }

    .answer {
        font-size: 14px;
    }

    .exam-navigation {
        gap: 8px;
    }

    .exam-navigation button {
        flex: 1;
    }

}