/* ====== POPULAR EXAMS ====== */
.popular-exams-box {
  margin: 30px auto 20px;
  max-width: 600px;
  background: #fff0f3;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 6px rgba(255,0,0,0.05);
}
.popular-exams-box h3 {
  margin-top: 0;
  font-size: 18px;
  color: #d90429;
  text-align: center;
}
#popular-exams-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
#popular-exams-list li {
  padding: 8px 12px;
  border-bottom: 1px solid #ffd6e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  gap: 8px;
}
#popular-exams-list li:last-child {
  border-bottom: none;
}
#popular-exams-list .pop-exam-title {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#popular-exams-list .pop-exam-count {
  color: #d90429;
  font-weight: bold;
  font-size: 14px;
  margin-left: 8px;
}

/* ====== COMMENTS MODAL ====== */
#comment-modal .modal-content {
  max-width: 500px;
  width: 95vw;
}
#comments-list {
  margin-bottom: 10px;
}
#comments-list .comment-item {
  border-bottom: 1px solid #eee;
  padding: 8px 0;
  font-size: 15px;
}
#comments-list .comment-rating {
  color: #fbbf24;
  font-size: 16px;
  margin-right: 6px;
}
#comments-list .comment-text {
  display: inline;
}
#comments-list .comment-date {
  color: #888;
  font-size: 12px;
  margin-left: 8px;
}

/* ====== SHARING BUTTONS ====== */
#share-box {
  display: flex;
  align-items: center;
  gap: 6px;
}
#share-box button {
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
#share-fb { background: #1877f2; color: #fff; }
#share-fb:hover { background: #145db2; }
#share-zalo { background: #008fe5; color: #fff; }
#share-zalo:hover { background: #005fa3; }
#share-copy { background: #eee; color: #222; }
#share-copy:hover { background: #ccc; }

@media (max-width: 600px) {
  .popular-exams-box, .favorites-box {
    max-width: 98vw;
    padding: 10px;
  }
  #popular-exams-list li, #favorites-list li {
    font-size: 14px;
    padding: 6px 4px;
  }
  #share-box span { font-size: 13px; }
}
/* RESET CƠ BẢN */
body {
  font-family: sans-serif;
  background: #f8f9fa;
  margin: 0;
  padding: 0;
}

/* CONTAINER CHÍNH */
.container {
  max-width: 800px;
  margin: 30px auto;
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
  text-align: center;
}

h1 {
  font-size: 28px;
  margin-bottom: 20px;
}

/* INPUT & SELECT CHUNG */
input[type="text"], select {
  width: 100%;
  max-width: 400px;
  padding: 12px 20px;
  margin: 10px auto;
  display: block;
  font-size: 16px;
  border-radius: 50px; /* 👈 Bo tròn Google-style */
  border: 1px solid #ccc;
  box-sizing: border-box;
  outline: none;
  transition: box-shadow 0.2s ease;
  appearance: none; /* 👈 ẩn mũi tên mặc định */
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg fill='gray' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center; /* 👈 mũi tên sang trái một chút */
  background-size: 16px;
  transition: box-shadow 0.2s ease;
}

input[type="text"]:focus {
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2);
}

select:disabled {
  background-color: #f1f1f1;
  color: #999;
  cursor: not-allowed;
  border-color: #ccc;
  opacity: 0.7;
}

/* COMBOBOX SELECTORS */
.selectors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.selectors select {
  width: 160px;
}

select:focus {
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2);
}

input[type="text"]:hover,
select:hover {
  border-color: #888;
}

/* FILE VIEWER */
#file-viewer {
  margin: 40px auto;
  max-width: 1000px;
  padding: 10px;
  text-align: center;
}

#file-viewer iframe {
  width: 100%;
  height: 90vh;
  border: none;
}

#file-viewer img {
  max-width: 100%;
  height: auto;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* GỢI Ý TỰ ĐỘNG */
.suggestion-box {
  list-style: none;
  padding: 0;
  margin-top: 0;
  max-height: 300px;
  overflow-y: auto;
  width: 100%;
  max-width: 400px;
  margin: auto;
  border: 1px solid #ddd;
  border-top: none;
  background: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  border-radius: 0 0 12px 12px;
  z-index: 100;
  position: relative;
}

.suggestion-box li {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  font-size: 15px;
  cursor: pointer;
}

.suggestion-box li:hover {
  background: #f1f3f4;
}

.suggestion-box li::before {
  content: "";
  margin-right: 8px;
  font-size: 14px;
}

.suggestion-box li.active {
  background-color: #e8f0fe;
}

/* NÚT ỦNG HỘ */
#donate-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #ffb703;
  color: black;
  border: none;
  padding: 10px 16px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  z-index: 999;
  transition: background-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

#donate-btn:hover {
  background-color: #fb8500; /* Màu cam đậm hơn */
  color: white;
  transform: scale(1.05); /* Nhẹ nhàng phóng to lên một chút */
}

/* MODAL */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
}

/* MODAL NỘI DUNG */
.modal-content {
  background: white;
  margin: 5% auto;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  box-sizing: border-box;
  position: relative;
  text-align: left;
}

