/* General Reset & Body Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7fa;
    color: #333;
}

.main-content-quiz-page {
    max-width: 1200px;
    margin: 20px auto;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background-color: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.navbar-left h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Content Wrapper */
.content-wrapper {
    flex-grow: 1;
    padding: 20px 30px;
    display: flex;
    gap: 20px;
    overflow-y: auto;
}

/* Question Management Specific Styles */
.question-list-section {
    flex: 2;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tabs {
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
    display: flex;
}

.tab-button {
    background-color: transparent;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 16px;
    color: #555;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-bottom 0.2s;
}

.tab-button.active {
    color: #007bff;
    border-bottom: 2px solid #007bff;
    font-weight: 600;
}

/* Question Card (Editor) */
.question-card {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.question-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.question-num {
    font-weight: bold;
    font-size: 18px;
    margin-right: 10px;
}

.question-type-selector select {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    font-size: 14px;
}

.card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.card-actions i {
    cursor: pointer;
    color: #888;
}
.card-actions .delete-question-btn {
    color: #dc3545;
}

.question-card-body textarea {
    width: calc(100% - 20px);
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    margin-bottom: 15px;
    resize: vertical;
}

.options-container .option-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.options-container .option-item label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.options-container .option-item input[type="radio"] {
    margin-right: 5px;
    transform: scale(1.2);
    accent-color: #007bff;
}

.options-container .option-item input[type="text"] {
    flex-grow: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.options-container .option-item .delete-option-btn {
    color: #dc3545;
    cursor: pointer;
    font-size: 16px;
}

.btn-add-option {
    background-color: #e9ecef;
    color: #495057;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    border: none;
}
.btn-add-option:hover {
    background-color: #dee2e6;
}

.question-score {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.question-score label {
    font-weight: 600;
}
.question-score input[type="number"] {
    width: 70px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.btn-add-question-main {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: #6f42c1;
    color: white;
    font-size: 16px;
    border-radius: 8px;
    margin-top: 20px;
}
.btn-add-question-main:hover {
    background-color: #5a2c91;
}

/* Quiz Taking Specific Styles */
.quiz-wrapper {
    display: flex;
    gap: 20px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
}

.quiz-sidebar {
    width: 250px;
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #eee;
    flex-shrink: 0;
}

.quiz-sidebar h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.question-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 10px;
}

.q-nav-item {
    background-color: #f0f2f5;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px 5px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    position: relative;
    color: #555;
}

.q-nav-item:hover {
    background-color: #e0e2e5;
}

.q-nav-item.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.q-nav-item.answered {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}
.q-nav-item.answered .fa-check {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
}

.quiz-questions-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.quiz-question-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: auto;
}

.quiz-question-header {
    display: flex;
    align-items: baseline;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.quiz-question-header .question-num {
    font-size: 20px;
    font-weight: bold;
    color: #007bff;
    margin-right: 15px;
}

.quiz-question-header p {
    margin: 0;
    font-size: 17px;
    color: #333;
}

.quiz-question-body .question-text {
    font-size: 17px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.quiz-options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quiz-option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    cursor: pointer;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: background-color 0.2s, border-color 0.2s;
}

.quiz-option-item:hover {
    background-color: #f0f2f5;
    border-color: #c0c0c0;
}

.quiz-option-item input[type="radio"] {
    transform: scale(1.3);
    margin-right: 5px;
    accent-color: #007bff;
}

.fill-in-blank-input {
    width: calc(100% - 22px);
    padding: 12px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

.quiz-navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
}

.timer {
    background-color: #f2f2f2;
    padding: 8px 12px;
    border-radius: 5px;
    font-weight: bold;
    color: #d9534f;
    font-size: 15px;
}
/* === BỔ SUNG CSS MỚI CHO GIAO DIỆN GỌN GÀNG HƠN === */

/* Kiểu cho nút "+ Thêm đáp án" mới */
.btn-add-option-simple {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 15px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 15px;
    transition: background-color 0.2s;
}
.btn-add-option-simple:hover {
    background-color: #e9ecef;
}

/* Căn chỉnh lại ô điểm số */
.question-score {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.question-score label {
    font-weight: normal;
}
.question-score input {
    width: 60px;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 5px;
}

/* Loại bỏ header cũ của card câu hỏi */
.question-card-header {
    display: none;
}

/* Style mới cho card câu hỏi */
.question-card {
    position: relative;
    padding-top: 40px;
}

/* Style mới cho bộ chọn loại câu hỏi và nút xóa */
.question-top-actions {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}
.question-top-actions select {
    padding: 5px 10px;
    border: 1px solid #007bff;
    color: #007bff;
    border-radius: 5px;
    font-weight: 500;
}
.question-top-actions .delete-question-btn {
    color: #dc3545;
    font-size: 1.2em;
    cursor: pointer;
}