/* =========================================
   1. VARIABLES Y CONFIGURACIÓN (ROOT)
   ========================================= */
:root {
  /* Paleta de Colores */
  --primary-color: #d81b60;
  --primary-dark-color: #ad1457;
  --secondary-color: #ff80ab;
  --secondary-dark-color: #f06292;
  --text-color: #4a4a4a;
  --text-muted: #757575;
  --page-bg-color: #fffaf0;
  --cover-bg-color: #880e4f;
  --body-bg-color: #fce4ec;
  --book-border-radius: 12px;

  /* Espaciado */
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;

  /* Z-Index */
  --z-background: -1;
  --z-page: 10;
  --z-content: 20;
  --z-controls: 50;
  --z-overlay: 100;
}

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

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Georgia", serif;
  background-color: var(--body-bg-color);
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* Fondo animado */
.background-hearts {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-background);
  pointer-events: none;
}
.background-hearts::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 21.35l-1.84-1.77C4.62 14.07 2 11.03 2 7.5 2 4.42 4.42 2 7.5 2c1.74 0 3.41.81 4.5 2.09C13.09 2.81 14.76 2 16.5 2 19.58 2 22 4.42 22 7.5c0 3.53-2.62 6.57-8.16 12.08L12 21.35z" fill="%23f48fb1" opacity="0.5"/></svg>');
  background-size: 40px 40px;
  animation: move-hearts 30s linear infinite;
}
@keyframes move-hearts {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-100%);
  }
}

/* Contenedor del Libro (Estructura Base) */
.book-container {
  position: relative;
  width: 90vw;
  max-width: 600px;
  aspect-ratio: 2 / 3;
  height: auto;
  min-height: auto;
  max-height: 85vh;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  border-radius: var(--book-border-radius);
  overflow: hidden;
  background-color: var(--page-bg-color);
  margin: auto;
  display: flex;
  transition: all 0.5s ease;
}

.page {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: var(--page-bg-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-lg);
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 1;
  padding-bottom: 90px !important; /* Espacio para navbar */
}
.page.active {
  opacity: 1;
  z-index: var(--z-page);
  pointer-events: auto;
}

/* Portada */
.cover-page {
  background-color: var(--cover-bg-color);
  color: #fff;
  border: 5px solid var(--primary-color);
  text-align: center;
}
.cover-content h1 {
  font-family: "Dancing Script", cursive;
  font-size: clamp(2.5rem, 5vw, 5rem);
  margin-bottom: var(--spacing-sm);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}
.cover-content p {
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-style: italic;
  opacity: 0.9;
}
.roses-bouquet {
  width: clamp(150px, 30vw, 300px);
  height: clamp(150px, 30vw, 300px);
  background-image: url("../img/img-rosas.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin: var(--spacing-md) auto;
}

.hidden-input {
  display: none;
}

/* MEDIA QUERIES GLOBALES (Tamaño del libro) */
@media (max-width: 480px) {
  .book-container {
    width: 95vw;
    aspect-ratio: auto;
    height: 80vh;
  }
}
@media (min-width: 481px) and (max-width: 1023px) {
  .book-container {
    width: 85vw;
    aspect-ratio: 3 / 4;
  }
}
@media (min-width: 1024px) {
  :root {
    --spacing-md: 20px;
    --spacing-lg: 40px;
  }
  .book-container {
    width: auto;
    height: 90vh;
    aspect-ratio: 4 / 5; /* Formato Album Grande */
    max-width: 1200px;
    margin: 2vh auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  }
  .page {
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.02);
  }
}
@media (min-width: 2000px) {
  .book-container {
    height: 80vh;
  }
}