/* FORM TRONG MODAL */
.modal-content input,
.modal-content select {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  font-size: 16px;
  box-sizing: border-box;
}

.modal-content button[type="submit"] {
  background-color: #219ebc;
  color: white;
  border: none;
  padding: 12px;
  font-size: 16px;
  width: 100%;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.modal-content button[type="submit"]:hover {
  background-color: #197a9b;
}

/* NÚT ĐÓNG MODAL */
#close-modal {
  position: absolute;
  right: 12px;
  top: 8px;
  font-size: 24px;
  cursor: pointer;
}

/* RESPONSIVE CHO MOBILE */
@media (max-width: 480px) {
  .modal-content {
    margin: 10% auto;
    padding: 15px;
  }

  .modal-content input,
  .modal-content select {
    font-size: 14px;
  }

  .modal-content button[type="submit"] {
    font-size: 14px;
    padding: 10px;
  }
}

/* Nút Facebook góc trái */
#facebook-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 999;
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

#facebook-btn:hover {
  transform: scale(1.1);
}

#facebook-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Nút Bảng Xếp Hạng */
#leaderboard-btn {
  position: fixed;
  top: 20px;
  right: 155px; /* dịch qua trái so với nút donate */
  background-color: #8ecae6;
  color: black;
  border: none;
  padding: 10px 16px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  z-index: 999;
  transition: background 0.3s ease;
}

#leaderboard-btn:hover {
  background-color: #219ebc;
  color: white;
  transform: scale(1.05);
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 16px;
}

.ranking-table thead {
  background-color: #f1f3f4;
}

.ranking-table th, .ranking-table td {
  padding: 12px;
  border-bottom: 1px solid #ddd;
  text-align: center;
}

.ranking-table tr:hover {
  background-color: #f9f9f9;
}

.ranking-table td:first-child {
  font-weight: bold;
  font-size: 18px;
}

.modal-content h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 22px;
  color: #333;
}

.upgrade-box {
  background: #fff3cd;
  padding: 16px;
  border: 1px solid #ffeeba;
  border-radius: 10px;
  margin: 20px auto;
  max-width: 600px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  text-align: center;
}

.progress-bar {
  background-color: #e0e0e0;
  border-radius: 20px;
  overflow: hidden;
  height: 20px;
  width: 100%;
  margin: 10px auto 16px;
}

.progress-fill {
  background: linear-gradient(90deg, #00c9a7, #00b4d8);
  height: 100%;
  width: 0%;
  transition: width 0.6s ease;
}

#support-btn {
  background-color: #fb6f92;
  color: white;
  border: none;
  padding: 10px 16px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  z-index: 999;
  transition: background 0.3s ease;
}

#support-btn:hover {
  background-color: #d35d7d;
}

#close-upgrade-modal {
  position: absolute;
  right: 12px;
  top: 8px;
  font-size: 24px;
  cursor: pointer;
}

.favorites-box {
  margin: 40px auto 20px;
  max-width: 600px;
  background: #f0f4ff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 6px rgba(0,0,0,0.05);
}

.favorites-box h3 {
  margin-top: 0;
  font-size: 18px;
  color: #333;
  text-align: center;
}

#favorites-list {
  list-style: none;
  padding: 0;
}

#favorites-list li {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #ddd;
  transition: background 0.2s ease;
}

#favorites-list li:hover {
  background: #e3eaff;
}

.bookmark-toggle {
  background-color: #ffd166;
  color: #333;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

.bookmark-toggle:hover {
  background-color: #fcbf49;
}

#favorites-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.remove-fav {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #888;
}

.remove-fav:hover {
  color: red;
}

/* ===== CUSTOM DROPDOWN (Thay cho select) ===== */

.custom-dropdown {
  position: relative;
  width: 160px;
  margin: 10px;
  font-size: 16px;
  user-select: none;
}

.dropdown-selected {
  background-color: white;
  border: 1px solid #ccc;
  padding: 12px 16px;
  border-radius: 50px;
  cursor: pointer;
  transition: box-shadow 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  position: relative;
  text-align: left;
  padding-right: 36px; /* chừa chỗ cho mũi tên */
}

.dropdown-selected::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg fill='gray' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

.dropdown-options {
  list-style: none; /* ✅ bỏ dấu chấm gốc */
  padding: 0;
  margin: 0;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-height: 240px;
  overflow-y: auto;
  z-index: 999;
  display: none;
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Chrome, Edge */
.dropdown-options::-webkit-scrollbar {
  width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 8px;
}

.dropdown-options::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  transition: background 0.2s ease;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.3);
}

.dropdown-options li {
  list-style: none; /* ✅ loại bỏ dấu chấm từng dòng */
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 15px;
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.5;
  text-align: middle;
}

.dropdown-options li:hover {
  background-color: #f1f3f4;
}

/* Optional: active item */
.dropdown-options li.active {
  background-color: #e8f0fe;
  font-weight: bold;
}

