/* ===== Body ===== */
body {
  font-family: Arial, sans-serif;
  background: #000;           /* pure black outside container */
  color: #eee;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* ===== Container ===== */
.container {
  text-align: center;
  background: #222;           /* slightly lighter than body for contrast */
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  width: 90%;
  max-width: 400px;
  box-sizing: border-box;
  color: #eee;                /* default text color inside container */
}

/* ===== Headings ===== */
h1, h2, h3, h4, h5, h6 {
  color: #fff;                /* white headings */
  margin: 0.3em 0;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Optional spacing for smaller headings */
h2, h3, h4, h5, h6 {
  margin-top: 0.5em;
  margin-bottom: 0.3em;
  line-height: 1.2;
}

/* ===== Paragraphs ===== */
p, .status p {
  color: #ccc;
  margin: 5px 0;
}

/* ===== Buttons ===== */
button {
  display: block;
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  background: #4CAF50;
  color: white;
  transition: background 0.2s;
}

button:hover {
  background: #45a049;
}

/* Quiz options buttons */
#options button {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 10px;
  background: #333;
  border: 1px solid #555;
  color: #eee;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

#options button:hover {
  background: #444;
}

/* ===== Images ===== */
.image-box img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 2px solid #444;
}

/* ===== Select Dropdowns ===== */
select {
  width: 100%;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #555;
  background: #333;
  color: #eee;
  font-size: 16px;
  min-height: 44px;   /* important for mobile touch */
  cursor: pointer;
  transition: background 0.2s, border 0.2s;
}

select:hover {
  background: #444;
  border-color: #777;
}

/* ===== Autosave Note ===== */
.autosave-note {
  font-size: 13px;
  color: #aaa;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 15px;
  text-align: center;
  font-style: italic;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 1.5em;
  }

  .container {
    padding: 20px;
  }

  button, #options button {
    font-size: 14px;
    padding: 10px;
  }

@media (max-width: 480px) {
  select {
    font-size: 16px;  /* keep font readable */
    padding: 0.6rem;
  }
}

  .autosave-note {
    font-size: 12px;
    padding: 5px 8px;
  }
}

/* ===== Container ===== */
.container {
  text-align: center;
  background: #222;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  width: 95%;                 /* wider container */
  max-width: 700px;           /* increase from 400px */
  box-sizing: border-box;
  color: #eee;
}

/* ===== Position Boxes ===== */
.position-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;                  /* space between image and dropdown */
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 10px;
  padding: 12px;               /* minimal padding so image is big */
  margin-bottom: 24px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  width: 100%;                /* fill the container */
  box-sizing: border-box;
}

/* Dropdown sizing */
.position-box .select-box {
  width: 95%;                 /* nearly full width */
  max-width: none;            /* remove cap */
}

/* Image tweaks */
.position-box .image-box img {
  width: 100%;                /* fill the box width */
  height: auto;
  border-radius: 8px;
  border: 2px solid #555;
  display: block;
}

/* ===== Correct / Incorrect Container Feedback ===== */
.container.correct {
  animation: flash-container-correct 0.8s ease;
}

.container.incorrect {
  animation: flash-container-incorrect 0.8s ease;
}

@keyframes flash-container-correct {
  0%   { background-color: #222; box-shadow: 0 0 0px rgba(0,255,0,0); }
  30%  { background-color: #1b5e20; box-shadow: 0 0 25px rgba(0,255,0,0.7); }
  60%  { background-color: #1b5e20; box-shadow: 0 0 15px rgba(0,255,0,0.4); }
  100% { background-color: #222; box-shadow: 0 0 0px rgba(0,255,0,0); }
}

@keyframes flash-container-incorrect {
  0%   { background-color: #222; box-shadow: 0 0 0px rgba(255,0,0,0); }
  30%  { background-color: #7f0000; box-shadow: 0 0 25px rgba(255,0,0,0.7); }
  60%  { background-color: #7f0000; box-shadow: 0 0 15px rgba(255,0,0,0.4); }
  100% { background-color: #222; box-shadow: 0 0 0px rgba(255,0,0,0); }
}

/* Soft-disabled effect for buttons (fade only) */
#options button.disabled-soft {
  opacity: 0.5;
  background: #333;
  color: #888;
  border-color: #444;
  cursor: default;
  transition: opacity 0.3s ease, background 0.3s ease, color 0.3s ease;
  position: relative;
}

/* Remove pulsing overlay */
#options button.disabled-soft::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.08);
  border-radius: inherit;
  pointer-events: none;
}

/* ===== Next Question Button Pulse - Green Version ===== */
#next-question.pulse {
  animation: pulseNextBtnGreen 1.2s infinite;
}

@keyframes pulseNextBtnGreen {
  0%   { transform: scale(1); background-color: #4CAF50; box-shadow: 0 0 5px #4CAF50; }
  50%  { transform: scale(1.05); background-color: #66BB6A; box-shadow: 0 0 20px #66BB6A; }
  100% { transform: scale(1); background-color: #4CAF50; box-shadow: 0 0 5px #4CAF50; }
}

/* Highlight correct and selected wrong answers */
#options button.correct-answer {
  border: 2px solid lightgreen !important;
  background-color: #2a2;
  color: #fff;
}

#options button.selected-wrong {
  border: 2px solid #f44336 !important;
  background-color: #622222;
  color: #fff;
}

#feedback {
  text-align: center;
  margin-top: 12px;
  line-height: 1.4;
}

#feedback .feedback-icon {
  display: block;
  font-size: 1.2em;
  color: #f44336; /* red */
  font-weight: bold;
}

#feedback .feedback-continue {
  display: block;
  margin-top: 6px;
  font-size: 0.9em;
  color: #ccc;
  font-style: italic;
}

#feedback .feedback-icon {
  display: block;
  font-size: 1.2em;
  font-weight: bold;
}

#feedback .feedback-icon.correct {
  color: lightgreen;
}

#feedback .feedback-icon.incorrect {
  color: #f44336;
}

}