/* file css/quiz-style.css */

.quiz-box {
    width: 100%;
    /* Đặt độ rộng 100% để bằng quiz-group */
    background: linear-gradient(90deg, rgba(55, 239, 201, 1) 35%, rgba(0, 212, 255, 1) 100%);
    border-radius: 7px;
    padding: 5px;
    margin-bottom: 5px;
    margin: 10px 0;
    /* Xóa margin trái/phải để căn đều */
    font-family: 'Times New Roman', sans-serif;
}

/* Định dạng số câu hỏi */
.question-number {
    display: inline-block;
    background-color: #007bff;
    /* Màu xanh nổi bật */
    color: #fff;
    /* Chữ trắng */
    padding: 5px 8px;
    border-radius: 6px;
    margin-right: 8px;
    font-weight: bold;
    font-size: 16px;
}


.question-section {
    background: linear-gradient(180deg, rgba(229, 211, 233, 1) 20%, rgba(244, 238, 238, 1) 50%);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 1em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.question-section h5 {
    color: #1e56ed;
    font-family: Lora, sans-serif;
    margin-top: 0;
}

/* Định dạng khi hover để tương tác */
.question-section:hover {
    background-color: #f1f1f1;
}

.option {
    background: rgba(255, 255, 255, 0.9);
    margin: 10px 0;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option:hover {
    background: white;
    transform: translateX(5px);
}

.option input[type="radio"] {
    margin-right: 10px;
}

.option label {
    cursor: pointer;
    font-size: 1em;
}

.check-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background 0.3s;
}

.check-btn:hover {
    background: #45a049;
}

.explanation {
    border: 1px solid #0000FF;
    background: #f5fbaf;
    padding: 10px;
    border-radius: 10px;
    margin-top: 10px;
}

.explanation h5 {
    color: #333;
    margin-top: 0;
}

.correct {
    background: #dff0d8 !important;
    border-left: 5px solid #3c763d;
}

.incorrect {
    background: #f2dede !important;
    border-left: 5px solid #a94442;
}

.quiz-score {
    background: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
    padding: 10px;
    border-radius: 10px;
    margin: 10px 0;
    text-align: center;
}

.quiz-score h3 {
    margin-top: 0;
    color: #333;
}

.submit-quiz,
.retry-quiz {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    margin: 10px 0;
    transition: background 0.3s;
}

.retry-quiz {
    background: #2196F3;
}

.submit-quiz:hover {
    background: #45a049;
}

.retry-quiz:hover {
    background: #1976D2;
}

/* CSS cho câu hỏi trắc nghiệm nhiều đáp án đúng sai */
.quiz-box[data-type="true-false"] {
    background: linear-gradient(0deg, rgba(34, 193, 195, 1) 0%, rgba(253, 187, 45, 1) 100%);
    border: 1px solid #d2b48c;
    /* Tan - Viền */
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
}

.option-tf {
    background: rgba(255, 255, 255, 0.9);
    margin: 10px 0;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.option-tf-label:hover {
    background: white;
    transform: translateX(5px);
}

.option-tf-label {
    cursor: pointer;
    display: block;
    width: 100%;
}

.tf-buttons {
    display: flex;
    align-items: center;
    margin-top: 0px;
    margin-left: 20px;
    /* Tạo khoảng cách giữa nội dung và nút */
}

.tf-buttons input[type="radio"] {
    display: inline-block;
    margin-right: 5px;
    vertical-align: middle;
}

.tf-buttons label {
    cursor: pointer;
    font-size: 1em;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-right: 10px;
    user-select: none;
    /* Ngăn chặn chọn văn bản */
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

/* Định dạng màu cho nút "Đúng" */
.tf-buttons .true-label {
    background-color: #dff0d8;
    /* Màu nền xanh nhạt */
    border-color: #3c763d;
    /* Viền xanh đậm */
    color: #3c763d;
    /* Chữ xanh đậm */
}

/* Định dạng màu cho nút "Sai" */
.tf-buttons .false-label {
    background-color: #f2dede;
    /* Màu nền đỏ nhạt */
    border-color: #a94442;
    /* Viền đỏ đậm */
    color: #a94442;
    /* Chữ đỏ đậm */
}

/* Hiệu ứng hover cho nút */
.tf-buttons label:hover {
    opacity: 0.8;
}

/* Hiển thị khi radio button được chọn */
.tf-buttons input[type="radio"]:checked+label {
    background-color: #4CAF50;
    /* Màu nền xanh lá khi chọn */
    border-color: #4CAF50;
    color: white;
}

.option-tf.correct {
    border-left: 5px solid #3c763d;
}

.option-tf.incorrect {
    border-left: 5px solid #a94442;
}

/* CSS cho câu hỏi trả lời ngắn */
.quiz-box[data-type="short-answer"] {
    background: rgb(241, 207, 199);
    border: 1px solid #e6a8b7;
    /* Màu viền */
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 5px;
}

.quiz-box[data-type="short-answer"] .answer-section::before {
    content: "Đáp án: ";
    /* Thêm chữ "Đáp án:" */
    font-weight: bold;
    margin-right: 5px;
}

.quiz-box[data-type="short-answer"] .short-answer-input {
    border: 1px solid red;
    /* Viền đỏ */
    border-radius: 5px;
    padding: 5px;
    color: red;
    /* Chữ màu đỏ */
    font-weight: bold;
    width: 100px;
    /* Có thể điều chỉnh độ rộng */
    text-align: center;
}

/* CSS cho phần thi online */
.quiz-student-info {
    margin-bottom: 15px;
    color: blue;
    font-weight: bold;
}

.student-name-input {
    padding: 8px;
    border: 2px solid #FF5733;
    border-radius: 6px;
    font-size: 16px;
    width: 100%;
    /* Chiếm toàn bộ chiều rộng */
    max-width: 400px;
    /* Giới hạn chiều rộng tối đa */
    box-sizing: border-box;
    /* Đảm bảo padding và border không làm thay đổi kích thước */
}

.quiz-timer {
    font-size: 18px;
    font-weight: bold;
    color: #e74c3c;
    /* Màu đỏ */
    margin-bottom: 15px;
    background-color: #f8d7da;
    /* Màu nền nhạt */
    border: 1px solid #f5c6cb;
    /* Viền */
    padding: 10px;
    border-radius: 5px;
    display: inline-block;
    /* Hiển thị trên cùng một dòng */
}

.quiz-section-title {
    margin-top: 20px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    color: #213cd1;
    border-bottom: 2px solid #ffc300;
}

.student-name-display {
    margin: 10px 0;
    color: blue;
    font-weight: bold;
}

.quiz-group {
    border: 1px solid #e0e0e0;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.quiz-group-title {
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ccc;
    font-size: 1.1em;
    color: #00f;
}




/* Style cho các phần I, II, III */
.quiz-parts-container {
    margin-bottom: 20px;
    /* Khoảng cách trước nút Nộp bài */
}

.quiz-part {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.quiz-part:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.quiz-section-title {
    color: #005a9c;
    /* Màu tiêu đề phần */
    margin-bottom: 15px;
    font-size: 1.2em;
}

/* CSS cho trang kết quả bài thi */
.quiz-user-results {
    margin: 20px 0;
    font-family: 'Times New Roman', sans-serif;
}

.quiz-user-results h2 {
    color: #0073aa;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.quiz-results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: #fff;
    border: 1px solid #ddd;
}

.quiz-results-table th,
.quiz-results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.quiz-results-table th {
    background-color: #f1f1f1;
    font-weight: bold;
    color: #333;
}

.quiz-results-table tr:hover {
    background-color: #f9f9f9;
}

.quiz-details-row {
    background-color: #f9f9f9;
}

.quiz-details-content {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 15px 0;
}

.quiz-details-content h3 {
    margin-top: 0;
    color: #0073aa;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.quiz-details-content h4 {
    color: #333;
    margin-top: 20px;
}

.quiz-score-summary {
    background: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.quiz-score-summary p {
    margin: 8px 0;
}

.total-score {
    font-size: 1.3em;
    font-weight: bold;
    color: #0073aa;
}

.quiz-answers-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background-color: #fff;
    border: 1px solid #ddd;
}

.quiz-answers-table th,
.quiz-answers-table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ddd;
}

.quiz-answers-table th {
    background-color: #f1f1f1;
    font-weight: bold;
}

.quiz-answers-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.quiz-answers-table tr:hover {
    background-color: #e6f7ff;
}

.question-content {
    max-width: 300px;
    word-wrap: break-word;
}

.correct-answer {
    color: green;
    font-weight: bold;
}

.incorrect-answer {
    color: red;
    font-weight: bold;
}

.view-quiz-details {
    color: #0073aa;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    border: 1px solid #0073aa;
    border-radius: 3px;
    display: inline-block;
}

.view-quiz-details:hover {
    background-color: #0073aa;
    color: white;
    text-decoration: none;
}

.quiz-login-required {
    text-align: center;
    padding: 30px;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 20px 0;
}

.quiz-login-required h2 {
    color: #0073aa;
    margin-top: 0;
}

.quiz-statistics {
    text-align: right;
    font-weight: bold;
    margin-top: 10px;
    font-size: 1.1em;
    color: #0073aa;
}

/* ============================================================
   Responsive design (kế thừa từ trên)
   ============================================================ */
@media (max-width: 768px) {

    .quiz-results-table,
    .quiz-answers-table {
        font-size: 0.9em;
    }

    .quiz-results-table th,
    .quiz-results-table td,
    .quiz-answers-table th,
    .quiz-answers-table td {
        padding: 8px;
    }

    .question-content {
        max-width: 150px;
    }
}

/* ============================================================
   VIDU MODE – Flashcard / Luyện tập từng câu
   ============================================================ */
.quiz-set-vidu {
    font-family: 'Times New Roman', sans-serif;
    max-width: 800px;
    margin: 20px auto;
}

/* Header: progress bar + text */
.vidu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.vidu-progress-bar-wrap {
    flex: 1;
    height: 10px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.vidu-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #43ea80, #1565c0);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.vidu-progress-text {
    font-size: 0.95em;
    font-weight: bold;
    color: #555;
    white-space: nowrap;
}

/* Khu hiển thị câu hỏi – animated khi đổi câu */
.vidu-question-display {
    min-height: 120px;
    animation: vidu-fadein 0.3s ease;
}

@keyframes vidu-fadein {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Khu nút điều hướng */
.vidu-nav {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Nút Tiếp theo – mờ cho đến khi đã trả lời */
.vidu-next-btn {
    background: #bbb;
    color: #fff;
    border: none;
    padding: 11px 28px;
    border-radius: 6px;
    font-size: 1.05em;
    cursor: not-allowed;
    transition: background 0.3s, transform 0.15s;
}

/* Sáng lên sau khi chọn đáp án */
.vidu-next-btn.vidu-next-ready {
    background: linear-gradient(90deg, #1565c0, #42a5f5);
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(21, 101, 192, .35);
}

.vidu-next-btn.vidu-next-ready:hover {
    background: linear-gradient(90deg, #0d47a1, #1e88e5);
    transform: translateY(-1px);
}

/* Nút Làm lại */
.vidu-restart-btn {
    background: #ff7043;
    color: #fff;
    border: none;
    padding: 11px 24px;
    border-radius: 6px;
    font-size: 1.05em;
    cursor: pointer;
    transition: background 0.3s;
}

.vidu-restart-btn:hover {
    background: #e64a19;
}

/* Nút Kiểm tra (short-answer) */
.vidu-check-btn {
    background: #4CAF50;
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 5px;
    font-size: 0.95em;
    cursor: pointer;
    margin-left: 8px;
    transition: background 0.3s;
}

.vidu-check-btn:hover {
    background: #388e3c;
}

.vidu-check-btn:disabled {
    background: #aaa;
    cursor: default;
}

/* Màn hình hoàn thành */
.vidu-finished {
    text-align: center;
    padding: 36px 20px;
    background: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
    border-radius: 12px;
    color: #1a237e;
    animation: vidu-fadein 0.4s ease;
}

.vidu-finished h3 {
    font-size: 1.4em;
    color: #1a237e;
}

/* Bảng tổng kết kết quả vidu */
.vidu-summary-table {
    border-collapse: collapse;
    margin: 16px auto 0;
    min-width: 240px;
    font-size: 1em;
    font-weight: normal;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.vidu-summary-table td {
    padding: 10px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    text-align: left;
}

.vidu-summary-table td:first-child {
    color: #555;
    font-size: 0.95em;
}

.vidu-summary-table td:last-child {
    text-align: right;
}

.vidu-summary-table tr:last-child td {
    border-bottom: none;
}