@import url("https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap");

:root {
  --primary-color: #4caf50;
  --secondary-color: #2196f3;
  --background-dark: #1f2833;
  --card-bg: #29323c;
  --text-light: #c5c6c7;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--background-dark);
  color: var(--text-light);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
}

/* Particles Container */
.particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 0;
  top: 0;
  left: 0;
}

/* Main Content Wrapper */
.quiz-container {
  z-index: 10;
  position: relative;
  background: rgba(41, 50, 60, 0.9);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
  max-width: 500px;
  width: 90%;
  transition: all 0.5s ease-in-out;
  min-height: 400px;
}

h1 {
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: 25px;
  text-align: center;
}

.btn-main {
  background-color: var(--primary-color);
  border: none;
  color: white;
  transition: background-color 0.3s, transform 0.2s;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
}

.btn-main:hover {
  background-color: #388e3c;
  transform: translateY(-2px);
}

/* Settings Form Styling */
.settings .form-select,
.settings .form-control {
  background-color: var(--card-bg);
  color: var(--text-light);
  border: 1px solid #3a4750;
  border-radius: 8px;
}
.settings label {
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 5px;
}

/* Quiz UI Styling */
.quiz {
  display: none;
}

.question-text {
  font-size: 1.25rem;
  margin-bottom: 20px;
  padding: 15px;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
  text-align: center;
}

/* Timer Styles */
.timer {
  margin-bottom: 18px;
}
.timer-top {
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}
.time-remaining {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.25rem;
}
.timer-label {
  font-size: 0.9rem;
  color: #9aa6b2;
}
.timer-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}
.timer-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  transition: width 0.2s linear;
}

.choice {
  background-color: #3a4750;
  color: var(--text-light);
  padding: 12px 20px;
  margin-bottom: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
  border: 2px solid transparent;
  text-align: left;
  word-wrap: break-word;
}

.choice:hover {
  background-color: #4b5a67;
  border-color: var(--secondary-color);
  transform: scale(1.02);
}

.choice.correct {
  background-color: #388e3c;
  border-color: var(--primary-color);
  animation: pulse-correct 0.5s 3;
}

.choice.incorrect {
  background-color: #d32f2f;
  border-color: #f44336;
  animation: shake 0.5s;
}

/* Results Styling */
.results h2 {
  color: var(--primary-color);
  font-size: 2.5rem;
}
.results p {
  font-size: 1.1rem;
  margin-top: 10px;
}

.progress {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: #888;
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(41, 50, 60, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  z-index: 20;
  color: white;
  text-align: center;
}
.spinner-border {
  color: var(--primary-color);
}

/* Animate.css effects overrides */
.animate__animated {
  animation-duration: 0.5s;
}

@keyframes pulse-correct {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}
