/* Quiz container */
#quiz-container {
  margin-top: 30px;
}

/* Progress text */
#quiz-progress {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 10px;
}

/* Question */
#quiz-question {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 25px;
  color: #1e293b;
}

/* Option wrapper */
.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
}

/* Hide default radio */
.quiz-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #94a3b8;
  border-radius: 50%;
  position: relative;
}

/* Radio dot */
.quiz-option input[type="radio"]::before {
  content: "";
  width: 10px;
  height: 10px;
  background: #2563eb;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s ease;
}

/* Checked state */
.quiz-option input[type="radio"]:checked::before {
  transform: translate(-50%, -50%) scale(1);
}

/* Option text */
.quiz-option .option-text {
  font-size: 16px;
  color: #0f172a;
}

.quiz-option:hover {
  border-color: #2563eb;
  background: #f8fafc;
}

.quiz-option input[type="radio"]:checked + .option-text {
  font-weight: 600;
}

.quiz-option.selected {
  border-color: #2563eb;
  background: #eff6ff;
}

.quiz-option.selected .option-text {
  font-weight: 600;
}


/* Next button base */
#next-question-btn {
  margin-top: 24px;
  padding: 12px 32px;
  border-radius: 12px;
  border: none;

  background: #2563eb;        /* Primary blue */
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;

  cursor: pointer;
  transition: 
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.1s ease;
}

/* Hover state (only when enabled) */
#next-question-btn:not(:disabled):hover {
  background: #1d4ed8;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

/* Active click */
#next-question-btn:not(:disabled):active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

/* Disabled state */
#next-question-btn:disabled {
  background: #c7d2fe;
  color: #475569;
  cursor: not-allowed;
  box-shadow: none;
}


/* Correct answer */
.quiz-option.correct {
  border-color: #16a34a;
  background: #ecfdf5;
}

.quiz-option.correct .option-text {
  color: #166534;
  font-weight: 600;
}

/* Wrong answer */
.quiz-option.wrong {
  border-color: #dc2626;
  background: #fef2f2;
}

.quiz-option.wrong .option-text {
  color: #991b1b;
  font-weight: 600;
}

/* Disable interaction after answer */
.quiz-option.disabled {
  pointer-events: none;
  opacity: 0.9;
}

/* ----------------------------------
   Prism code block sizing fix
---------------------------------- */


#ai-quiz-root pre {
  white-space: pre-wrap;        /* ⬅️ KEY FIX */
  word-wrap: break-word;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
}

#ai-quiz-root code {
  white-space: pre-wrap;        /* ⬅️ KEY FIX */
  word-break: break-word;
}


/* Slightly smaller on mobile */
@media (max-width: 768px) {
  #ai-quiz-root pre,
  #ai-quiz-root code {
    font-size: 13px;
  }
}

/* ----------------------------------
   Quiz Result Screen
---------------------------------- */

.quiz-result {
  text-align: center;
  padding: 40px 20px;
}

.quiz-result-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
}

.quiz-score {
  font-size: 18px;
  margin-bottom: 24px;
  color: #374151;
}

/* Restart button */
.restart-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.restart-btn:hover {
  background: #1e40af;
  transform: translateY(-1px);
}

.restart-btn:active {
  transform: translateY(0);
}

.quiz-explanation {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 12px;
  background: #f8fafc;
  border-left: 4px solid #2563eb;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.6;
}

.dashboard-select,
#java-topic {
  width: 100%;
  height: auto;                 /* IMPORTANT */
  min-height: 52px;             /* Consistent height */
  padding: 12px 16px;
  font-size: 16px;
  line-height: 1.4;             /* FIXES CUT TEXT */
  border-radius: 12px;
  border: 1.5px solid #d1d5db;
  background-color: #fff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

#java-topic option {
  font-size: 16px;
  padding: 10px;
}

/* -----------------------
   Quiz Loading Animation
------------------------ */

.quiz-loading {
  text-align: center;
  margin-top: 40px;
}

.loading-text {
  font-size: 16px;
  margin-bottom: 14px;
  color: #555;
}

.progress-wrapper {
  width: 100%;
  max-width: 320px;
  height: 10px;
  margin: 0 auto;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(
    90deg,
    #2563eb,
    #3b82f6,
    #2563eb
  );
  border-radius: 999px;
  animation: progress-loading 1.6s infinite ease-in-out;
}

@keyframes progress-loading {
  0% {
    width: 0%;
    transform: translateX(0);
  }
  50% {
    width: 70%;
  }
  100% {
    width: 100%;
    transform: translateX(100%);
  }
}

/* =========================
   Quiz Layout – Mobile Spacing
   ========================= */

#ai-quiz-root {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
}

/* Mobile specific */
@media (max-width: 768px) {
  #ai-quiz-root {
    padding: 16px;   /* left-right spacing */
  }
}



@media (max-width: 768px) {

  .question-text {
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 16px;
  }

  pre {
    margin-left: 0;
    margin-right: 0;
    border-radius: 10px;
    overflow-x: auto;
  }

  .quiz-option {
    padding: 14px;
    margin-bottom: 12px;
  }

}


@media (max-width: 768px) {

  .question-text {
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 16px;
  }

  pre {
    margin-left: 0;
    margin-right: 0;
    border-radius: 10px;
    overflow-x: auto;
  }

  .quiz-option {
    padding: 14px;
    margin-bottom: 12px;
  }

}

