:root {
  --primary-color: #FF5722;      
  --primary-light: #FF8A65;     
  --primary-dark: #E64A19;       
  --secondary-color: #3F51B5;    
  --secondary-light: #7986CB;    
  --secondary-dark: #303F9F;     
  --error-color: #E91E63;        
  --success-color: #4CAF50;      
  --background-color: #FFF3E0;  
  --text-color: #212121;         
  --text-light: #FFFFFF;       
}

/* Animaciones globales */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes glow {
  0% { box-shadow: 0 0 5px rgba(255, 87, 34, 0.5); }
  50% { box-shadow: 0 0 20px rgba(255, 87, 34, 0.8); }
  100% { box-shadow: 0 0 5px rgba(255, 87, 34, 0.5); }
}

/* Estilos base */
body {
  font-family: 'Nunito', sans-serif;
  background: var(--background-color) url('images/fondo.jpg') no-repeat center center fixed;
  background-size: cover;
  color: var(--text-color);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  transition: background-color 0.5s ease;
}

/* Header con animación */
header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  background-size: 200% 200%;
  animation: gradientShift 10s ease infinite;
  color: white;
  padding: 2rem;
  text-align: center;
  border-radius: 0 0 30px 30px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

header h1 {
  margin-bottom: 0.5rem;
  font-size: 2.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  animation: fadeIn 1s ease;
}

header p {
  font-size: 1.2rem;
  margin-top: 0;
  animation: fadeIn 1.2s ease;
}

/* Panel de puntuación con animaciones */
#score-container {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
  animation: fadeIn 1.5s ease;
}

#score-container p {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.7rem 1.2rem;
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#score-container p:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Navegación mejorada */
nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  margin-top: 1rem;
  animation: fadeIn 1.8s ease;
}

nav button {
  background: white;
  border: none;
  border-radius: 15px;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}

nav button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

nav button:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 25px rgba(0,0,0,0.2);
}

nav button:hover::before {
  transform: translateX(0);
}

.nav-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-bottom: 1rem;
  border: 3px solid transparent;
  transition: all 0.3s ease;
  object-fit: cover;
}

nav button:hover .nav-icon {
  border-color: var(--primary-color);
  transform: scale(1.1);
}

/* Estilos para el botón Nivel 2 */
#nivel2-button-container {
  text-align: center;
  margin: 2rem auto;
  max-width: 300px;
}

#btnNivel2 {
  background-color: var(--secondary-color);
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  width: 100%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
}

#btnNivel2:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  box-shadow: none;
}

#btnNivel2::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: rgba(255,255,255,0.1);
  transition: width 0.5s ease;
}

#btnNivel2:hover:enabled {
  background-color: var(--primary-color);
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.3);
}

#btnNivel2:hover:enabled::after {
  width: 100%;
}

/* Módulos con animaciones */
.module {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 20px auto;
  padding: 20px;
  border: 1px solid #ccc;
  border-radius: 10px;
  background-color: #f9f9f9;
  max-width: 600px;
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  margin: 2.5rem auto;
  max-width: 800px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  animation: fadeIn 0.8s ease;
  transform: translateY(20px);
  opacity: 0;
  animation-fill-mode: forwards;
}

.module h2 {
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--primary-light);
  position: relative;
}

.module h2::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background-color: var(--primary-color);
}

/* Contenedores de ejercicios con animaciones */
.exercise-container {
  background: #fff;
  border-radius: 15px;
  padding: 2rem;
  margin: 1.5rem 0;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  animation: slideIn 0.5s ease;
  border-left: 5px solid var(--primary-light);
}

.exercise-container:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  transform: translateY(-5px);
}

.exercise-container h3 {
  color: var(--secondary-color);
  margin-bottom: 1.5rem;
}

.exercise-image {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease;
}

.exercise-container:hover .exercise-image {
  transform: scale(1.02);
}

/* Opciones de respuesta */
.options-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.option-button {
  padding: 0.5rem 1rem;
  margin: 0.5rem;
  border: none;
  border-radius: 5px;
  background-color: #f0f0f0; /* Color de fondo por defecto */
  cursor: pointer;
  transition: background-color 0.3s;
}

.option-button.selected {
  background-color: #2196F3; /* Color azul para la respuesta seleccionada */
  color: white; /* Color del texto cuando está seleccionado */
}

.option-button:hover {
  background-color: #ddd; /* Color de fondo al pasar el mouse */
}

/* Input para ejercicios de gramática */
.grammar-input {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--secondary-light);
  border-radius: 15px;
  margin: 1rem 0;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.grammar-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 8px rgba(255, 87, 34, 0.3);
  outline: none;
}

/* Texto para lectura y gramática */
.reading-text, .grammar-text {
  background-color: #f9f9f9;
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--secondary-color);
  font-size: 1.1rem;
  line-height: 1.7;
}

/* Feedback mejorado */
.feedback-message {
  padding: 1.2rem;
  margin: 1.5rem 0;
  border-radius: 15px;
  text-align: center;
  font-weight: bold;
  animation: fadeIn 0.5s ease;
  opacity: 0;
  animation-fill-mode: forwards;
}

.feedback-message.correct {
  background-color: rgba(76, 175, 80, 0.1);
  border-left: 5px solid var(--success-color);
  color: var(--success-color);
}

.feedback-message.incorrect {
  background-color: rgba(244, 67, 54, 0.1);
  border-left: 5px solid var(--error-color);
  color: var(--error-color);
}

.feedback-icon {
  font-size: 1.5rem;
  margin: 0 0.5rem;
  display: inline-block;
  animation: bounce 1s infinite;
}

/* Reproductor de audio */
.audio-container {
  margin: 1.5rem 0;
  display: flex;
  justify-content: center;
}

audio {
  width: 100%;
  max-width: 400px;
  border-radius: 30px;
  background-color: var(--secondary-light);
}

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 1.5rem;
  }
  
  nav {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    padding: 1rem;
  }
  
  .module {
    padding: 1.5rem;
    margin: 1.5rem 1rem;
  }
  
  .exercise-container {
    padding: 1.5rem;
  }
  
  #score-container {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  
  #score-container p {
    margin: 0.3rem;
  }
}

.check-button {
    padding: 0.8rem 1.5rem;
    background-color: #007BFF; /* Color de fondo */
    color: white; /* Color del texto */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    font-size: 1rem;
    margin-top: 1rem; /* Espacio superior para separar del contenido */
}

.check-button:hover {
    background-color: #0056b3; /* Color de fondo al pasar el mouse */
    transform: scale(1.05); /* Efecto de aumento al pasar el mouse */
}

.check-button:active {
    transform: scale(0.95); /* Efecto de reducción al hacer clic */
}

.correct {
    background-color: #4CAF50; /* Color verde para respuestas correctas */
    color: white; /* Color del texto */
}

.incorrect {
    background-color: #f44336; /* Color rojo para respuestas incorrectas */
    color: white; /* Color del texto */
}