:root {
  --q-progress: rgba(165, 165, 165, 0.411);
  --q-text: black;
  --ind-strong: #621c9f;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --q-progress: rgba(255, 255, 255, 0.05);
    --q-text: rgb(255, 255, 255);
    --ind-strong: #00ffea;
  }
}

[data-theme="light"] {
  --q-progress: rgba(165, 165, 165, 0.411);
  --q-text: black;
  --ind-strong: #621c9f;
}
[data-theme="dark"] {
  --q-progress: rgba(255, 255, 255, 0.05);
  --q-text: rgb(255, 255, 255);
  --ind-strong: #00ffea;
}

/* Disable text selection and copying */
.quiz-container,
.quiz-container * {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

/* Navigation breadcrumb-q Container */
nav[aria-label="breadcrumb-q"] {
  margin-bottom: 1.5rem;
  padding: 0;
  position: relative;
  z-index: 10;
}

/* Back Button */
.backQuiz {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 10px 8px !important;
  background: var(--bottom-theme);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.7rem !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(59, 130, 246, 0.15);
  margin: 5px 0;
  width: 138px !important;
  border-radius: 30px 8px 8px 30px !important;
}

.backQuiz::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.1) 0%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.backQuiz::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.backQuiz:hover {
  transform: translateX(-3px);
  box-shadow:
    0 4px 20px rgba(59, 130, 246, 0.15),
    0 0 0 1px rgba(59, 130, 246, 0.2);
  background: var(--bottom-theme);
  border-color: rgba(59, 130, 246, 0.3);
  color: #f1f5f9;
}

.backQuiz:hover::before {
  opacity: 1;
}

.backQuiz:hover::after {
  opacity: 1;
}

.backQuiz:active {
  transform: translateX(-1px);
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.2);
}

.backQuiz::first-letter {
  font-size: 1.1rem;
  font-weight: 700;
  color: #3b82f6;
  margin-right: 0.25rem;
}

/* Quiz Header Container */
.quiz-header {
  padding: 2.75rem 3rem;
  margin-bottom: 2.5rem;
  margin-top: 2.5rem;
  position: relative;
  overflow: hidden;
}

/* Quiz Title */
.quiz-header h1 {
  color: var(--text-color) !important;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 2rem 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

/* Progress Indicator Container */
.progress-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

/* Question Counter */
.progress-indicator > span:first-child {
  display: inline-flex;
  align-items: center;
  background: var(--q-progress) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.875rem 1.75rem;
  border-radius: 10px;
  color: var(--q-text);
  font-size: 1.05rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.progress-indicator > span:first-child:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.progress-indicator > span:first-child strong {
  font-weight: 700;
  margin: 0 0.35rem;
  color: var(--ind-strong);
  font-size: 1.2rem;
}

/* Hint Counter */
.hint-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  background: linear-gradient(
    135deg,
    rgba(30, 41, 59, 0.8) 0%,
    rgba(51, 65, 85, 0.8) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.875rem 1.75rem;
  border-radius: 10px;
  color: #f1f5f9;
  font-weight: 600;
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.hint-counter:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 16px rgba(59, 130, 246, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-color: rgba(59, 130, 246, 0.35);
}

.hint-counter span:first-child {
  font-size: 1.6rem;
  display: inline-block;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.3));
}

.hint-counter span:last-child {
  font-size: 1.05rem;
  position: relative;
  z-index: 1;
  color: #f2f5f8;
}

.hint-counter strong {
  font-weight: 700;
  font-size: 1.25rem;
  margin-left: 0.35rem;
  color: #dfb600;
}

/* Tablet Responsive (768px - 1024px) */
@media (max-width: 1024px) {
  .quiz-header {
    padding: 2.5rem 2.5rem;
    border-radius: 18px;
  }

  .quiz-header h1 {
    font-size: 2.25rem;
  }
}

/* Tablet Portrait (600px - 768px) */
@media (max-width: 768px) {
  nav[aria-label="breadcrumb-q"] {
    margin-bottom: 1.25rem;
  }

  .backQuiz {
    padding: 0.7rem 1.15rem 0.7rem 0.9rem;
    font-size: 0.875rem;
    border-radius: 9px;
  }

  .quiz-header {
    padding: 2.25rem 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
  }

  .quiz-header h1 {
    font-size: 2rem;
    margin-bottom: 1.75rem;
  }

  .hint-counter strong {
    font-size: 1.2rem;
  }
}

/* Mobile Landscape (481px - 600px) */
@media (max-width: 600px) {
  .backQuiz {
    padding: 0.65rem 1.1rem 0.65rem 0.85rem;
    font-size: 0.85rem;
    gap: 0.4rem;
  }

  .quiz-header {
    padding: 2rem 1.75rem;
    border-radius: 14px;
  }

  .quiz-header h1 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
  }
}

