﻿/* --- Font, Body, Containers (Giữ nguyên) --- */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&display=swap');

body {
    background-color: #FFFBF0;
    font-family: 'Be Vietnam Pro', sans-serif;
    color: #444;
}

.quiz-main-container {
    max-width: 800px;
    margin: auto;
    padding: 0 15px;
}

.quiz-container {
    background-color: transparent;
    padding: 10px 0px;
    border-radius: 0;
    box-shadow: none;
}

/* --- Header (Giữ nguyên) --- */
.quiz-header {
    display: flex;
    align-items: flex-start;
    gap: 35px;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    padding-left: 15px;
    padding-right: 15px;
}

.header-image {
    flex: 0 0 160px;
    text-align: center;
}

    .header-image img {
        max-width: 100%;
        height: auto;
        margin-top: 10px;
    }

.header-text {
   /* flex: 1;*/
}

    .header-text h1 {
        font-size: 2rem;
        font-weight: 700;
        margin-bottom: 2px;
        color: #333;
    }

        .header-text h1 .highlight-number {
            color: #f06565;
        }

    .header-text h2 {
        font-size: 1.5rem;
        font-weight: 700;
        margin-top: 0;
        margin-bottom: 12px;
        color: #333;
    }

    .header-text p {
        color: #666;
        font-size: 0.9rem;
        line-height: 1.6;
    }

/* --- Instruction Bar (Giữ nguyên) --- */
.instruction-bar {
    background-color: #ECB14E;
    padding: 15px 25px;
    border-radius: 10px;
    margin: 0 15px 35px 15px;
    text-align: center;
}

    .instruction-bar p {
        margin-bottom: 10px;
        color: black;
        font-size: 0.85rem;
        font-weight: 500;
    }

.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: black;
}

    .legend span {
        display: inline-flex;
        align-items: center;
    }

    .legend .dot {
        display: inline-block;
        width: 9px;
        height: 9px;
        border-radius: 50%;
        margin-right: 5px;
        vertical-align: middle;
    }

        .legend .dot.option-true {
            background-color: #000;
        }

        .legend .dot.option-unknown {
            background-color: #000;
        }
        /* Đổi thành màu vàng */
        .legend .dot.option-false {
            background-color: #000;
        }

/* --- Question List & Items --- */
.question-list {
    margin-bottom: 30px;
}

.question-page {
    padding: 0;
}

.question-item {
    background-color: #F5F5F2;
    padding: 25px 20px;
    margin-bottom: 5px;
    border: none;
    border-radius: 10px;
}

    .question-item:last-child {
        margin-bottom: 0;
    }

/* Câu hỏi */
.question-text {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
    line-height: 1.5;
    display: block;
    text-align: center;
}

    .question-text::first-letter {
        text-transform: uppercase;
    }

/* Wrapper Options */
.options-wrapper {
    text-align: center;
}

/* Container Options */
.options {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 25px; /* TĂNG KHOẢNG CÁCH */
}

/* Label Text (ĐÚNG / KHÔNG ĐÚNG) */
.option-text-label {
    font-size: 0.8rem;
    font-weight: 600; /* ĐẬM HƠN */
    color: #888888; /* Màu xám đậm hơn chút */
    line-height: 22px;
    text-transform: uppercase;
}

.option-text-true {
    margin-right: 20px;
}
/* Tăng khoảng cách */
.option-text-false {
    margin-left: 20px;
}
/* Tăng khoảng cách */

/* Radio Button Label Wrapper */
.radio-option {
    display: inline-block;
    cursor: pointer;
    position: relative;
    user-select: none;
    line-height: 0;
    padding: 2px;
    border-radius: 50%;
}

    /* Ẩn input gốc */
    .radio-option input[type="radio"] {
        position: absolute;
        opacity: 0;
        cursor: pointer;
        height: 0;
        width: 0;
    }

