/* CSS cho trang chấm bài của giám khảo */
.grader-wrapper table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}
.grader-wrapper th, .grader-wrapper td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
.grader-wrapper th {
    background-color: #f2f2f2;
}
.grader-wrapper .button {
    text-decoration: none;
    background: #0073aa;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    display: inline-block;
}
.grading-question-block {
    border: 1px solid #ccc;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}
.grading-question-block h3 {
    margin-top: 0;
}
.answer-box {
    border: 1px solid #e5e5e5;
    background: #f9f9f9;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
}
.answer-box.correct-answer {
    background: #f0fff0;
}
.result-correct { color: #2e7d32; font-weight: bold; }
.result-incorrect { color: #c62828; font-weight: bold; }
.grading-tick {
    margin-top: 15px;
    padding: 10px;
    background-color: #fffde7;
    border: 1px solid #fbc02d;
}
.finish-button {
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    text-align: center;
}
.grading-result-wrapper {
    text-align: center;
    border: 1px solid #ddd;
    padding: 30px;
}
.final-score {
    font-size: 1.5em;
    margin: 20px 0;
}
.final-score strong {
    font-size: 2.5em;
    color: #2e7d32;
    display: block;
}

/* ==========================================================================
   CSS cho Đồng hồ đếm ngược (lấy cảm hứng từ ảnh bạn gửi)
   ========================================================================== */
#lb-test-timer {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 2.5em; /* Kích thước chữ lớn */
    font-weight: bold;
    color: #e0e0e0; /* Màu chữ sáng */
    background-color: #1a1a1a; /* Nền tối hơn */
    border-radius: 15px; /* Bo tròn góc */
    padding: 20px 30px; /* Đệm xung quanh */
    margin: 30px auto; /* Căn giữa và khoảng cách */
    display: table; /* Để căn giữa tự động */
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5), /* Bóng đổ sâu */
                0 0 60px rgba(100, 100, 255, 0.4), /* Đèn neon xanh tím */
                0 0 60px rgba(255, 100, 100, 0.4); /* Đèn neon đỏ cam */
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5); /* Tạo hiệu ứng sáng nhẹ cho chữ */
    position: relative;
    overflow: hidden; /* Ẩn phần glow tràn ra */
    animation: neon-glow 1.5s infinite alternate; /* Hiệu ứng nhấp nháy nhẹ */
}

/* Hiệu ứng glow nhẹ nhàng quanh viền */
@keyframes neon-glow {
    from {
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.5),
                    0 0 40px rgba(100, 100, 255, 0.3),
                    0 0 40px rgba(255, 100, 100, 0.3);
    }
    to {
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.5),
                    0 0 60px rgba(100, 100, 255, 0.6),
                    0 0 60px rgba(255, 100, 100, 0.6);
    }
}

/* Các phần tử số trong đồng hồ để căn chỉnh */
#lb-test-timer span {
    display: inline-block;
    min-width: 40px; /* Đảm bảo các số căn đều */
    text-align: center;
}

/* CSS cho form nhập mã đề */
.lb-test-code-input-form {
    max-width: 500px;
    margin: 50px auto;
    padding: 30px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background-color: #f9f9f9;
}
.lb-test-code-input-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}
.lb-test-code-input-form input[type="text"] {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}
.lb-test-code-input-form button[type="submit"] {
    background-color: #0073aa;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}
.lb-test-code-input-form button[type="submit"]:hover {
    background-color: #005f8a;
}
.lb-test-code-input-form .error-message {
    color: red;
    margin-top: -10px;
    margin-bottom: 15px;
}

/* Giao diện làm bài thi */
#lb-test-form {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
#lb-test-form h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}
#lb-test-form h3 {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-weight: normal;
}
.lb-test-question-item {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #eee;
}
.lb-test-question-item:last-of-type {
    border-bottom: none;
}
.lb-test-question-item h4 {
    color: #0073aa;
    margin-bottom: 15px;
    font-size: 1.2em;
}
.lb-test-question-item label {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
}
.lb-test-question-item input[type="radio"],
.lb-test-question-item input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2); /* Phóng to radio/checkbox */
}
.lb-test-question-item textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    min-height: 100px;
    box-sizing: border-box; /* Kích thước bao gồm padding và border */
}
#submit-test-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: #28a745; /* Nút nộp bài màu xanh lá */
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 30px;
}
#submit-test-btn:hover {
    background-color: #218838;
}
#test-result-message {
    margin-top: 20px;
    text-align: center;
    font-size: 1.1em;
    font-weight: bold;
    color: #0073aa;
}
.lb-test-error-message {
    color: red;
    font-weight: bold;
    text-align: center;
    margin-top: 20px;
}

