/* RESET CSS */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}



/* GENERAL */
body {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: monospace, sans-serif;
    font-size: 0.5rem;
    transition: background-color 0.3s;
    overflow-y: hidden;
}



input {
    display: none;
}

/* MAIN */
#toggle-mode-btn {
    width: 2rem;
    height: 2rem;
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    border: none;
    border-radius: 0.5rem;
    background-color: transparent;
    transition: background-color 0.3s;
    cursor: pointer;
}



/* RESPONSIVE WARNING */
#responsive-warning {
    width: 100%;
    height: 100%;
    padding: 2rem;
    position: fixed;
    top: 0;
    left: 0;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    font-size: 1rem;
    text-align: center;
    z-index: 9999;
}

.warning-icons {
    font-size: 10rem;
}

@media (max-width: 768px) {
    #responsive-warning.show {
        display: flex;
    }
}

/* FLIP BOOK */
#flip_book {
    width: 425px;
    height: 570px;
    position: relative;
    transition-duration: 1s;
    perspective: 2000px;
      z-index: 10;
      box-shadow: 20px 20px 40px rgba(0, 0, 0, 0.4);

}

.btn-detalle {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: #FFD700;
  color: #000;
  font-weight: normal;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  width: auto;
  height: auto;
  min-width: 100px;
  text-align: center;
  line-height: 1.2;
  text-decoration: none;
  font-size: 1rem;
 box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);

  border: 1px solid #b76e79; 
  z-index: 150;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}


.btn-detalle:hover {
  background-color: #e6c200;
}



.titulo-portada {
  position: absolute;
  top: 120px; 
  transform: translateX(-50%);
    left: 50%;
  font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1.5rem;
   font-weight: 300;
  color: #fff;
  font-style:inherit;
  text-align:center;
  text-shadow: 3px 3px 6px rgba(0,0,0,0.2);
  z-index: 120; /* encima de la imagen */
   white-space: nowrap; /* evita saltos de línea */
  transition: opacity 0.5s ease;
}


#cover_checkbox:checked ~ #flip_book .front_cover .titulo-portada {
  opacity: 0;
  pointer-events: none;
}


.front_cover {
    position: relative; /* Asegura que el contenido absoluto se posicione respecto a este */
    overflow: hidden;   /* Para que la imagen no se salga del contenedor */
}
.front_cover::before {
    content: "";
    position: absolute;
    top: 0;
    right: -10px; /* sobresale por la derecha */
    width: 10px;
    height: 100%;
    background: linear-gradient(to left, #a8646f, #b76e79);
    box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.2);
    border-radius: 0 5px 5px 0;
    z-index: -1;
}

.back_cover::before {
    content: "";
    position: absolute;
    top: 0;
    left: -10px; /* sobresale por la izquierda */
    width: 10px;
    height: 100%;
    background: linear-gradient(to right, #a8646f, #b76e79);
    box-shadow: inset -1px 0 1px rgba(0, 0, 0, 0.2);
    border-radius: 5px 0 0 5px;
    z-index: -1;
}


#flip_book {
  position: relative;
  background: #b76e79; /* Color base del libro */
  border-radius: 5px;
  overflow: visible; /* Asegúrate de que los pseudoelementos no se corten */
}
.front_cover {
  position: relative; /* ya lo tienes */
}

.front_cover .abrirme-tab {
  position: absolute;
  top: 50%;
  right: -32px; /* Fuera del borde derecho, ajusta según necesites */
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
  background-color: #fefefe;
  color: #a8646f; /* color a juego con el libro */
  font-weight: 700;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1rem;
  padding: 6px 12px;
  border-radius: 0 0 4px 4px ;
  box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  user-select: none;
  z-index: 130; /* encima de todo */
  transition: background-color 0.3s ease;
}

.front_cover .abrirme-tab:hover {
  background-color: #e0d1d7;
}
#cover_checkbox:checked ~ #flip_book .front_cover .abrirme-tab {
  opacity: 0;
  pointer-events: none;
  
}


.front_cover .mockup-pc {
    position: absolute;
    bottom: 0;          /* La imagen empieza desde abajo */
    left: 50%;          /* Centrada horizontalmente */
    transform: translateX(-50%);
    width: 90%;         /* Ajusta el tamaño según necesites */
    height: auto;
    pointer-events: none; /* Para que no interfiera con clics si es solo decorativa */
    user-select: none;  /* Evita que la imagen se pueda seleccionar */
}

#cover_checkbox:checked ~ #flip_book .front_cover .mockup-pc  {
  opacity: 0;
  pointer-events: none;
}


.front_cover,
.back_cover {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 2.5px 5px 5px 2.5px;
    background-image: url(./assets/images/flip_book_edge_shading.webp);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color:#b76e79;
    box-shadow: 0 0 5px 0 rgb(25, 25, 25, 0.25);
}

.front_cover {
    position: absolute;
    cursor: pointer;
    transform-origin: center left;
    transition: transform 0.5s;
    z-index: 99;
}

.front_cover label {
    width: 100%;
    height: 100%;
    position: absolute;
    cursor: pointer;
}

.page {
    width: 401px;
    height: 550px;
    position: absolute;
    top: 10px;
    left: 1px;
    border-radius: 0 5px 5px 0;
    background-color: white;
    transform-origin: left;
    transform-style: preserve-3d;
    transform: rotateY(0deg);
    transition-duration: 0.5s;
}

.front_page {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
}

.front_page label {
    width: 100%;
    height: 100%;
    position: absolute;
    cursor: pointer;
    z-index: 100;
}

.back_page {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    transform: rotateY(180deg);
    z-index: 100;
}

.back_page label {
    width: 100%;
    height: 100%;
    position: absolute;
    cursor: pointer;
    z-index: 100;
}

.edge_shading {
      width: 400px;
    height: 550px;
    position: absolute;
    z-index: 98;
}

.front_content {
    width: 400px;
    height: 550px;
    position: absolute;
    top: 1px;
    border-radius: 0 5px 5px 0;
    z-index: 97;
}

.back_content {
    width: 400px;
    height: 550px;
    position: absolute;
    top: 1px;
    left: 1px;
    border-radius: 5px 0 0 5px;
    z-index: 97;
}

.back_cover {
    position: relative;
    z-index: -1;
}

#page1 {
    z-index: 8;
}

#page2 {
    z-index: 5;
}

#page3 {
    z-index: 4;
}

#page4 {
    z-index: 3;
}

#page5 {
    z-index: 2;
}

#cover_checkbox:checked~#flip_book {
    transform: translateX(144px)
}

#cover_checkbox:checked~#flip_book .front_cover {
    transform: rotateY(-180deg);
    transition: transform 1.5s, z-index 0.5s 0.5s;
    z-index: 1;
}

#cover_checkbox:checked~#flip_book #cover {
    width: 80%;
    height: 80%;
    position: absolute;
}

#page1_checkbox:checked~#flip_book #page1 {
    transform: rotateY(-180deg);
    z-index: 3;
}

#page2_checkbox:checked~#flip_book #page2 {
    transform: rotateY(-180deg);
    z-index: 4;
}

#page3_checkbox:checked~#flip_book #page3 {
    transform: rotateY(-180deg);
    z-index: 5;
}

#page4_checkbox:checked~#flip_book #page4 {
    transform: rotateY(-180deg);
    z-index: 6;
}

#page5_checkbox:checked~#flip_book #page5 {
    transform: rotateY(-180deg);
    z-index: 9;
}



