/* =====================================================
   ARCHIVO: style.css
   VERSIÓN: 6.0 FINAL LIMPIO
   DESCRIPCIÓN: Versión limpia sin estilos de marca de agua
   FECHA: 2025-01-27
   ===================================================== */

/* === Estilos generales === */
body {
  margin: 0;
  padding: 0;
  background-color: #0c0c0c;
  color: #fff;
  font-family: "Raleway", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  overflow: hidden;
}

/* === Barra de controles superior === */
#toolbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #111827;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  z-index: 1000;
}

.toolbar-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

#toolbar button {
  background-color: #1f2937;
  color: #fff;
  border: none;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  transition: background 0.2s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  position: relative;
  z-index: 1;
}

#toolbar button:hover {
  background-color: #374151;
  transform: scale(1.1);
}

#pageInfo {
  margin: 0 12px;
  font-size: 15px;
}

/* === Contenedor del visor === */
#viewerContainer {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  margin-top: 50px;
  background-color: #000;
  cursor: grab;
}

#viewerContainer:active {
  cursor: grabbing;
}

#canvasWrapper {
  width: fit-content;
  height: fit-content;
  padding: 40px;
  box-sizing: border-box;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

#viewerContainer canvas {
  display: block;
  margin: 0 auto;
  touch-action: none;
  cursor: inherit;
}

canvas {
  box-shadow: 0 0 25px rgba(0,0,0,0.6);
  background: #fff;
  border-radius: 8px;
  display: block;
  image-rendering: auto;
  -webkit-font-smoothing: antialiased;
}

/* === Contenedor de botón con etiqueta encima === */
.button-with-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.button-label {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.page-container button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  width: 36px;
  font-size: 18px;
  cursor: pointer;
}

button:focus {
  outline: none;
}

#toolbar button:disabled,
#toolbar button.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  background-color: #374151;
}

/* === Contenedor de controles de zoom === */
.zoom-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.zoom-label-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin-top: -4px;
}

.zoom-label {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 3px;
  line-height: 1;
  text-align: center;
}

#zoomIn,
#zoomOut {
  width: 40px;
  height: 40px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1;
}

#zoomSelect {
  font-size: 14px;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  margin: 0;
}

#zoomInfo {
  margin: 0;
  font-weight: 600;
}

.zoom-container button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
  font-size: 20px;
  cursor: pointer;
}

/* === Contenedor de navegación de páginas === */
.page-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.page-label-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin-top: -4px;
}

.page-label {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 3px;
  line-height: 1;
  text-align: center;
}

#pageSelect {
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
}

#pageCount {
  font-weight: 600;
  color: #fff;
}

.page-separator {
  font-weight: 600;
  color: #fff;
  margin: 0 2px;
}

/* === RESPONSIVO PARA MÓVILES === */
@media (max-width: 768px) {
  #toolbar {
    position: sticky;
    top: 0;
  }

  #canvasWrapper {
    padding: 20px 20px 80px 20px;
    min-height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }

  .toolbar-buttons {
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 4px;
    justify-content: center;
  }

  #toolbar button {
    font-size: 18px;
    padding: 4px 5px;
    min-width: 32px;
    min-height: 32px;
  }

  #zoomIn,
  #zoomOut {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }

  #pageSelect,
  #zoomSelect {
    font-size: 13px;
    padding: 1px 3px;
  }

  .page-label,
  .zoom-label {
    font-size: 11px;
  }

  #viewerContainer {
    margin-top: 0;
  }

  .page-container button {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }
  
  .button-label {
    font-size: 9px;
  }
  
  #viewerContainer {
    cursor: default;
  }
  
  #viewerContainer:active {
    cursor: default;
  }
}

@media (max-width: 400px) {
  .toolbar-buttons {
    gap: 3px;
  }

  #toolbar button {
    min-width: 28px;
    min-height: 28px;
    font-size: 16px;
  }

  #pageSelect,
  #zoomSelect {
    font-size: 12px;
  }

  .page-label,
  .zoom-label {
    font-size: 10px;
  }

  #canvasWrapper {
    padding: 15px 15px 70px 15px;
  }
}