/* ===================================
   ESTILOS GENERALES
   =================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: black;
  font-family: 'Georgia', serif;
  color: white;
  overflow: hidden;
}

/* ===================================
   CONTENEDOR PRINCIPAL
   =================================== */

#vigilia-container {
  position: relative;
  height: 100vh;
  width: 100vw;
}

/* ===================================
   IMAGEN DE FONDO Y EFECTOS DE LUZ
   =================================== */

#imagen-fondo {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: url('assets/imagen-dia.jpeg');
  background-size: cover;
  background-position: center;
  transition: filter 3s ease-in-out;
  z-index: 1;
}

/* Efecto cuando las luces están apagadas */
.luz-apagada {
  filter: brightness(0.4) grayscale(95%) blur(1px);
}

/* ===================================
   OVERLAY NOCTURNO
   =================================== */

#overlay-noche {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 30, 0.3); /* Azul oscuro semitransparente */
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

/* Mostrar overlay cuando las luces están apagadas */
.luz-apagada + #overlay-noche {
  opacity: 1;
}

/* ===================================
   PANEL DE CONTROLES (BOTONES)
   =================================== */

#interruptores {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#interruptores button {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: 1px solid white;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Georgia', serif;
  font-size: 14px;
  transition: all 0.3s ease;
}

/* Solución para que el clic funcione en todo el botón, incluido el texto */
#interruptores button * {
  pointer-events: none;
}

#interruptores button:hover {
  background: rgba(0, 143, 157, 0.2);
  transform: scale(1.02);
  border: 1px solid green;
}

#interruptores button:active {
  transform: scale(0.98);
}

/* Estilo especial para el botón "Salir" */
#interruptores button:last-child {
  background: #8b0000;
  border: 1px solid #ffdddd;
}

#interruptores button:last-child:hover {
  background: #a00000;
}

/* ===================================
   CONTENEDOR DE VELAS ANIMADAS
   =================================== */

#velas-container {
  display: none; /* Inicialmente oculto */
  position: absolute;
  bottom: 10px;
  right: 15px;
  z-index: 20;

  display: flex;
  justify-content: flex-end; 
  align-items: flex-end;
  gap: 5px;

  /* Evita que se salgan del contenedor */
  max-width: 90%;
  flex-wrap: nowrap;
}

#velas-container img {
  height: 70px;
  width: auto;
  animation: parpadeo 2s infinite ease-in-out;
}


/* ===================================
   RESPONSIVE PARA VELAS
   =================================== */

@media (max-width: 768px) {

  #velas-container {
    bottom: 5px;
    right: 0;
    left: 0;

    /* Ahora centradas para móvil */
    justify-content: center;
    max-width: 100%;
    padding: 0 10px;
  }

  #velas-container img {
    height: 12vw; /* Escala con el ancho de pantalla */
    max-height: 60px;
    min-height: 35px;
  }
}

@media (max-width: 480px) {
  #velas-container img {
    height: 14vw;
    bottom: 30px;
  }
}


/* ===================================
   TEXTO MEDITATIVO
   =================================== */

#texto-meditativo {
  position: absolute;
  bottom: 10%;
  left: 5%;
  width: 45%;
  color: #f5f5f5;
  font-size: 1.5em;
  font-family: 'Georgia', serif;
  line-height: 1.6;
  text-align: justify;
  z-index: 5;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  overflow: hidden;
  height: 50vh;
  padding-bottom: 5vh;
}

.linea-meditativa {
  opacity: 0;
  white-space: pre-wrap;
  transition: opacity 0.2s ease-in;
}

/* ===================================
   MENSAJE DE SALIDA
   =================================== */

#mensaje-salida {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 2.8em;
  font-family: 'Georgia', serif;
  text-align: center;
  opacity: 0;
  z-index: 100;
  pointer-events: none;
  transition: opacity 2s ease-in-out;
}

/* ===================================
   RESPONSIVIDAD - DISPOSITIVOS MÓVILES
   =================================== */

@media (max-width: 768px) {
  #texto-meditativo {
    width: 90%;
    left: 5%;
    font-size: 1.2em;
    bottom: 15%;
  }

  #interruptores button {
    padding: 8px 12px;
    font-size: 12px;
  }

  #mensaje-salida {
    font-size: 2em;
    width: 90%;
  }

  #velas-container img {
    height: 50px;
  }
}