/* ==========================================================================
   CSS cho Đồng hồ đếm ngược (Phiên bản cố định trên màn hình)
   ========================================================================== */
#lb-test-timer {
    position: fixed; /* Cố định vị trí trên màn hình */
    top: 20px;       /* Cách mép trên 20px */
    right: 20px;      /* Cách mép phải 20px */
    z-index: 1000;    /* Luôn nổi lên trên cùng */

    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.5em; /* Giảm kích thước chữ cho phù hợp với góc màn hình */
    font-weight: bold;
    color: #f0f0f0;
    background-color: rgba(26, 26, 26, 0.9); /* Nền tối có chút trong suốt */
    backdrop-filter: blur(5px); /* Hiệu ứng làm mờ nền phía sau (cho trình duyệt hỗ trợ) */
    border-radius: 10px;
    padding: 10px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    min-width: 160px; /* Đặt chiều rộng tối thiểu để không bị vỡ layout */
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Các phần tử số trong đồng hồ để căn chỉnh */
#lb-test-timer span {
    display: inline-block;
    min-width: 25px;
    text-align: center;
}

/* ==========================================================================
   CSS cho nút Xóa màu đỏ trong giao diện giám khảo
   ========================================================================== */
.grader-table .delete-button {
    background-color: #dc3545; /* Màu đỏ của Bootstrap danger */
    border-color: #dc3545;
    color: #fff;
    margin-left: 5px; /* Tạo khoảng cách với nút chấm bài */
}

.grader-table .delete-button:hover {
    background-color: #c82333; /* Màu đỏ đậm hơn khi hover */
    border-color: #bd2130;
    color: #fff;
}

/* ==========================================================================
   CSS Bổ sung cho Giao diện Chấm bài
   ========================================================================== */

/* Màu Vàng cho câu trả lời đang chờ chấm (tự luận) */
.answer-box.student-answer.pending-answer {
    background-color: #fffde7; /* Màu vàng nhạt */
    border-color: #fbc02d;
}

/* Màu Đỏ cho khung đáp án khi thí sinh trả lời sai */
.answer-box.incorrect-answer {
    background-color: #f8d7da; /* Màu đỏ nhạt */
    border-color: #f5c6cb;
}

/* ==========================================================================
   CSS cho màn hình Nộp bài thành công (Hiện đại)
   ========================================================================== */
.lb-test-success-wrapper {
    max-width: 500px;
    margin: 50px auto;
    padding: 40px;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: fadeInZoom 0.5s ease-out forwards;
}

@keyframes fadeInZoom {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lb-test-success-wrapper .success-icon {
    width: 80px;
    height: 80px;
}

.lb-test-success-wrapper .success-icon .checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #28a745;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.lb-test-success-wrapper .success-icon .checkmark-path {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-width: 4;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}

.lb-test-success-wrapper h3 {
    font-size: 24px;
    color: #1a214f;
    margin: 0;
}

.lb-test-success-wrapper .success-button {
    display: inline-block;
    background-color: #4a43ec;
    color: #fff !important;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    margin-top: 10px;
}

.lb-test-success-wrapper .success-button:hover {
    background-color: #3a33c9;
    transform: translateY(-2px);
}

.lb-test-success-wrapper .lb-test-success-details {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px 20px;
    margin-top: 10px;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
}

.lb-test-success-wrapper .lb-test-success-details p {
    margin: 5px 0;
    color: #495057;
    font-size: 15px;
}