/* ------------------ ESTILOS PARA LA IMAGEN DE LA PORTADA ------------------ */
.portada-imagen {
    margin: 20px 0;
    text-align: center;
}

.logo-portada {
    max-width: 200px;
    height: auto;
    filter: brightness(0) invert(1); /* Hace el logo blanco para contrastar con el fondo oscuro */
    transition: all 0.3s ease;
}

.logo-portada:hover {
    transform: scale(1.05);
    filter: brightness(0) invert(0.9); /* Efecto hover sutil */
}

/* ------------------ MEDIA QUERIES PARA LA IMAGEN DE PORTADA ------------------ */
@media (max-width: 768px) {
    .portada-imagen {
        margin: 15px 0;
    }
    
    .logo-portada {
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .portada-imagen {
        margin: 10px 0;
    }
    
    .logo-portada {
        max-width: 120px;
    }
}


/* ------------------ ESTILOS PARA EL LIBRO INTERACTIVO (CON SEPARADORES EN GRISES) ------------------ */

/* ------------------ SEPARADORES (TABS) ------------------ */
.separadores-container {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0;
  margin-bottom: 25px;
  padding: 0;
  background-color: transparent;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.separadores-container::-webkit-scrollbar {
  display: none;
}

.separador {
  flex-shrink: 0;
  width: 35px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  position: relative;
  margin: 0;
  clip-path: polygon(0 0, 85% 0, 100% 100%, 0% 100%);
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

/* Colores para cada separador - PALETA DE GRISES */
        .separador[data-letra="A"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="B"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="C"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="D"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="E"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="F"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="G"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="H"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="I"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="J"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="K"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="L"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="M"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="N"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="O"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="P"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="Q"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="R"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="S"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="T"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="U"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="V"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="W"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="X"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="Y"] { background-color: #142448; color: #EBECE8; }
        .separador[data-letra="Z"] { background-color: #142448; color: #EBECE8; }

.separador:hover {
  transform: translateY(-3px);
  filter: brightness(1.1);
  z-index: 5;
}

.separador.activo {
  transform: translateY(-5px);
  filter: brightness(1.2);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

/* ------------------ CONTENEDOR DEL LIBRO ------------------ */
.contenedor-libro {
  width: 100%;
  max-width: 800px;
  height: 450px;
  position: relative;
  margin: 0 auto 20px;
  perspective: 1500px;
}

/* ------------------ PORTADA ------------------ */
.portada {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #142448 0%, #0a1a33 100%);
  border-radius: 8px 15px 15px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  z-index: 20;
  transition: all 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  transform-origin: left center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  backface-visibility: hidden;
  overflow: hidden;
}

.portada::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
}

.portada-content {
  padding: 40px;
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.libro-abierto .portada {
  transform: rotateY(-180deg);
  opacity: 0;
  pointer-events: none;
}

.titulo-portada {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  font-weight: 700;
  line-height: 1.2;
}

.subtitulo-portada {
  font-size: 1.3rem;
  color: #a8b5d0;
  margin-bottom: 30px;
  font-weight: 300;
  line-height: 1.4;
}

.btn-abrir {
  padding: 12px 35px;
  background: linear-gradient(135deg, #ebece8 0%, #ffffff 100%);
  color: #142448 !important;
  border: none;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  display: inline-block;
  min-width: 180px;
}

.btn-abrir:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
  color: #142448 !important;
  text-decoration: none;
}

/* ------------------ PÁGINAS INTERIORES ------------------ */
.pagina {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  opacity: 0;
  transition: opacity 0.8s ease 0.5s;
  pointer-events: none;
  z-index: 10;
}

.libro-abierto .pagina {
  opacity: 1;
  pointer-events: auto;
}

.pagina-izquierda, .pagina-derecha {
  width: 50%;
  height: 100%;
  background: #ffffff;
  color: #142448;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  border: 1px solid #d0d1cc;
}

.pagina-content {
  width: 100%;
  height: 100%;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pagina-izquierda {
  border-radius: 0 8px 8px 0;
  box-shadow: inset -8px 0 12px -8px rgba(0, 0, 0, 0.1);
  background: linear-gradient(to right, #f8f9fa 0%, #ffffff 100%);
}

.pagina-derecha {
  border-radius: 8px 0 0 8px;
  box-shadow: inset 8px 0 12px -8px rgba(0, 0, 0, 0.1);
  text-align: left;
  background: linear-gradient(to left, #f8f9fa 0%, #ffffff 100%);
}

/* Imagen del personaje */
.imagen-personaje {
  width: 100%;
  max-width: 220px;
  height: 280px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  margin-bottom: 20px;
  border: 3px solid #142448;
}

.imagen-personaje img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.imagen-personaje:hover img {
  transform: scale(1.05);
}

/* Indicador de letra */
.letra-indicador {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #142448 0%, #0a1a33 100%);
  color: #ffffff;
  border-radius: 50%;
  font-weight: bold;
  font-size: 1.8rem;
  margin-bottom: 20px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  border: 3px solid #ebece8;
}

/* Información del personaje */
.info-personaje {
  width: 100%;
  max-width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.info-personaje h2 {
  font-size: 2rem;
  margin-bottom: 15px;
  color: #142448;
  text-align: center;
  border-bottom: 3px solid #142448;
  padding-bottom: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.info-personaje p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
  color: #333;
  text-align: justify;
  flex-grow: 1;
}

.detalles-personaje {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #142448;
  padding: 20px;
  border-radius: 8px;
  margin-top: 15px;
  border: 2px solid #142448;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.detalles-personaje h3 {
  margin-bottom: 15px;
  font-size: 1.1rem;
  text-align: center;
  color: #142448;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #142448;
  padding-bottom: 8px;
}

.detalles-personaje ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.detalles-personaje li {
  padding: 8px 0;
  border-bottom: 1px solid #dee2e6;
  font-size: 0.9rem;
  line-height: 1.4;
}

.detalles-personaje li:last-child {
  border-bottom: none;
}

.detalles-personaje strong {
  color: #142448;
  font-weight: 600;
}

/* ------------------ PIE DE PÁGINA Y NAVEGACIÓN ------------------ */
.pie-pagina {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0 0 0;
  border-top: 2px solid #142448;
  margin-top: auto;
  width: 100%;
}

.navegacion {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #142448 0%, #0a1a33 100%);
  color: #ffffff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.btn:hover {
  background: linear-gradient(135deg, #0a1a33 0%, #142448 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn:disabled {
  background: #a8b5d0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.numero-pagina {
  color: #142448;
  font-size: 0.9rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sombra-libro {
  width: 100%;
  max-width: 800px;
  height: 15px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.15) 0%, transparent 70%);
  margin: 0 auto;
  margin-top: -5px;
}

/* ------------------ MEDIA QUERIES (Responsividad) ------------------ */
@media (max-width: 768px) {
  .contenedor-libro {
    height: 550px;
    max-width: 95%;
  }
  
  .pagina {
    flex-direction: column;
  }
  
  .pagina-izquierda, .pagina-derecha {
    width: 100%;
    height: 50%;
    border-radius: 0;
    box-shadow: none;
  }
  
  .pagina-izquierda {
    border-bottom: 2px solid #d0d1cc;
    order: 1;
  }
  
  .pagina-derecha {
    order: 2;
  }
  
  .portada-content {
    padding: 20px;
  }
  
  .titulo-portada {
    font-size: 2rem;
  }
  
  .subtitulo-portada {
    font-size: 1.1rem;
  }
  
  .btn-abrir {
    padding: 10px 25px;
    font-size: 1rem;
    min-width: 160px;
  }
  
  .imagen-personaje {
    max-width: 150px;
    height: 180px;
  }
  
  .letra-indicador {
    width: 45px;
    height: 45px;
    font-size: 1.4rem;
  }
  
  .info-personaje h2 {
    font-size: 1.6rem;
  }
  
  .info-personaje p {
    font-size: 0.85rem;
    max-height: 80px;
    overflow-y: auto;
  }
  
  .separador {
    width: 30px;
    height: 40px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .contenedor-libro {
    height: 600px;
  }
  
  .portada-content {
    padding: 15px;
  }
  
  .titulo-portada {
    font-size: 1.8rem;
  }
  
  .subtitulo-portada {
    font-size: 1rem;
    margin-bottom: 20px;
  }
  
  .btn-abrir {
    padding: 8px 20px;
    font-size: 0.9rem;
    min-width: 140px;
  }
  
  .pagina-content {
    padding: 15px;
  }
  
  .imagen-personaje {
    max-width: 120px;
    height: 150px;
  }
  
  .info-personaje h2 {
    font-size: 1.4rem;
  }
  
  .detalles-personaje {
    padding: 15px;
  }
  
  .btn {
    padding: 8px 15px;
    font-size: 0.8rem;
  }
}