/* ===== Button States ===== */
.btn-wrong {
  background: #dc3545 !important;
  color: #fff !important;
  border: none !important;
}
.btn-correct, .btn.btn-correct {
  background: #28a745 !important;
  color: #fff !important;
  border: none !important;
}

/* ===== Toast Styles ===== */
div#toast.toast-correct {
  background: #28a745;
  color: #fff;
  border: none;
}
div#toast.toast-wrong {
  background: #dc3545;
  color: #fff;
  border: none;
}

/* ===== Next Question Button ===== */
#next-btn {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100vw;
  max-width: 100vw;
  border-radius: 0;
  margin: 0;
  box-shadow: none;
  padding: 1rem 0;
  font-size: 1.2rem;
  z-index: 10001;
  pointer-events: auto;
  background: #007bff;
  color: #fff;
  border: none;
  font-weight: 600;
  text-align: center;
}

/* ===== Global Styles ===== */
body {
  background: linear-gradient(135deg, #f9f9f9, #eef1f5);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  margin: 0;
  display: block;
  padding-top: 0;
}

.container {
  overflow-x: hidden;
  background-color: #ffffff;
  border-radius: 0.5rem;
  padding: 0.5rem 0.5rem 0.75rem 0.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  max-width: 100vw;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

#image-container img {
  display: block;
  margin: 0 auto 0.5rem auto;
  max-width: 300px;
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
  transition: transform 0.3s ease;
  object-fit: contain;
}
#image-container img:hover {
  transform: scale(1.02);
}

#question-container {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 0.5rem;
  word-break: break-word;
}

#answers-container .btn {
  display: block;
  width: 100%;
  margin-bottom: 0.4rem;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  touch-action: manipulation;
}
.btn-neutral {
  background: #e3eafc;
  color: #2d3a4a;
  border: 1px solid #b6c4d7;
}
.btn-neutral:hover, .btn-neutral:active {
  background: #c7d4ee;
  color: #1a2330;
  border-color: #a3b3c7;
}
.btn-neutral-alt {
  background: #f3f3f3;
  color: #444;
  border: 1px solid #d1d1d1;
}
.btn-neutral-alt:hover, .btn-neutral-alt:active {
  background: #e0e0e0;
  color: #222;
  border-color: #bdbdbd;
}
#answers-container .btn:hover {
  transform: translateY(-2px);
}
#answers-container .btn:active {
  transform: scale(0.98);
}
#answers-container .btn-primary {
  background-color: #4a90e2;
  border: none;
}
#answers-container .btn-primary:hover {
  background-color: #3b7dc6;
}

#feedback {
  min-height: 1.2rem;
  font-size: 1rem;
  margin-top: 0.2rem;
}
#feedback.correct {
  color: #28a745;
}
#feedback.incorrect {
  color: #dc3545;
}

#back-btn, .prominent-back {
  border-radius: 0.5rem;
  padding: 0.7rem 1.2rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: #007bff;
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  transition: background 0.2s, color 0.2s;
  touch-action: manipulation;
  width: 100%;
  margin-top: 0;
  margin-bottom: 0.5rem;
  display: block;
}
#back-btn:disabled, .prominent-back:disabled {
  background: #339cff;
  color: #fff;
  opacity: 1;
  filter: none;
}
#back-btn:hover:enabled {
  transform: translateY(-1px);
}

.animate__animated {
  --animate-duration: 0.5s;
}

/* Progress Bar Styles */
#progress-bar-container {
  width: 100%;
  margin-bottom: 1rem;
}
#progress-bar {
  display: flex;
  height: 12px;
  width: 100%;
  background: #e9ecef;
  border-radius: 6px;
  overflow: hidden;
}
.progress-segment {
  flex: 1;
  transition: background 0.3s;
  background: #e9ecef;
}
.progress-segment.correct {
  background: #28a745;
}
.progress-segment.wrong {
  background: #dc3545;
}

@media (max-width: 576px) {
  body, html {
    min-height: 100vh;
    display: block;
    padding: 0;
    overflow-x: hidden;
    width: 100vw;
    box-sizing: border-box;
  }
  .container {
    border-radius: 0.4rem;
    padding: 0.3rem 0.2rem 0.5rem 0.2rem;
    box-shadow: none;
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  #question-container {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
  }
  #answers-container .btn {
    font-size: 0.95rem;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.3rem;
  }
  #image-container img {
    border-radius: 0.4rem;
    margin-bottom: 0.3rem;
    max-width: 220px;
    width: 100%;
    box-sizing: border-box;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }
  #feedback {
    font-size: 0.95rem;
    min-height: 1rem;
    margin-top: 0.1rem;
  }
  #back-btn {
    font-size: 0.9rem;
    padding: 0.4rem 0.7rem;
  }
}
