/* css/lector.css */

.lector-body {
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #2c3e50; /* Color gris/azulado de fondo exterior para resaltar el libro */
  font-family: system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

/* Header superior */
.lector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background-color: #ffffff;
  border-bottom: 4px solid #2b414e;
  height: 55px;
  box-sizing: border-box;
  z-index: 10;
}

.lector-nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-volver {
  color: #333;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.book-title {
  font-size: 0.95rem;
  color: #666;
  font-weight: 500;
}

.lector-controls {
  display: flex;
  gap: 8px;
}

.lector-controls button,
.btn-theme {
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.lector-controls button:hover,
.btn-theme:hover {
  background: #e0e0e0;
}

/* Área central del libro */
.lector-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  width: 100%;
  height: calc(100vh - 55px);
  margin: 0 auto;
  padding: 0 10px;
  box-sizing: border-box;
  overflow: hidden;
}

/* Visor principal */
.epub-viewer {
  width: 100%;
  height: 85vh;
  margin: 0 auto;
  position: relative;
  background-color: transparent !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

/* =========================================================
   REGLAS PARA CENTRAR EL IFRAME Y CONTENEDORES DE EPUB.JS
   ========================================================= */
.epub-container,
.epub-view,
.epub-view > div {
  margin: 0 auto !important;
  left: 0 !important;
  right: 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.epub-viewer iframe {
  border: none !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); /* Sombra que delimita la hoja virtual */
  margin: 0 auto !important;
  display: block !important;
}

/* Flechas de navegación */
.nav-arrow {
  background: transparent;
  border: none;
  font-size: 3rem;
  color: #ffffff;
  cursor: pointer;
  padding: 0 15px;
  user-select: none;
  z-index: 5;
  transition: opacity 0.2s ease;
  opacity: 0.7;
}

.nav-arrow:hover {
  opacity: 1;
}
/* css/lector.css */

.lector-body {
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #2c3e50; /* Fondo oscuro neutro para resaltar las páginas del ePub */
  font-family: system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

/* Header superior */
.lector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background-color: #ffffff;
  border-bottom: 4px solid #2b414e;
  height: 55px;
  box-sizing: border-box;
  z-index: 10;
}

.lector-nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-volver {
  color: #333;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.book-title {
  font-size: 0.95rem;
  color: #666;
  font-weight: 500;
}

.lector-controls {
  display: flex;
  gap: 8px;
}

.lector-controls button,
.btn-theme {
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.lector-controls button:hover,
.btn-theme:hover {
  background: #e0e0e0;
}

/* Contenedor central del lector */
.lector-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  width: 100%;
  height: calc(100vh - 55px);
  margin: 0 auto;
  padding: 0 10px;
  box-sizing: border-box;
  overflow: hidden;
}

/* Visor donde ePub.js dibuja el libro */
.epub-viewer {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  position: relative;
  background-color: transparent !important;
}

/* 
 * IMPORTANTE: No modificar el posicionamiento absoluto interno de ePub.js 
 * para que las dos páginas permanezcan juntas en el centro.
 */
.epub-container {
  margin: 0 auto !important;
}

.epub-viewer iframe {
  border: none !important;
  background-color: transparent !important;
}

/* Flechas de navegación */
.nav-arrow {
  background: transparent;
  border: none;
  font-size: 3rem;
  color: #ffffff;
  cursor: pointer;
  padding: 0 15px;
  user-select: none;
  z-index: 5;
  transition: opacity 0.2s ease;
  opacity: 0.7;
}

.nav-arrow:hover {
  opacity: 1;
}

/* Selector de Índice / Capítulos */
.toc-select {
  background: #f8f9fa;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 0.85rem;
  color: #333;
  cursor: pointer;
  max-width: 200px;
  text-overflow: ellipsis;
  outline: none;
  transition: all 0.2s ease;
}

.toc-select:hover {
  background: #e9ecef;
  border-color: #bbb;
}