/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 30px 16px;
  color: #e0e0e0;
}

/* ===== WRAPPER ===== */
.quiz-wrapper {
  width: 100%;
  max-width: 800px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 36px 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ===== HEADER ===== */
header {
  text-align: center;
  margin-bottom: 28px;
}

header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(100, 200, 255, 0.4);
  margin-bottom: 6px;
}

.subtitle {
  color: #a0c4ff;
  font-size: 1rem;
}

/* ===== PROGRESS BAR ===== */
#progress-bar-container {
  background: rgba(255,255,255,0.1);
  border-radius: 50px;
  height: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4cc9f0, #7209b7);
  border-radius: 50px;
  transition: width 0.5s ease;
}

#progress-text {
  text-align: right;
  font-size: 0.85rem;
  color: #a0c4ff;
  margin-bottom: 24px;
}

/* ===== QUESTION CARD ===== */
.question-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 30px;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.question-number {
  display: inline-block;
  background: linear-gradient(135deg, #4cc9f0, #7209b7);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 50px;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ===== OPTIONS ===== */
.options-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  width: 100%;
  padding: 14px 20px;
  background: rgba(255,255,255,0.07);
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: #e0e0e0;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 14px;
}

.option-btn:hover:not(:disabled) {
  background: rgba(76, 201, 240, 0.15);
  border-color: #4cc9f0;
  color: #ffffff;
  transform: translateX(4px);
}

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #a0c4ff;
}

/* ===== OPTION STATES ===== */
.option-btn.correct {
  background: rgba(57, 199, 128, 0.25);
  border-color: #39c780;
  color: #a8ffda;
}
.option-btn.correct .option-letter {
  background: #39c780;
  color: #fff;
}

.option-btn.wrong {
  background: rgba(255, 82, 82, 0.25);
  border-color: #ff5252;
  color: #ffb3b3;
}
.option-btn.wrong .option-letter {
  background: #ff5252;
  color: #fff;
}

.option-btn.reveal {
  background: rgba(57, 199, 128, 0.12);
  border-color: rgba(57, 199, 128, 0.4);
  color: #a8ffda;
}

.option-btn:disabled {
  cursor: default;
}

/* ===== FEEDBACK ===== */
.feedback {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}

.feedback.correct {
  background: rgba(57, 199, 128, 0.15);
  border-left: 4px solid #39c780;
  color: #a8ffda;
}

.feedback.wrong {
  background: rgba(255, 82, 82, 0.15);
  border-left: 4px solid #ff5252;
  color: #ffb3b3;
}

/* ===== NAV BUTTON ===== */
#next-btn {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding: 15px;
  background: linear-gradient(135deg, #4cc9f0, #7209b7);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: opacity 0.2s, transform 0.2s;
}

#next-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* ===== RESULT SCREEN ===== */
#result-screen, #review-screen {
  animation: fadeIn 0.5s ease;
}

#result-screen.hidden, #review-screen.hidden {
  display: none;
}

.result-card {
  text-align: center;
  padding: 10px 0;
}

#result-emoji {
  font-size: 5rem;
  margin-bottom: 16px;
}

.result-card h2 {
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: 10px;
}

.result-card p {
  color: #a0c4ff;
  margin-bottom: 6px;
}

#score-display {
  font-size: 3rem;
  font-weight: 900;
  margin: 14px 0;
  background: linear-gradient(135deg, #4cc9f0, #f72585);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#score-message {
  font-size: 1.1rem;
  color: #c0d8ff;
  margin-bottom: 28px;
  line-height: 1.5;
}

#restart-btn, #review-btn, #back-to-result-btn {
  padding: 13px 30px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  margin: 6px;
}

#restart-btn {
  background: linear-gradient(135deg, #4cc9f0, #7209b7);
  color: #fff;
}

#review-btn {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.2);
}

#back-to-result-btn {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.2);
  margin-top: 20px;
  display: block;
  width: 100%;
}

#restart-btn:hover, #review-btn:hover, #back-to-result-btn:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

/* ===== REVIEW SCREEN ===== */
#review-screen h2 {
  color: #fff;
  font-size: 1.5rem;
  margin-bottom: 20px;
  text-align: center;
}

.review-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.review-item .r-qnum {
  font-size: 0.78rem;
  font-weight: 700;
  color: #a0c4ff;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.review-item .r-question {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.5;
}

.review-item .r-answer {
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
}

.review-item .r-answer.correct-ans {
  background: rgba(57, 199, 128, 0.2);
  color: #a8ffda;
  border-left: 3px solid #39c780;
}

.review-item .r-answer.user-wrong {
  background: rgba(255, 82, 82, 0.2);
  color: #ffb3b3;
  border-left: 3px solid #ff5252;
}

.review-item .r-answer.user-correct {
  display: none;
}

.review-item .r-explanation {
  font-size: 0.88rem;
  color: #a0c4ff;
  margin-top: 8px;
  font-style: italic;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 560px) {
  .quiz-wrapper {
    padding: 24px 20px;
  }
  header h1 {
    font-size: 1.5rem;
  }
  .question-text {
    font-size: 1rem;
  }
  .option-btn {
    font-size: 0.92rem;
    padding: 12px 14px;
  }
  #score-display {
    font-size: 2.2rem;
  }
}
