:root {
  --primary: #3498db;
  --primary-hover: #2980b9;
  --bg-color: #f5f7fa;
  --card-bg: #ffffff;
  --text-color: #333333;
  --success: #2ecc71;
  --danger: #e74c3c;
  --selected-bg: #d6eaf8;
  --selected-border: #3498db;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  background: var(--card-bg);
  width: 90%;
  max-width: 600px;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

h1 {
  text-align: center;
  color: var(--primary);
  font-size: 24px;
}

.header-info {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  margin-bottom: 20px;
}

#q-timer {
  color: var(--danger);
}

.question-text {
  font-size: 18px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.btn-answer {
  display: block;
  width: 100%;
  padding: 15px;
  margin-bottom: 10px;
  background-color: #f1f2f6;
  border: 2px solid transparent;
  border-radius: 8px;
  text-align: left;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
}

.btn-answer:hover {
  background-color: #dfe4ea;
}

.btn-answer.selected {
  background-color: var(--selected-bg);
  border-color: var(--selected-border);
  font-weight: bold;
}

.btn-submit {
  display: block;
  width: 100%;
  padding: 15px;
  margin-top: 20px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: 0.3s;
}

.btn-submit:hover {
  background-color: var(--primary-hover);
}

.hidden {
  display: none;
}

.timer-bar {
  width: 100%;
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 15px;
}

#progress {
  width: 100%;
  height: 100%;
  background: var(--danger);
  transition: width 1s linear;
}

.info-box {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: left;
}

.navigation-buttons {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.btn-nav {
  padding: 12px 20px;
  background-color: var(--success);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
  width: 100%;
}

.btn-nav:hover {
  background-color: #27ae60;
}

/* CSS cho phần xem lại bài làm */
#reviewContent {
  max-height: 60vh;
  overflow-y: auto;
  text-align: left;
  padding-right: 10px;
}

.review-q {
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
  margin-bottom: 15px;
}

.review-ans {
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 5px;
  background: #f1f2f6;
}

.review-ans.correct {
  background-color: var(--success);
  color: white;
  font-weight: bold;
}

.review-ans.wrong {
  background-color: var(--danger);
  color: white;
  font-weight: bold;
}

/* Tùy chỉnh thanh cuộn */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* CSS CHO MODAL THÔNG BÁO VÀ XÁC NHẬN */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6); /* Nền mờ tối */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999; /* Đảm bảo nổi lên trên cùng */
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal.hidden {
  display: none;
  opacity: 0;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  /* Hiệu ứng trượt nhẹ từ trên xuống */
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content p {
  color: #555;
  line-height: 1.5;
}

/* PHẦN GIAO DIỆN KẾT QUẢ MỚI */
.result-header {
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.student-info-result {
  text-align: left;
  background: #f9f9f9;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #ddd;
  margin-bottom: 20px;
}

.student-info-result p {
  margin: 8px 0;
  font-size: 16px;
}

/* KHUNG KẾT QUẢ VIỀN DOUBLE 5PX MÀU ĐỎ */
.score-container {
  border: 5px double #e74c3c; /* Viền double 5px màu đỏ */
  padding: 25px;
  border-radius: 15px;
  background-color: #fff5f5; /* Nền hồng nhạt để nổi bật màu đỏ */
  text-align: center;
  margin: 20px 0;
}

.score-number {
  font-size: 54px;
  font-weight: bold;
  color: #e74c3c;
  margin: 10px 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.score-label {
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #c0392b;
  font-weight: bold;
}