/* Mobile Portrait (320px - 480px) */
@media (max-width: 480px) {
  nav[aria-label="breadcrumb-q"] {
    margin-bottom: 1rem;
    padding: 0;
  }

  .backQuiz {
    padding: 0.6rem 1rem 0.6rem 0.8rem;
    font-size: 0.825rem;
    border-radius: 8px;
    gap: 0.4rem;
  }

  .quiz-header {
    padding: 1.75rem 1.5rem;
    border-radius: 14px;
    margin-bottom: 1.75rem;
  }

  .quiz-header h1 {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
  }

  .progress-indicator > span:first-child,
  .hint-counter {
    padding: 0.55rem 1.05rem;
    font-size: 0.75rem;
    border-radius: 9px;
  }

  .progress-indicator > span:first-child strong {
    font-size: 1rem;
    margin: 0 0.1rem;
  }

  .hint-counter {
    gap: 0.55rem;
  }

  .hint-counter span:first-child {
    font-size: 1.2rem;
  }

  .hint-counter span:last-child {
    font-size: 0.75rem;
  }

  .hint-counter strong {
    font-size: 1rem;
    margin-left: 0.2rem;
  }
}

/* Extra Small Mobile (280px - 320px) */
@media (max-width: 320px) {
  .backQuiz {
    padding: 0.5rem 0.9rem 0.55rem 0.75rem;
    font-size: 0.8rem;
  }

  .quiz-header {
    padding: 1.5rem 1.25rem;
    border-radius: 12px;
  }

  .quiz-header h1 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
  }

  .progress-indicator > span:first-child,
  .hint-counter {
    padding: 0.7rem 1.1rem;
    font-size: 0.9rem;
  }

  .progress-indicator > span:first-child strong {
    font-size: 1.05rem;
  }

  .hint-counter span:first-child {
    font-size: 1.3rem;
  }

  .hint-counter strong {
    font-size: 1.1rem;
  }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
  .quiz-header {
    padding: 3rem 3.5rem;
    border-radius: 24px;
  }

  .quiz-header h1 {
    font-size: 2.75rem;
    margin-bottom: 2.25rem;
  }

  .progress-indicator > span:first-child,
  .hint-counter {
    padding: 1rem 2rem;
    font-size: 1.1rem;
  }

  .backQuiz {
    padding: 0.85rem 1.5rem 0.85rem 1.15rem;
    font-size: 0.95rem;
  }
}

/* Dark Mode Refinements */
@media (prefers-color-scheme: dark) {
  .quiz-header {
    box-shadow:
      0 4px 24px rgba(0, 0, 0, 0.2),
      0 0 0 1px rgba(255, 255, 255, 0.05);
  }

  .backQuiz {
    box-shadow:
      0 2px 12px rgba(0, 0, 0, 0.2),
      0 0 0 1px rgba(255, 255, 255, 0.1);
  }
}

/* Prevent right-click context menu */
.quiz-container {
  -webkit-touch-callout: none;
  margin: 150px 0 100px 0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --lable-header: #fafafa;
  }

  .quiz-question h2 {
    color: var(--lable-header);
  }
}

.quiz-question {
  font-size: 15px;
  color: var(--text-color);
  margin: 0 0 0 20px;
}

.quiz-question h2 {
  color: var(--text-color);
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  list-style: none;
  padding: 20px 20px 20px 20px;
}

