/* =====================================================
   ROOT COLOR VARIABLES (không ảnh hưởng UI)
===================================================== */
:root {
  --purple: #6750a4;
  --purple-dark: #46327e;
  --purple-light: #eaddff;
  --purple-lighter: #ede7f6;
  --purple-strong: #b6a2d3;

  --gray-1: #202124;
  --gray-2: #3c4043;

  --danger: #b00020;
  --red-icon: #b3261e;
  --transition: 0.25s ease;
}

/* =====================================================
   LAYOUT
===================================================== */
.container-fluid-quiz {
  padding: 20px 30px;
}

.card-md {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.08);
}

/* =====================================================
   SIDEBAR
===================================================== */
.sidebar-left .section-title,
.sidebar-right .menu-title {
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--gray-1);
}

.sidebar-left .info-text {
  font-size: .9rem;
  color: var(--gray-2);
  margin-bottom: 6px;
}

.sidebar-left .time-remaining {
  font-weight: 700;
  color: var(--purple);
  font-size: 1.3rem;
  margin-bottom: 15px;
}

/* =====================================================
   BUTTONS
===================================================== */
/* =====================================================
   BUTTONS
===================================================== */
.btn-red,
.btn-blue {
  color: #fff;
  border-radius: 12px;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  box-shadow: 0 3px 6px rgb(103 80 164 / 0.5);
  transition: var(--transition);
  cursor: pointer;
}

.btn-red {
  background: #388da8;
}
.btn-red:hover {
  background: #77b6ca;
}

.btn-blue {
  background: var(--purple);
}
.btn-blue:hover {
  background: var(--purple-dark);
}

/* Disabled state - giữ nguyên màu nền hiện tại, không đổi hover */
.btn-red:disabled {
  background: #388da8; /* giữ màu nền gốc của btn-red */
  color: #fff;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: 0 3px 6px rgb(103 80 164 / 0.5); /* giữ shadow */
}

.btn-blue:disabled {
  background: var(--purple); /* giữ màu nền gốc của btn-blue */
  color: #fff;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: 0 3px 6px rgb(103 80 164 / 0.5);
}

/* Hover chỉ áp dụng khi chưa disabled */
.btn-red:not(:disabled):hover {
  background: #77b6ca;
}

.btn-blue:not(:disabled):hover {
  background: var(--purple-dark);
}

/* =====================================================
   PART ITEMS
===================================================== */
.part-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.part-list-item:hover {
  background: var(--purple-light);
}

.part-list-item-icon {
  width: 38px;
  height: 38px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  font-size: 22px;
  background: var(--red-icon);
  color: #fff;
}

/* =====================================================
   QUESTION CARD
===================================================== */
.card-question {
  background: #fff;
  border-radius: 20px;
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: 0 2px 6px rgb(60 64 67 / 0.12);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .3s, transform .3s;
  display: none;
}
.card-question.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Header */
.question-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 12px;
}
.question-type {
  color: var(--purple);
  font-weight: 600;
  font-size: .9rem;
}
.question-marker {
  font-size: 20px;
  font-weight: 800;
  padding: 4px 10px;
  background: var(--purple-strong);
  border-radius: 6px;
}

/* =====================================================
   QUESTION TEXT
===================================================== */
.question-text {
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--gray-1);
  margin-bottom: 18px;
  transition: color .3s;
}
.card-question.current .question-text {
  color: var(--purple-dark);
  padding-bottom: 20px;
}

/* =====================================================
   OPTIONS (gộp toàn bộ)
===================================================== */
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 14px;
  font-weight: 500;
  color: var(--gray-2);
  padding: 4px 8px;
  border-radius: 8px;
  transition: background .3s, color .3s;
}
.option:hover {
  background: #f4f3f6;
  color: var(--purple);
}

.option input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.option input[type="radio"]:checked + span {
  color: var(--purple);
  font-weight: 700;
}

/* =====================================================
   QUESTION GRID
===================================================== */
.question-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.qbox {
  border: 1.8px solid #c1c7e4;
  border-radius: 8px;
  text-align: center;
  padding: 9px 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--purple);
  transition: var(--transition);
  user-select: none;
}
.qbox:hover {
  background: var(--purple-light);
  border-color: var(--purple-dark);
  color: var(--purple-dark);
}
.qbox.answered {
  background: var(--purple-lighter);
  border-color: var(--purple);
  color: var(--purple-dark);
}
.qbox.current {
  background: var(--purple-strong);
  border-color: var(--purple);
  color: var(--purple-dark);
}

/* =====================================================
   RESPONSIVE (giữ nguyên logic)
===================================================== */
@media (max-width: 1200px) {
  .question-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 992px) {
  .container-fluid { padding: 20px 15px; }
  .question-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 768px) {
  .row { flex-wrap: wrap; }
  .sidebar-left, .sidebar-right, .questions-column {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 20px;
  }
  .question-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 576px) {
  .question-grid { grid-template-columns: repeat(3, 1fr); }
}