/* Checkmark */
.checkmark {
    height: 22px;
    width: 22px;
    background-color: #ffffff;
    border: 2px solid #555555;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    position: relative;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

    .checkmark:after {
        display: none;
    }
/* Bỏ dấu chấm trong */

/* --------- SELECTED STATES CHO CHECKMARK (Cập nhật nút giữa) --------- */

/* Khi nút TRUE được chọn */
.radio-true input:checked ~ .checkmark {
    background-color: #f5c85f;
    border-color: #f5c85f;
    box-shadow: 2px 2px 0px 0px rgba(0, 0, 0, 1);
}

/* Khi nút UNKNOWN (giữa) được chọn - ĐỔI SANG MÀU VÀNG */
.radio-unknown input:checked ~ .checkmark {
    background-color: #f5c85f; /* NỀN VÀNG */
    border-color: #f5c85f; /* VIỀN VÀNG */
    box-shadow: 2px 2px 0px 0px rgba(0, 0, 0, 1);
}

/* Khi nút FALSE được chọn */
.radio-false input:checked ~ .checkmark {
    background-color: #f5c85f;
    border-color: #f5c85f;
    box-shadow: 2px 2px 0px 0px rgba(0, 0, 0, 1);
}

/* --- Pagination Dots - CẬP NHẬT ACTIVE STATE --- */
.pagination-dots {
    text-align: center;
    margin: 35px 0 25px 0;
    padding: 0 15px;
}

    /* Style mặc định cho tất cả indicator (cả dot thường và icon) */
    .pagination-dots .page-indicator {
        display: inline-block;
        width: 9px; /* Kích thước dot thường */
        height: 9px;
        background-color: #fddbdb; /* Màu dot không active */
        border-radius: 50%; /* Bo tròn cho dot */
        margin: 0 4px; /* Tăng khoảng cách giữa các dot/icon */
        vertical-align: middle;
        transition: all 0.3s ease; /* Áp dụng transition cho mọi thay đổi */
        cursor: default;
        background-image: none; /* Đảm bảo không có ảnh nền mặc định */
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        border: none; /* Đảm bảo không có viền */
    }

        /* Style KHI ACTIVE (Áp dụng icon) */
        .pagination-dots .page-indicator.active {
            background-color: transparent !important; /* Nền trong suốt để thấy icon */
            background-image: url('../images/paging_icon.gif'); /* Đường dẫn tới ảnh */
            width: 16px; /* KÍCH THƯỚC LỚN HƠN cho icon */
            height: 16px;
            border-radius: 0; /* Bỏ bo tròn khi là icon */
        }


/* --- Submit Button (Giữ nguyên) --- */
.submit-button-container {
    text-align: center;
    margin-top: 40px;
    padding: 0 15px;
}

.btn-submit-quiz {
    background-color: #e67e22;
    border-color: #d35400;
    padding: 12px 40px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    transition: background-color 0.3s ease, transform 0.1s ease;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

    .btn-submit-quiz:hover {
        background-color: #d35400;
        border-color: #a04000;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }

    .btn-submit-quiz:active {
        transform: translateY(0px);
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

/* --- Loading Overlay (Giữ nguyên) --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
    text-align: center;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #e67e22;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-overlay p {
    font-size: 1rem;
    color: #555;
    font-weight: 500;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- Responsive Adjustments (Xem xét lại khoảng cách options) --- */
@media (max-width: 768px) {
    .quiz-container {
        padding: 5px 0;
    }

    .quiz-header, .instruction-bar, .submit-button-container, .pagination-dots {
        padding-left: 10px;
        padding-right: 10px;
    }

    .question-item {
        padding: 20px 15px;
    }

    .question-text {
        font-size: 0.95rem;
        margin-bottom: 15px;
    }

    .options {
        gap: 20px;
    }
    /* Điều chỉnh khoảng cách options trên tablet */
    .option-text-label {
        font-size: 0.75rem;
        font-weight: 600;
    }

    .checkmark {
        width: 20px;
        height: 20px;
    }

    .option-text-true {
        margin-right: 15px;
    }

    .option-text-false {
        margin-left: 15px;
    }

    .pagination-dots .page-indicator.active {
        width: 21px;
        height: 21px;
    }
    /* Icon nhỏ hơn trên tablet */

}

@media (max-width: 480px) {
    .quiz-container {
        padding: 0;
    }

    .instruction-bar {
        margin-left: 0;
        margin-right: 0;
        border-radius: 0;
    }

    .question-item {
        padding: 18px 10px;
        margin-bottom: 3px;
    }

    .question-text {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    .options {
        gap: 15px;
        flex-wrap: nowrap;
        justify-content: center;
    }
    /* Giảm gap trên mobile */
    .option-text-label {
        font-size: 0.7rem;
        font-weight: 600;
        white-space: nowrap;
    }

    .checkmark {
        width: 18px;
        height: 18px;
        border-width: 2px;
    }
    /* Tăng lại border width */
    .option-text-true {
        margin-right: 10px;
    }

    .option-text-false {
        margin-left: 10px;
    }

    .pagination-dots .page-indicator {
        margin: 0 3px;
    }

        .pagination-dots .page-indicator.active {
            width: 21px;
            height: 21px;
        }
    /* Icon nhỏ hơn nữa */
}

.align-text-left{
    text-align: left;
}

.align-text-right{
    text-align: right;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body h6 {
    color: #0d6efd; /* Hoặc màu bạn thích */
    margin-bottom: 0.3rem;
    font-weight: bold;
}

.card-body hr {
    margin-top: 0.8rem;
    margin-bottom: 0.8rem;
}
/* Đảm bảo card có chiều cao tối thiểu để không bị vỡ layout khi nội dung quá ngắn */
.card {
    min-height: 300px; /* Điều chỉnh nếu cần */
}

.card-body.d-flex.flex-column {
    justify-content: space-between; /* Phân bố không gian giữa các mục */
}


.custom-shadow-button::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 100%;
    height: 100%;
    background-color: transparent;
    border: 2px solid #000000;
    border-radius: var(--bs-btn-border-radius); /* Lấy bo góc từ Bootstrap */
    z-index: -1;
    box-sizing: border-box;
    transition: top 0.1s ease-out, left 0.1s ease-out;
}

.custom-shadow-button:active {
    transform: translate(2px, 2px);
    /* box-shadow: none; */ /* Có thể bỏ shadow mặc định của BS khi active */
}

    .custom-shadow-button:active::after {
        top: 2px;
        left: 2px;
    }

/* Điều chỉnh style input của Bootstrap nếu cần */
.form-control-lg {
    border-radius: 8px; /* Bo góc giống ảnh gốc */
    border-color: #dcdcdc;
}

    .form-control-lg:focus {
        border-color: #86b7fe; /* Giữ màu focus mặc định của BS hoặc đổi */
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25); /* Giữ shadow focus mặc định */
    }

.form-control.is-invalid {
    border-color: #dc3545; /* Màu viền lỗi BS */
    background-image: none; /* Bỏ icon lỗi mặc định của BS nếu không muốn */
}

.invalid-feedback {
    text-align: left; /* Đảm bảo text lỗi căn trái */
}

.custom-input {
    border: 1px solid #CCCCCC;
    border-radius: 5px;
    padding: 10px 15px;
    font-size: 16px;
    background-color: #fff;
    box-shadow: none;
    outline: none;
}

    .custom-input::placeholder {
        color: #999;
        font-weight: lighter; /* Đảm bảo không in đậm */
        opacity: 0.7; /* Làm placeholder nhạt hơn một chút cho hợp lý */
    }

.custom-button {
    background-color: #fff;
    border: 1px solid #000;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 680;
    color: #000;
    transition: background-color 0.3s ease;
    box-shadow: 2px 2px 0px 0px rgba(0, 0, 0, 1); /* Thêm shadow giống hình */
}

    .custom-button:hover {
        background-color: #F6BB3A;
        color: #000;
        border-color: #000;
        box-shadow: 2px 2px 0px 0px rgba(0, 0, 0, 1); /* Giữ shadow khi hover */
    }

.text-danger {
    display: block;
    margin-top: 5px;
    font-size: 14px;
}
