/* Estilos base y comunes */
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #f8f9fa;
}

/* Wrapper para centrar y posicionar el flipbook */
#flipbook-wrapper {
  position: absolute;
  background: #fff;
  transition: transform 0.3s ease;
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
  overflow: hidden !important; /* Forzar ocultar desbordamiento */
  border-radius: 4px;
}

/* Contenedor del flipbook */
#flipbook {
  display: block;
  overflow: hidden !important; /* Forzar ocultar desbordamiento */
}

/* Los canvas se muestran en bloque y se centran dentro del flipbook */
canvas {
  display: block;
  margin: 0 auto;
}

/* Clases para las páginas */
.turn-page {
  overflow: hidden !important;
  box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

/* Loader overlay */
#loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(248, 249, 250, 0.98);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(52, 152, 219, 0.2);
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Botones de navegación minimalistas */
#navigation {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  text-align: center;
  display: flex;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background-color: white;
  color: #2c3e50;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.nav-btn:hover {
  background-color: #f0f7ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.nav-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.nav-btn svg {
  width: 24px;
  height: 24px;
}

/* Efecto shadow para cuando se voltean las páginas */
.hard-shadow {
  box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

/* Ajustes específicos para móviles */
@media screen and (max-width: 767px) {
  .nav-btn {
    width: 38px;
    height: 38px;
  }
  
  .nav-btn svg {
    width: 20px;
    height: 20px;
  }
  
  .spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
  }
  
  /* Asegurar sin barras de desplazamiento en móviles */
  html, body, #flipbook-wrapper, #flipbook {
    overflow: hidden !important;
  }
  
  /* Reducir márgenes en móviles */
  #navigation {
    bottom: 10px;
    padding: 8px;
    gap: 5px;
  }
}

/* Ajustes específicos para tablets */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .nav-btn {
    width: 42px;
    height: 42px;
  }
}