/* Responsive fix nếu cần */
@media (max-width: 480px) {
  .custom-dropdown {
    width: 100%;
    max-width: 400px;
  }
}

.custom-dropdown.disabled .dropdown-selected {
  background-color: #f1f1f1;
  color: #999;
  cursor: not-allowed;
  border-color: #ccc;
  opacity: 0.6;
}

.custom-dropdown.disabled .dropdown-selected::after {
  opacity: 0.4;
}

.donate-button {
  background-color: #ffffff;
  display: flex;
  width: 568px;
  height: 100px;
  margin: 20px auto;
  position: relative;
  border-radius: 6px;
  transition: 0.3s ease-in-out;
  overflow: hidden;
}

.donate-button:hover {
  transform: scale(1.03);
}

.donate-button:hover .left-side {
  width: 100%;
}

.left-side {
  background-color: #5de2a3;
  width: 110px;
  height: 100px;
  border-radius: 4px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: 0.3s;
  flex-shrink: 0;
  overflow: hidden;
}

.right-side {
  width: calc(100% - 110px);
  display: flex;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
  justify-content: space-between;
  white-space: nowrap;
  transition: 0.3s;
}

.right-side:hover {
  background-color: #f9f7f9;
}

.arrow {
  width: 18px;
  height: 18px;
  margin-right: 15px;
}

.new {
  font-size: 18px;
  font-family: "Lexend Deca", sans-serif;
  margin-left: 16px;
}

.card {
  width: 60px;
  height: 40px;
  background-color: #c7ffbc;
  border-radius: 6px;
  position: absolute;
  display: flex;
  z-index: 10;
  flex-direction: column;
  align-items: center;
  box-shadow: 9px 9px 9px -2px rgba(77, 200, 143, 0.72);
}

.card-line {
  width: 55px;
  height: 10px;
  background-color: #80ea69;
  border-radius: 2px;
  margin-top: 7px;
}

.buttons {
  width: 8px;
  height: 8px;
  background-color: #379e1f;
  box-shadow: 0 -10px 0 0 #26850e, 0 10px 0 0 #56be3e;
  border-radius: 50%;
  margin-top: 5px;
  transform: rotate(90deg);
  margin: 10px 0 0 -30px;
}

.post {
  width: 55px;
  height: 65px;
  background-color: #dddde0;
  position: absolute;
  z-index: 11;
  bottom: 10px;
  top: 100px;
  border-radius: 6px;
  overflow: hidden;
}

.post-line {
  width: 42px;
  height: 8px;
  background-color: #545354;
  position: absolute;
  border-radius: 0px 0px 3px 3px;
  right: 7px;
  top: 8px;
}

.post-line:before {
  content: "";
  position: absolute;
  width: 42px;
  height: 8px;
  background-color: #757375;
  top: -8px;
}

.screen {
  width: 42px;
  height: 20px;
  background-color: #ffffff;
  position: absolute;
  top: 22px;
  right: 7px;
  border-radius: 3px;
}

.numbers {
  width: 10px;
  height: 10px;
  background-color: #838183;
  box-shadow: 0 -16px 0 0 #838183, 0 16px 0 0 #838183;
  border-radius: 2px;
  position: absolute;
  transform: rotate(90deg);
  left: 22px;
  top: 52px;
}

.numbers-line2 {
  width: 10px;
  height: 10px;
  background-color: #aaa9ab;
  box-shadow: 0 -16px 0 0 #aaa9ab, 0 16px 0 0 #aaa9ab;
  border-radius: 2px;
  position: absolute;
  transform: rotate(90deg);
  left: 22px;
  top: 66px;
}

.donate-button:hover .card {
  animation: slide-top 1.2s cubic-bezier(0.645, 0.045, 0.355, 1) both;
}

.donate-button:hover .post {
  animation: slide-post 1s cubic-bezier(0.165, 0.84, 0.44, 1) both;
}

.dollar {
  position: absolute;
  font-size: 14px;
  font-family: "Lexend Deca", sans-serif;
  width: 100%;
  left: 0;
  top: 0;
  color: #4b953b;
  text-align: center;
}

.donate-button:hover .dollar {
  animation: fade-in-fwd 0.3s 1s backwards;
}

@keyframes slide-top {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-60px) rotate(90deg);
  }

  60% {
    transform: translateY(-60px) rotate(90deg);
  }

  100% {
    transform: translateY(-5px) rotate(90deg);
  }
}

@keyframes slide-post {
  50% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-60px);
  }
}

@keyframes fade-in-fwd {
  0% {
    opacity: 0;
    transform: translateY(-5px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

#feedback-btn {
  position: fixed;
  top: 22px;
  right: 320px;
  z-index: 999;
  background: #f704c2;
  color: #222;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

#feedback-btn:hover {
  background: #df1aad;
  color: white;
  transform: translateY(-1px);
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#note-btn {
  position: fixed;
  top: 22px;
  right: 435px;
  z-index: 999;
  background: #9a9899;
  color: #222;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

#note-btn:hover {
  background: #b1afb0;
  color: white;
  transform: translateY(-1px);
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Hiệu ứng mở modal */
@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}