/* --------------------
   Base & Reset
-------------------- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #e5e7eb;
  line-height: 1.6;
}

/* --------------------
   Headings
-------------------- */
h1 {
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 12px;
  color: #f8fafc;
}

h2 {
  margin-top: 0;
  color: #f1f5f9;
}

/* --------------------
   Layout Boxes
-------------------- */
.box {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 14px;
  padding: 20px;
  margin: 20px auto;
  max-width: 900px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* daily question */
#coreDropdown {
  display: flex;
  flex-direction: column; 
  align-items: center;   
  gap: 10px;           
}

#coreDropdown select {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  width: 180px;
  font-size: 16px;
}

/* --------------------
   Buttons
-------------------- */
button {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin: 6px 4px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.45);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

button.hidden {
  display: none;
}

/* Secondary buttons inside instructions */
.box p button {
  background: #334155;
  box-shadow: none;
}

.box p button:hover {
  background: #475569;
}

/* --------------------
   Textarea
-------------------- */
textarea {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #020617;
  color: #e5e7eb;
  font-size: 14px;
  resize: vertical;
}

textarea::placeholder {
  color: #94a3b8;
}

/* --------------------
   Quiz Area
-------------------- */
#quizQuestion {
  font-size: 1.1rem;
  margin-bottom: 14px;
  white-space: pre-line;/*render newline*/
}
#explanation {
  white-space: pre-line;/*render newline*/
}
#options {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

#options button {
  width: 100%;
  text-align: left;
  background: #020617;
  color: #e5e7eb;
  border: 1px solid #334155;
  box-shadow: none;
}

#options button:hover {
  background: #1e293b;
}

/* Navigation buttons */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* --------------------
   Result & Score
-------------------- */
#result {
  margin-top: 16px;
  padding: 16px;
  background: #020617;
  border-radius: 10px;
  border: 1px solid #334155;
}

.grade {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  color: #22c55e;
}

/* --------------------
   Format Help
-------------------- */
pre {
  background: #020617;
  padding: 16px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 13px;
  border: 1px solid #334155;
}

/* --------------------
   Utility
-------------------- */
.hidden {
  display: none;
}
body > button {
  display: block;
  margin: 12px auto;
}

/* Center Reset button */
#reset-btn {
  display: block;
  margin: 20px auto;
}

/* --------------------
   Quiz Result Styling
-------------------- */
.quiz-result {
  margin-top: 24px;
}

.quiz-result h4 {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Base option style */
.quiz-result .options {
  margin: 8px 0;
}

.quiz-result label {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  background: #020617;
  border: 1px solid #334155;
  cursor: default;
  transition: background 0.2s ease, border 0.2s ease;
}


/* --------------------
   Correct Answer
-------------------- */
.quiz-result label.correct {
  background: rgba(34, 197, 94, 0.15);   /* soft green background */
  border: 1px solid #22c55e;             /* green border */
}

/* --------------------
   incorrect user answer
-------------------- */
.quiz-result label.incorrect { 
  background: rgba(239, 68, 68, 0.15); 
  border: 1px solid #ef4444;
}
  
/* --------------------
   Wrong Answer Icon
-------------------- */
.wrong-icon {  
  color: #ef4444;
}

/* --------------------
   Disabled radio polish
-------------------- */
.quiz-result input[type="radio"] {
  accent-color: #6366f1;
  margin-right: 8px;
}

/* --------------------
   Final Score + Report Alignment
-------------------- */
#finalScore,
#report {
  max-width: 900px;
  margin: 20px auto;
}

/* Report styling to match score box */
#report {
  background: rgba(15, 23, 42, 0.9);
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  border-left: 5px solid #ef4444;
}

/* Report text polish */
#report p,
#report strong {
  color: #e5e7eb;
}

#report strong {
  display: inline-block;
  margin-top: 6px;
}

/* Space between score and report */
#finalScore + #report {
  margin-top: 12px;
}

/* --------------------
   Responsive
-------------------- */
@media (max-width: 600px) {
  body {
    padding: 12px;
  }

  .box {
    padding: 16px;
  }

  button {
    width: 100%;
  }

  .quiz-nav {
    flex-direction: column;
  }
}
