/* Mantenemos las fuentes y estilos base */
@font-face {
  font-family: 'Macondo';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(macondo.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

body, html {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  overflow: hidden;
}

body {
  background: url("bg.webp");
    background-position: center center; /* Centra la imagen de fondo horizontal y verticalmente */
    background-size: cover; /* Escala la imagen de fondo para cubrir todo el contenedor */
    background-repeat: no-repeat; /* Evita que la imagen de fondo se repita */
    background-attachment: fixed; /* Opcional: Mantiene la imagen de fondo fija cuando se hace scroll */
  display: flex;
  flex-direction: column;
}

/* Contenedor principal */
.main-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Espacios para publicidad */
.ad-space {
  background-color: rgba(0, 0, 0, 0.4);
  color: white;
  display: none;
  padding: 10px;
  text-align: center;
  height: 60px; /* Ajusta según sea necesario */
}

/* Contenedor de citas */
.quote-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column; /* Cambiado a column para alinear verticalmente */
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  max-width: 80%;
  margin: auto;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
}

/* Estilos para la cita */
#quote {
  font-family: "Macondo", cursive;
  font-size: 24px;
  position: relative;
  padding: 0 40px; /* Aumentamos el padding horizontal para dejar espacio a las comillas */
  transition: text-shadow 1s ease;
  text-align: center;
  margin-bottom: 20px;
  display: inline-block; /* Cambiamos a inline-block para que se ajuste al contenido */
}

#quote::before, #quote::after {
  content: "\"";
  font-size: 50px;
  color: #4d4d4d;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

#quote::before {
  left: 0;
}

#quote::after {
  right: 0;
  content: "\"";
}

#author {
  font-style: italic;
  font-size: 36px;
  font-family: "Macondo", cursive;
  text-align: center; /* Centrar el autor */
  margin-top: 20px;
  margin-bottom: 10px; /* Espacio entre el autor y la categoría */
  transition: text-shadow 1s ease;
}

#author::before {
  content: "- ";
  font-size: 24px;
  color: #4d4d4d;
}

#category {
  color: #ccc;
  margin-top: 10px;
  font-size: 14px;
}

/* Efectos de hover */
#quote:hover, #author:hover {
  text-shadow: 0 0 10px #ffcc00, 0 0 20px #ffcc00, 0 0 30px #ffcc00;
}

/* Botón de nueva cita */
#newQuote {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px;
  font-size: 24px;
  cursor: pointer;
  background-color: transparent;
  color: rgba(255, 255, 255, 0.6);
  border: none;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  z-index: 100;
}

#newQuote:hover {
  color: rgba(255, 255, 255, 1);
  text-shadow: 0 0 8px yellow;
}

/* Media queries para diseño responsivo */
@media (min-width: 768px) {
  .main-container {
    flex-direction: row;
  }

  .ad-space {
    display: none;
    width: 200px;
    height: 100vh;
  }

  .quote-container {
    max-width: 600px;
    height: auto;
    max-height: 80vh;
  }
}

/* Ajustes para pantallas muy pequeñas */
@media (max-width: 480px) {
  #quote {
    font-size: 18px;
  }

  #author {
    font-size: 24px;
  }

  .quote-container {
    padding: 10px;
  }
}

.firefly {
  position: fixed;
  width: 0.4vw;
  height: 0.4vw;
  animation: move 20s alternate infinite;
  pointer-events: none;
  z-index: -100;
}

.firefly::before,
.firefly::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transform-origin: -10vw;
}

.firefly::before {
  background: black;
  opacity: 0.4;
  animation: drift 10s ease alternate infinite;
}

.firefly::after {
  background: white;
  opacity: 0;
  box-shadow: 0 0 0vw 0vw yellow;
  animation: drift 10s ease alternate infinite, flash 4s ease infinite;
}

@keyframes drift {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes flash {
  0%,
  30%,
  100% {
    opacity: 0;
    box-shadow: 0 0 0 0 yellow;
  }
  5% {
    opacity: 1;
    box-shadow: 0 0 2vw 0.4vw yellow;
  }
}

@keyframes move {
  0% {
    transform: translateX(var(--x-start)) translateY(var(--y-start));
  }
  100% {
    transform: translateX(var(--x-end)) translateY(var(--y-end));
  }
}

.firefly:nth-child(1) {
  --x-start: 10vw;
  --y-start: 20vh;
  --x-end: 80vw;
  --y-end: 80vh;
}
.firefly:nth-child(2) {
  --x-start: 90vw;
  --y-start: 10vh;
  --x-end: 20vw;
  --y-end: 90vh;
}
.firefly:nth-child(3) {
  --x-start: 50vw;
  --y-start: 50vh;
  --x-end: 10vw;
  --y-end: 10vh;
}
.firefly:nth-child(4) {
  --x-start: 30vw;
  --y-start: 80vh;
  --x-end: 70vw;
  --y-end: 20vh;
}
.firefly:nth-child(5) {
  --x-start: 70vw;
  --y-start: 30vh;
  --x-end: 30vw;
  --y-end: 70vh;
}

.firefly:nth-child(1)::after {
  animation-delay: 0s, 1s;
}
.firefly:nth-child(2)::after {
  animation-delay: 0s, 2.5s;
}
.firefly:nth-child(3)::after {
  animation-delay: 0s, 0.5s;
}
.firefly:nth-child(4)::after {
  animation-delay: 0s, 3.5s;
}
.firefly:nth-child(5)::after {
  animation-delay: 0s, 1.8s;
}

/* Puedes añadir más selectores nth-child para más luciérnagas */

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
.quote-container {
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  max-width: 600px;
  width: 80%;
  height: 50%;
  text-align: center;
  transition: opacity 0.5s ease;
}
