/* Reset mặc định */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  list-style: none;
}

html {
  font-size: 62.5%; /* Điều chỉnh font size gốc */
  scroll-behavior: smooth;
}

body {
  font-size: 1.6rem;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(to bottom, #f3f7ec, #bce2e7);
  height: 100vh;
  display: flex;
  justify-content: center;
  color: #333;
  align-items: center;
  padding: 0 1rem; /* Đảm bảo khoảng cách giữa các cạnh màn hình */
}

/* Biến màu chủ đạo */
:root {
  --main-clr: #273d30;
}

.quiz_wrapper {
  background-color: white;
  min-height: 50rem;
  width: 100%; /* Để chiều rộng có thể tự động điều chỉnh */
  max-width: 80rem; /* Đặt giới hạn chiều rộng */
  border-radius: 10px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.quiz_header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 4rem;
  flex-wrap: wrap; /* Cho phép phần tử xuống dòng khi không đủ không gian */
}

.quiz_timer {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quiz_timer > i {
  font-size: 3rem;
}

.quiz_timer_text {
  display: flex;
  flex-direction: column;
  font-weight: bold;
}

.quiz_timer_text > span {
  font-size: 1rem;
  color: #333333a1;
}

.quiz_timer_text > p {
  color: var(--main-clr);
  letter-spacing: 3px;
}

/* Button chung */
button {
  padding: 0.8rem 2.5rem;
  background: var(--main-clr);
  border-radius: 10px;
  color: white;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: 0.5s;
}

/* Phần container quiz */
.quiz_container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  flex-wrap: wrap; /* Cho phép các phần tử trong container co giãn tự động */
}

/* Các câu hỏi */
.quiz_question {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 2rem;
  flex: 1;
}

.quiz_progress {
  display: none; /* Ẩn phần tử */
}

.quiz_progress svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  pointer-events: none;
}

.quiz_progress svg circle {
  transform: translate(50%, 50%);
  fill: none;
  stroke: #ddd;
  stroke-width: 10px;
  stroke-linecap: round;
}

#progress {
  stroke: var(--main-clr);
  stroke-dasharray: 250 9999;
  transition: 0.5s;
}

#progress_text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: bold;
  color: var(--main-clr);
}

/* Điều chỉnh đáp án để văn bản tự xuống dòng */
.quiz_question ul li {
  display: flex;  /* Đảm bảo các phần tử con trong li được căn chỉnh linh hoạt */
  align-items: center; /* Căn giữa nội dung đáp án */
  padding: 1rem 2rem;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  cursor: pointer;
  white-space: normal; /* Cho phép văn bản xuống dòng */
  flex: 1 1 auto; /* Tự động co giãn, nhưng không vượt quá không gian có sẵn */
  min-width: 15rem; /* Đặt chiều rộng tối thiểu của mỗi ô đáp án */
  height: auto; /* Chiều cao tự động */
  word-wrap: break-word; /* Cho phép từ dài xuống dòng */
  overflow-wrap: break-word; /* Giúp xử lý các từ dài không bị tràn ra ngoài */
}

/* Điều chỉnh phần tử chứa các đáp án để tự động giãn */
.quiz_question ul {
  display: flex;
  flex-wrap: wrap; /* Cho phép đáp án xuống dòng nếu không đủ không gian */
  gap: 2rem; /* Khoảng cách giữa các phần tử */
}

/* Khi chọn đáp án */
.quiz_question ul li.active {
  background: var(--main-clr);
  color: white;
  transition: 0.5s;
}

.quiz_question ul li.incorrect {
  background: red;
  color: white;
  transition: 0.5s;
}

/* Điều chỉnh phần tử câu hỏi */
.quiz_question > p {
  font-weight: bold;
  font-size: 1.6rem;
  height: auto; /* Chiều cao tự động */
  white-space: normal; /* Cho phép văn bản xuống dòng khi cần thiết */
  word-wrap: break-word; /* Cho phép các từ dài xuống dòng */
  overflow-wrap: break-word; /* Giúp xử lý các từ dài không bị tràn ra ngoài */
}

/* Quản lý các số câu hỏi */
.quiz_numbers {
  display: flex;
  gap: 1.5rem;
  margin-top: 5rem;
  justify-content: center;
}

.quiz_numbers > ul {
  display: flex;
  gap: 1.5rem;
  width: 100%;
  overflow-x: auto;
  padding: 1px;
}

ul::-webkit-scrollbar {
  display: none;
}

ul {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.quiz_numbers > ul > li {
  width: 4rem;
  height: 4rem;
  flex-shrink: 0;
  text-align: center;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  line-height: 4rem;
  cursor: pointer;
  border: 2px solid transparent;
}

.quiz_numbers > ul > li.selected {
  background-color: var(--main-clr);
  color: white;
}

.quiz_numbers > ul > li.active {
  border: 2px solid var(--main-clr);
}

.quiz_numbers > ul > li.incorrect {
  background-color: red;
  color: white;
}

.quiz_numbers > button {
  padding: 0.5rem 2rem;
  background: white;
  border: 1px solid var(--main-clr);
  color: var(--main-clr);
}
