/* ---------- ESTILO GENERAL ---------- */
body {
  font-family: 'Galderglynn Regular', sans-serif;
  background-color: #344429;
  margin: 0;
  padding: 0;
  background-image: url('../imagenes/fondo-webapp.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* ---------- HEADER FIJO ---------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  height: 80px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

header img {
  height: 45px;
}

.nav-menu {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.nav-menu a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.nav-menu a:hover {
  color: #d6d1bb;
}

.nav-menu ul {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  display: inline-block;
}

/* ---------- QUIZ CONTAINER ---------- */
#quiz-container {
  background-color: #fdfcf9;
  border-radius: 18px;
  padding: 3rem;
  margin: 140px auto 60px;
  max-width: 650px;
  width: 90%;
  box-shadow: 0 15px 30px rgba(76, 95, 65, 0.2), 0 0 0 3px rgba(255, 255, 255, 0.1);
  text-align: center;
}

h1 {
  font-family: 'Georgia', serif;
  font-size: 2.4rem;
  color: #4C5F41;
  margin-bottom: 1.5rem;
}

#pregunta {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  color: #333;
  font-weight: bold;
}

/* ---------- OPCIONES ---------- */
#opciones {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 1rem;
}

.opcion {
  padding: 12px 20px;
  background-color: #4C5F41;
  color: #fdfcf9;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.opcion:hover {
  background-color: #5f7d51;
  transform: scale(1.01);
}

.correcta {
  background-color: #78c265 !important;
  color: #fff;
}

.incorrecta {
  background-color: #e55050 !important;
  color: #fff;
}

/* ---------- RESULTADO ---------- */
#resultado {
  margin-top: 1rem;
  font-size: 1.1rem;
  font-weight: bold;
  color: #4C5F41;
}

/* ---------- BOTÓN SIGUIENTE ---------- */
#siguiente {
  background-color: #4C5F41;
  color: #fff;
  padding: 10px 24px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: background-color 0.3s ease;
}

#siguiente:hover {
  background-color: #5e7b4f;
}

#final {
  margin-top: 1.5rem;
  font-size: 1.1rem;
  color: #333;
}

/* ---------- MEDIA QUERY: RESPONSIVE ---------- */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    height: auto;
    padding: 1rem;
  }

  .nav-menu {
    flex-direction: column;
    gap: 0.8rem;
    align-items: center;
    margin-top: 0.5rem;
  }

  #quiz-container {
    padding: 2rem;
    margin-top: 160px;
    width: 92%;
  }

  h1 {
    font-size: 1.7rem;
  }

  #pregunta {
    font-size: 1.1rem;
  }

  .opcion {
    font-size: 0.95rem;
    padding: 10px 16px;
  }

  #siguiente {
    font-size: 1rem;
    padding: 10px 20px;
  }
}

/* ---------- PROGRESO VISUAL ---------- */
#progreso-container {
  width: 100%;
  background-color: #cfdac3;
  height: 24px;
  position: fixed;
  top: 80px;
  left: 0;
  z-index: 900;
  overflow: hidden;
  border-radius: 12px;
}

#barra-progreso {
  height: 100%;
  width: 0%;
  background-color: #1b3e2b;
  transition: width 0.6s ease, background-color 0.6s ease;
  position: relative;
  border-radius: 12px;
}

#progreso-texto {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: bold;
}

/* Animación suave para la barra */
#barra-progreso {
  height: 100%;
  width: 0%;
  transition: width 0.6s ease-in-out, background 0.6s ease-in-out;
  background: linear-gradient(to right, #d7a81b, #4c5f41); /* se actualizará en JS */
  position: relative;
}

/* Hojitas flotando */
.hoja-flotante {
  position: fixed;
  width: 30px;
  height: 30px;
  background-image: url('../imagenes/hoja-simple.png');
  background-size: contain;
  background-repeat: no-repeat;
  animation: caerHoja 3s ease-in forwards;
  pointer-events: none;
  z-index: 999;
  opacity: 0.9;
}

@keyframes caerHoja {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  25% {
    transform: translateX(-20px) translateY(25vh) rotate(45deg);
  }
  50% {
    transform: translateX(20px) translateY(50vh) rotate(90deg);
  }
  75% {
    transform: translateX(-20px) translateY(75vh) rotate(135deg);
  }
  100% {
    transform: translateX(0px) translateY(100vh) rotate(180deg);
    opacity: 0;
  }
}