/* Selected state (before answer reveal - keep existing) */
.quiz-options li.selected::before {
  border-color: #51cf66;
  background: #51cf66;
  animation: checkmarkPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.quiz-options li.selected::after {
  content: "✓";
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  color: white;
  font-size: 14px;
  font-weight: bold;
  animation: checkmarkAppear 0.2s ease 0.1s forwards;
  z-index: 3;
}

/* ✅ Correct answer */
.quiz-options li.correct::before {
  border-color: #28a745;
  background: #28a745;
  animation: checkmarkPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.quiz-options li.correct::after {
  content: "✔";
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  color: white;
  font-size: 14px;
  font-weight: bold;
  animation: checkmarkAppear 0.2s ease 0.1s forwards;
  z-index: 3;
}

/* ❌ Wrong answer (user's incorrect selection) */
.quiz-options li.wrong::before {
  border-color: #dc3545;
  background: #dc3545;
  animation: checkmarkPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.quiz-options li.wrong::after {
  content: "❌";
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  color: white;
  font-size: 12px;
  font-weight: bold;
  animation: checkmarkAppear 0.2s ease 0.1s forwards;
  z-index: 3;
}

/* Checkmark Animations */
@keyframes checkmarkPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes checkmarkAppear {
  0% {
    transform: translateY(-50%) scale(0) rotate(-180deg);
    opacity: 0;
  }
  60% {
    transform: translateY(-50%) scale(1.2) rotate(10deg);
  }
  100% {
    transform: translateY(-50%) scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Hover effect enhancement */
.quiz-options li:hover::before {
  border-color: #51cf66;
  transform: scale(1.1);
  transition: all 0.2s ease;
}

/* Selected option label color */
.quiz-options li.selected label {
  color: #2b8a3e;
  font-weight: 600;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .quiz-options li.selected::after {
    left: 16px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .quiz-options li.selected::after {
    left: 14px;
    font-size: 11px;
  }
}

.quiz-header {
  margin-top: -100px;
  color: var(--text-color);
  text-align: center;
  margin-bottom: 20px;
}

.quiz-header h1 {
  color: var(--text-color);
}

/* Hint Counter Styling */
.hint-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #621c9f, #2a0248, #621c9f);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  margin-left: 15px;
  box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.hint-counter-icon {
  font-size: 18px;
}

.container {
  max-width: 100%;
  margin: auto;
}

.quiz-options li {
  display: flex;
  align-items: center;
  gap: 15px;
  background: #f9f9f9;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #ddd;
  transition: all 0.3s ease;
  cursor: pointer;
  color: #68686b;
  position: relative;
}

.quiz-options li:hover {
  background: #eef5ff;
  border-color: #4a90e2;
}

/* Selected option styling */
.quiz-options li.selected {
  border: 1px solid #6f42c1;
  background: #f0cefa;
  color: black;
  transform: scale(1.02);
  box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
}

.quiz-options li.selected label {
  color: black;
  font-weight: 600;
}

/* ============================================
  HINT REVEALED 
  ============================================ */

.quiz-options li.hint-revealed {
  border: 2px solid #51cf66;
  background: #d3f9d8;
  color: #2b8a3e;
  animation: hintZoomPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.quiz-options li.hint-revealed label {
  color: #2b8a3e;
  font-weight: 700;
}

@keyframes hintZoomPop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
  }
  70% {
    transform: scale(0.97);
  }
  100% {
    transform: scale(1);
  }
}

.quiz-options li.hint-revealed::before {
  border-color: #51cf66 !important;
  background: #51cf66 !important;
  animation: circleZoom 0.4s ease 0.1s;
}

@keyframes circleZoom {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

.quiz-options li.hint-revealed::after {
  content: "✓" !important;
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  color: white;
  font-size: 14px;
  font-weight: bold;
  animation: checkmarkZoom 0.4s ease 0.25s forwards;
  z-index: 3;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  width: auto !important;
  height: auto !important;
}

@keyframes checkmarkZoom {
  0% {
    transform: translateY(-50%) scale(0);
    opacity: 0;
  }
  60% {
    transform: translateY(-50%) scale(1.3);
    opacity: 1;
  }
  100% {
    transform: translateY(-50%) scale(1);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .quiz-options li.hint-revealed::after {
    left: 16px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 480px) {
  .quiz-options li.hint-revealed::after {
    left: 14px !important;
    font-size: 11px !important;
  }
}

.quiz-options li.selected input[type="radio"] {
  accent-color: white;
}

.quiz-options label {
  flex: 1;
  cursor: pointer;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  min-height: 20px;
  line-height: 1.4;
}

.quiz-options li {
  position: relative;
}

.quiz-options li input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.quiz-options li::before {
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-radius: 50%;
  background: white;
  flex-shrink: 0;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.quiz-options li:hover::before {
  border-color: #4a90e2;
}

.quiz-options li.selected::before {
  border-color: #6f42c1;
}

.quiz-options li.hint-revealed::before {
  border-color: #51cf66;
  background: #51cf66;
}

/* Hint Button Styling */
.hint-btn {
  background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
  color: #333;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(250, 176, 5, 0.3);
  margin: 0 0 0 20px;
}

.hint-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(250, 176, 5, 0.4);
}

.hint-btn:disabled {
  background: #e0e0e0;
  color: #999;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.hint-btn-icon {
  font-size: 18px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .quiz-options {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 15px;
  }

  .quiz-options li {
    padding: 12px;
    gap: 12px;
    font-size: 14px;
  }

  .quiz-options li::before {
    width: 18px;
    height: 18px;
  }

  .quiz-question {
    font-size: 14px;
    margin: 0 0 0 10px;
  }

  .quiz-question h2 {
    font-size: 16px;
  }

  .btn {
    font-size: 14px;
    width: 150px;
    margin: 0 0 0 10px;
  }

  .hint-btn {
    font-size: 14px;
    width: 150px;
    margin: 0 0 0 10px;
  }

  .hint-counter {
    font-size: 12px;
    padding: 6px 12px;
    margin-left: 10px;
  }

  .next-btn,
  .btn-success {
    margin-right: 10px;
  }

  .quiz-options li.hint-revealed::after {
    font-size: 10px;
    padding: 3px 8px;
  }
}

@media (max-width: 480px) {
  .quiz-options {
    padding: 10px;
    gap: 8px;
  }

  .quiz-question {
    margin: 0 0 0 5px;
  }

  .quiz-options li {
    padding: 10px;
    gap: 10px;
    font-size: 13px;
  }

  .quiz-options li::before {
    width: 16px;
    height: 16px;
  }

  .btn {
    font-size: 13px;
    width: 130px;
    padding: 8px 15px;
    margin: 0 0 0 5px;
  }

  .hint-btn {
    font-size: 13px;
    width: 130px;
    padding: 8px 15px;
    margin: 0 0 0 5px;
  }

  .hint-counter {
    font-size: 11px;
    padding: 5px 10px;
    margin-left: 5px;
  }

  .next-btn,
  .btn-success {
    margin-right: 5px;
  }
}

.next-btn,
.btn-success {
  margin-right: 20px;
  float: right;
}

.btn {
  flex: 1;
  margin: 0 0 0 20px;
  font-size: 16px;
  border-radius: 6px;
  width: 300px;
  transition: all 0.3s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Stylish Modal Styles */
.quiz-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
}

.quiz-modal-overlay.show {
  opacity: 1;
}

.quiz-modal-overlay.hide {
  opacity: 0;
  transform: scale(0.9);
}

.quiz-modal {
  background: white;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.7);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quiz-modal-overlay.show .quiz-modal {
  transform: scale(1);
}

.quiz-modal-header {
  padding: 30px 30px 20px;
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.quiz-modal.error .quiz-modal-header {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.quiz-modal.success .quiz-modal-header {
  background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
}

.quiz-modal.warning .quiz-modal-header {
  background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
  color: #333;
}

.quiz-modal-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  animation: bounce 1s ease-in-out;
}

@keyframes bounce {
  0%,
  20%,
  60%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  80% {
    transform: translateY(-10px);
  }
}

.quiz-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quiz-modal-body {
  padding: 30px;
  text-align: center;
}

.quiz-modal-message {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #333;
  margin: 0;
}

.quiz-modal-footer {
  padding: 20px 30px 30px;
  display: flex;
  justify-content: center;
  gap: 15px;
}

.quiz-modal-btn {
  padding: 12px 30px;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 120px;
}

.quiz-modal-btn-cancel {
  background: #6c757d;
  color: white;
}

.quiz-modal-btn-cancel:hover {
  background: #5a6268;
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(108, 117, 125, 0.3);
}

.quiz-modal-btn-confirm {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.quiz-modal-btn-confirm.error {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.quiz-modal-btn-confirm.success {
  background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
}

.quiz-modal-btn-confirm.warning {
  background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
  color: #333;
}

.quiz-modal-btn-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.quiz-question img {
  width: 100%;
  max-width: 500px;
  height: 280px;
  object-fit: contain;
  object-position: center;
  margin: 15px auto;
  cursor: pointer;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  display: block;
}

.quiz-question img:hover {
  transform: scale(1.02);
}

.image-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
  padding: 60px 20px 20px 20px;
  box-sizing: border-box;
  overflow: hidden;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-image-container {
  position: relative !important;
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
  width: 100%;
  height: 100%;
  max-width: 90vw;
  max-height: 85vh;
}

.modal-content {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.3s ease;
  display: block;
  margin: auto;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.close-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: rgba(255, 255, 255, 0.9);
  color: #333;
  border: none;
  font-size: 36px;
  font-weight: bold;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 10001;
}

.close-btn:hover {
  background-color: #ff4444;
  color: white;
  transform: rotate(90deg) scale(1.1);
}

.close-btn:active {
  transform: rotate(90deg) scale(0.95);
}

.cursor-pointer {
  cursor: pointer;
  transition: transform 0.2s;
}

.cursor-pointer:hover {
  transform: scale(1.05);
}

@media screen and (min-width: 768px) and (max-width: 1023px) {
  .image-modal-overlay {
    padding: 70px 20px 20px 20px;
  }
  .modal-image-container {
    max-width: 85vw;
    max-height: 80vh;
  }
  .close-btn {
    top: 15px;
    right: 15px;
    font-size: 32px;
    width: 42px;
    height: 42px;
  }
}

@media screen and (min-width: 481px) and (max-width: 767px) {
  .image-modal-overlay {
    padding: 60px 15px 15px 15px;
  }
  .modal-image-container {
    max-width: 90vw;
    max-height: 75vh;
  }
  .close-btn {
    top: 10px;
    right: 10px;
    font-size: 30px;
    width: 40px;
    height: 40px;
  }
}

@media screen and (max-width: 480px) {
  .image-modal-overlay {
    padding: 55px 10px 10px 10px;
  }
  .modal-image-container {
    max-width: 95vw;
    max-height: 70vh;
  }
  .modal-content {
    border-radius: 6px;
  }
  .close-btn {
    top: 10px;
    right: 10px;
    font-size: 28px;
    width: 36px;
    height: 36px;
  }
}

@media screen and (max-width: 360px) {
  .image-modal-overlay {
    padding: 50px 8px 8px 8px;
  }
  .modal-image-container {
    max-width: 98vw;
    max-height: 65vh;
  }
  .close-btn {
    top: 8px;
    right: 8px;
    font-size: 24px;
    width: 32px;
    height: 32px;
    background-color: white !important;
    color: rgba(0, 0, 0, 0.8) !important;
  }
  .close-btn:hover {
    background-color: #ff4444 !important;
    color: white !important;
  }
}

/* ============================================
  Quiz Controls
  ============================================ */

.quiz-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px;
  margin-top: 20px;
  flex-wrap: nowrap;
}

.btn {
  padding: 15px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 90px;
  letter-spacing: 0.3px;
  width: 100%;
  max-width: 300px;
}

.btn-prev {
  background: var(--bottom-theme);
  color: white;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.btn-prev:hover:not(:disabled) {
  transform: translateX(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
}

.btn-next {
  background: var(--bottom-theme);
  color: white;
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.btn-next:hover:not(:disabled) {
  transform: translateX(3px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-submit {
  background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
  color: white;
  box-shadow: 0 3px 10px rgba(81, 207, 102, 0.35);
  font-weight: 700;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(81, 207, 102, 0.45);
}

.hint-btn {
  background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
  color: #2d2002;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(250, 176, 5, 0.35);
  white-space: nowrap;
  flex-shrink: 0;
  flex: 1;
  width: 100%;
  max-width: 300px;
}

.hint-btn span:first-child {
  font-size: 16px;
}

.hint-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(250, 176, 5, 0.45);
}

.hint-btn:disabled {
  background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
  color: rgb(0, 0, 0);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-submit:disabled {
  opacity: 0.8;
  cursor: wait;
}

@media (max-width: 1024px) {
  .quiz-controls {
    gap: 12px;
    padding: 15px;
  }
  .quiz-question img {
    max-width: 450px;
    height: 250px;
  }
  .btn {
    padding: 10px 20px;
    font-size: 15px;
    min-width: 110px;
  }
  .hint-btn {
    padding: 10px 20px;
    font-size: 15px;
    min-width: 110px;
  }
}

@media (max-width: 768px) {
  .quiz-controls {
    gap: 10px;
    padding: 15px 10px;
    justify-content: center;
  }
  .quiz-question img {
    max-width: 100%;
    height: 220px;
  }
  .btn {
    padding: 10px 18px;
    font-size: 14px;
    min-width: 100px;
    flex: 1 1 auto;
    max-width: 150px;
  }
  .hint-btn {
    padding: 10px 18px;
    font-size: 14px;
    min-width: 100px;
    flex: 1 1 auto;
    max-width: 150px;
  }
  .hint-btn span:first-child {
    font-size: 16px;
  }
}

@media (max-width: 600px) {
  .quiz-controls {
    padding: 12px 14px;
    gap: 8px;
    border-radius: 12px;
  }
  .btn {
    padding: 10px 14px;
    font-size: 12px;
    min-width: 75px;
    border-radius: 8px;
  }
  .hint-btn {
    padding: 10px 14px;
    font-size: 12px;
    border-radius: 8px;
    gap: 5px;
    min-width: 75px;
  }
  .hint-btn span:first-child {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .quiz-controls {
    gap: 6px;
    padding: 10px 5px;
    flex-wrap: wrap;
  }
  .quiz-question img {
    height: 180px;
    margin: 10px auto;
    border-radius: 6px;
  }
  .btn {
    padding: 8px 14px;
    font-size: 12px;
    min-width: 80px;
    border-radius: 6px;
    flex: 1 1 calc(50% - 6px);
    max-width: calc(50% - 6px);
  }
  .hint-btn {
    padding: 8px 14px;
    font-size: 12px;
    min-width: 80px;
    border-radius: 6px;
    gap: 5px;
    flex: 1 1 100%;
    max-width: calc(50% - 6px);
    order: 2;
  }
  .hint-btn span:first-child {
    font-size: 14px;
  }
  .btn-prev {
    order: 1;
  }
  .btn-next,
  .btn-submit {
    order: 2;
  }
  .breadcrumb-q {
    flex-wrap: nowrap !important;
    overflow: visible !important;
    padding: 10px 0 !important;
  }

  .bcPairQ {
    flex: 1 1 auto;
  }

  .breadcrumb-q li {
    flex: 1 1 auto;
  }
  .bc-text {
    max-width: clamp(80px, 30vw, 140px) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 380px) {
  .quiz-controls {
    padding: 10px 10px;
    gap: 6px;
  }
  .btn {
    padding: 9px 10px;
    font-size: 11px;
    min-width: 65px;
  }
  .hint-btn {
    padding: 9px 10px;
    font-size: 11px;
    min-width: 65px;
  }
  .hint-btn span:first-child {
    display: none;
  }
  .bc-text {
    max-width: clamp(60px, 35vw, 100px) !important;
  }

  .breadcrumb-q li .back-link,
  .breadcrumb-q li[aria-current="page"] .current {
    padding: 6px 8px !important;
    font-size: 0.65rem !important;
  }
  .breadcrumb-q {
    padding: 10px 0 !important;
  }
}

@media (max-width: 320px) {
  .quiz-controls {
    gap: 5px;
    padding: 8px 3px;
  }
  .btn {
    padding: 6px 10px;
    font-size: 10px;
    min-width: 60px;
    border-radius: 4px;
    letter-spacing: 0;
  }
  .hint-btn {
    padding: 6px 10px;
    font-size: 10px;
    min-width: 60px;
    border-radius: 4px;
    gap: 3px;
  }
  .hint-btn span:first-child {
    font-size: 12px;
  }
}

.btn-submit:disabled {
  opacity: 0.8;
  cursor: wait;
  position: relative;
}

.btn-submit:disabled::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  .quiz-controls {
    padding: 8px 14px;
    margin-top: 10px;
  }
  .btn,
  .hint-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* ============================================
  BREADCRUMB - Responsive Non-wrapping Arrow Step Style
  ============================================ */

:root {
  --bc-arrow-size: clamp(6px, 1.4vw, 13px);
  --bc-font-size: clamp(0.55rem, 1.8vw, 0.85rem);
  --bc-pad-y: clamp(8px, 1.2vw, 12px);
  --bc-pad-x: clamp(4px, 1.5vw, 16px);
}

.breadcrumb-q {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  list-style: none;
  padding: 10px 20px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.bcPairQ {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  min-width: 0;
  position: relative;
}

.breadcrumb-q li {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  min-width: 0;
  position: relative;
}

.breadcrumb-q li .back-link,
.breadcrumb-q li[aria-current="page"] .current {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: var(--bc-pad-y) calc(var(--bc-pad-x) + 10px);
  font-size: var(--bc-font-size);
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(135deg, #121214, #1a1a1e);
  color: #d1d5db;
  position: relative;
  clip-path: polygon(
    0 0,
    calc(100% - var(--bc-arrow-size)) 0,
    100% 50%,
    calc(100% - var(--bc-arrow-size)) 100%,
    0 100%,
    var(--bc-arrow-size) 50%
  );
  transition:
    background 0.2s ease,
    color 0.2s ease;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
}

.bcPairQ:first-child .back-link {
  clip-path: polygon(
    0 0,
    calc(100% - var(--bc-arrow-size)) 0,
    100% 50%,
    calc(100% - var(--bc-arrow-size)) 100%,
    0 100%
  );
  padding-left: var(--bc-pad-x);
}

.bcPairQ:last-child .current {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, var(--bc-arrow-size) 50%);
  background: linear-gradient(135deg, #5c35a0, #4c288f);
  color: #ffffff;
  font-weight: 700;
}

/* Theme Adaptive Updates */
[data-theme="light"] .breadcrumb-q li .back-link {
  background: linear-gradient(135deg, #eef0f6, #e2e5f0);
  color: #3a3560;
  border-right: 1px solid rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .bcPairQ:last-child .current {
  background: linear-gradient(135deg, #621c9f, #511287);
  color: #ffffff;
}

@media (prefers-color-scheme: light) {
  .breadcrumb-q li .back-link {
    background: linear-gradient(135deg, #eef0f6, #e2e5f0);
    color: #3a3560;
  }
  .bcPairQ:last-child .current {
    background: linear-gradient(135deg, #621c9f, #511287);
    color: #ffffff;
  }
}

/* Animations and Hover State */
.bcPairQ:not(:last-child) .back-link:hover {
  background: linear-gradient(135deg, #1d1d24, #25252b);
  color: #ffffff;
}

[data-theme="light"] .bcPairQ:not(:last-child) .back-link:hover {
  background: linear-gradient(135deg, #f3f5fa, #eaedf5);
  color: #1a163a;
}

/* Text Protection Layer */
.bc-text {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  max-width: 400px;
}

/* Home Icon Fluid Sizing */
.home-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-icon svg {
  display: block;
  width: clamp(12px, 3.2vw, 17px) !important;
  height: clamp(12px, 3.2vw, 17px) !important;
  stroke-width: 2.5px;
}

.bcPairQ .home-icon {
  width: 100%;
  background: linear-gradient(135deg, #1d1b3a, #252347);
  color: #b8b8d4;
}

[data-theme="light"] .bcPairQ .home-icon {
  background: linear-gradient(135deg, #e2dff5, #d5d1f0);
  color: #3a3560;
}

.hint-btn:disabled {
    color: #000;
    cursor: not-allowed;
    box-shadow: none;
    opacity: .6;
    background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
    transform: none;
}

/* ── Loading states for answer-check / hint requests ── */
.quiz-options.is-checking {
    position: relative;
    pointer-events: none;
}

.quiz-options.is-checking::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.35);
    border-radius: inherit;
    z-index: 5;
}

.quiz-options.is-checking li {
    opacity: 0.6;
}

.option-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(102, 126, 234, 0.25);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: quizSpin 0.7s linear infinite;
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    z-index: 6;
}

.hint-btn.is-loading {
    opacity: 0.75;
    cursor: wait;
}

.hint-btn .hint-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: quizSpin 0.7s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

@keyframes quizSpin {
    to { transform: translateY(-50%) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .option-spinner,
    .hint-btn .hint-spinner {
        animation: none;
    }
}