/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/

.exam-heading {
    background-color: #FFF;
    padding: 10px 30px;
    box-shadow: 0 0 10px 0 hsla(0, 0%, 0%, 0.06);
    border-radius: 12px;
    border: 1px solid rgb(27 153 214 / 30%);
}

.exam-heading .inner {
    display: flex;
    gap: 50px;
    justify-content: space-between;
}

.exam-heading .section .sub-heading {
    font-size: 14px;
    font-weight: 700;
}

.exam-heading .section .heading {
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
}

.exam-heading .section .section-content .clock-timer {
    display: flex;
}

.exam-heading .section .section-content .clock-timer .hand:not(:last-child):after {
    content: ':';
    margin-inline: 2px;
}

.mdit-option-label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    transition: 0.2s;
    color: #000;
}

.mdit-option-label .answer-letter {
    padding: 5px 12px;
    border-radius: 4px;
    font-weight: 700;
    background: #ccc;
}

.mdit-option-label:hover {
    background: #f1f5f9;
}

.mdit-answer-radio:checked+.mdit-option-label {
    border-color: #0073aa;
    background: #e6f6ff;
}

.mdit-answer-radio:checked+.mdit-option-label .answer-letter {
    background: #0073aa;
    color: #fff;
}

.question-heading {
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
}

@media (max-width: 767px) {
    .exam-content .inner {
        padding: 30px 0 0 0 !important;
        box-shadow: none !important;
    }

    .question-heading {
        font-size: 16px;
    }

    .exam-heading {
        padding: 10px 20px;
    }
    .exam-heading .section .sub-heading {
        font-size: 10px;
    }
    .exam-heading .section .heading {
        font-size: 24px;
    }

    .mdit-option-label {
        padding: 8px;
    }
    .mdit-option-label .answer-letter {
        padding: 3px 10px;
        font-size: 14px;
    }
    .mdit-option-label .answer-content {
        font-size: 14px;
    }
}

.question-heading .question-number {
    color: #0073aa;
    font-weight: 900;
}

/* Phản hồi đúng/sai ngay sau khi chọn đáp án */
.mdit-option-label.is-correct {
    border-color: #22c55e;
    background: #f0fdf4;
}

.mdit-option-label.is-correct .answer-letter {
    background: #22c55e;
    color: #fff;
}

.mdit-option-label.is-wrong {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
}

.mdit-option-label.is-wrong .answer-letter {
    background: #ef4444 !important;
    ;
    color: #fff !important;
    ;
}

.mdit-answer-radio:disabled+.mdit-option-label {
    cursor: not-allowed;
}

/* Nút Tiếp theo/Nộp bài bị khoá cho tới khi chọn đáp án của câu hiện tại */
#btn-next:disabled,
#btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Popup hết giờ làm bài (dùng chung cho hết giờ khi đang mở tab và khi quay lại sau khi đã hết giờ) */
.mdit-timeup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.mdit-timeup-box {
    background: #fff;
    padding: 30px 40px;
    border-radius: 10px;
    text-align: center;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.mdit-timeup-box h3 {
    margin: 0 0 10px;
    color: #d63638;
    font-size: 22px;
}

.mdit-timeup-box p {
    margin: 0;
    font-size: 15px;
    color: #444;
}

.mdit-timeup-box #mdit-timeup-seconds {
    font-weight: 900;
    color: #0073aa;
    font-size: 18px;
}

/* Xem lại từng câu ở trang kết quả */
.exam-review {
    margin-top: 30px;
    text-align: left;
}

.review-question {
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.review-question:first-child {
    border-top: none;
}

.review-question .answers {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.review-note {
    margin-top: 8px;
    color: #d63638;
    font-size: 14px;
    font-style: italic;
}

/* Nút trong Loop grid từ shortcode [exam_cta] */
.exam-cta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Thanh tiến độ khi đang làm dở (Làm tiếp) - luôn xuống hàng dưới nút */
.exam-progress-bar-wrap {
    width: 100%;
    flex-basis: 100%;
}

.exam-progress-bar-text {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.exam-progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.exam-progress-bar-fill {
    height: 100%;
    background: #0073aa;
    border-radius: 999px;
    transition: width 0.3s ease;
}