/* =====================================================
   TOAST
===================================================== */
.toast-message {
  background: var(--purple);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  margin-bottom: 10px;
  font-weight: 500;
  min-width: 200px;
  max-width: 300px;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity .3s, transform .3s;
}
.toast-message.show {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================
   GUIDELINE
===================================================== */
.guideline-card { margin-top: 20px; }

.guideline-title {
  font-weight: 700 !important;
  font-size: 1.4rem !important;
  color: var(--purple) !important;
  text-align: center !important;
  margin-bottom: 20px !important;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  animation: fadeSlideIn .6s forwards;
  opacity: 0;
  transform: translateY(-20px);
}

.guideline-title i {
  font-size: 1.5rem;
  color: var(--purple);
  animation: bounce 1.2s infinite alternate;
}

@keyframes fadeSlideIn {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bounce {
  to { transform: translateY(-5px); }
}

.guideline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f4f3f6;
  margin-bottom: 8px;
}

/* .guideline-item-icon { */
/*   width: 36px; */
/*   height: 36px; */
/*   border-radius: 50%; */
/*   display: flex; */
/*   justify-content: center; */
/*   align-items: center; */
/*   font-size: 18px; */
/* } */

/* =====================================================
   QUIZ INFO HEADER
===================================================== */
.quiz-info-card {
  border-radius: 20px;
  padding: 20px;
}

.quiz-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--purple-dark);
  display: flex;
  align-items: center;
}

.quiz-description { font-size: .95rem; }

.quiz-meta div {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .95rem;
}
.quiz-meta i {
  font-size: 1.1rem;
}

/* =====================================================
   TIMER
===================================================== */
.time-remaining {
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--danger);
  text-align: center;
  background: var(--purple-lighter);
  border-radius: 12px;
  padding: 8px 12px;
}

.time-remaining.warning {
  color: #fff;
  background: var(--danger);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  50% { transform: scale(1.1); }
}

/* =====================================================
   QUIZ HEADER
===================================================== */
.quiz-header {
  width: 100%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
  padding: 8px 20px;
  position: sticky;
  top: 0;
  margin-bottom: 20px;
  border-radius: 10px;
  z-index: 1000;
}

.quiz-header .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.2rem;
  color: #7a19ef;
}

.quiz-header .logo img {
  height: 60px;
}

.header-buttons button.btn-zoom {
  border: none;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
}

.header-buttons .user-avatar img {
  width: 40px;
  height: 40px;
  object-fit: cover;
}

/* =====================================================
   FULLSCREEN
===================================================== */
:fullscreen,
:-webkit-full-screen,
:-ms-fullscreen,
.container-fluid-quiz:-webkit-full-screen,
.container-fluid-quiz:-ms-fullscreen,
html:fullscreen,
body:fullscreen,
html:-webkit-full-screen,
body:-webkit-full-screen,
html:-ms-fullscreen,
body:-ms-fullscreen {
  background: #fff !important;
  color: var(--gray-1);
}

/* =====================================================
   FADE-IN ANIM
===================================================== */
.fade-in {
  opacity: 0;
  transform: translateY(15px);
  animation: fadeInAnim 1.2s ease-out forwards;
}
@keyframes fadeInAnim {
  to { opacity: 1; transform: translateY(0); }
}

/* Prev/Next spacing */
#prevBtn { margin-right: 10px; }
#confirmBtn { margin-left: 10px; }

/* Wrapper chung */
.violation-warnings {
    padding: 0;             /* bỏ padding trên/dưới */
    margin-top: 10px;       /* khoảng cách với progress bar */
}

/* Tiêu đề "Lưu ý khi thi" */
.violation-warnings .section-title {
    margin: 0 0 4px 0;      /* bỏ margin lớn */
    font-weight: 600;
    font-size: 0.9rem;
    color: #b3261e;
}

/* Danh sách vi phạm */
.violation-warnings .violation-list {
    margin: 0;              /* bỏ margin mặc định của ul */
    padding-left: 16px;     /* indent nhẹ cho danh sách */
    list-style-type: disc;
}

.violation-warnings .violation-list li {
    margin: 2px 0;          /* li gần nhau hơn */
    font-size: 0.85rem;
    color: #333;
}
/* Khi bất kỳ element nào đang fullscreen */
:fullscreen,
:-webkit-full-screen,
:-ms-fullscreen {
    background-color: #ffffff !important; /* nền trắng */
    color: #202124;
}

/* Safari / Chrome */
.container-fluid-quiz:-webkit-full-screen {
    background-color: #ffffff !important;
}

/* IE11 */
.container-fluid-quiz:-ms-fullscreen {
    background-color: #ffffff !important;
}

/* body và html khi fullscreen cũng chuyển nền trắng */
html:fullscreen, body:fullscreen,
html:-webkit-full-screen, body:-webkit-full-screen,
html:-ms-fullscreen, body:-ms-fullscreen {
    background-color: #ffffff !important;
}
#confirmSubmit,#confirmBack:hover,
#confirmSubmit,#confirmBack:focus,
#confirmSubmit,#confirmBack:active {
    border-color: #0d6efd !important;
    color: #fff !important;               /* chữ luôn trắng */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}