/* Reset y fondo */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, sans-serif;
    background: #1a1a1a;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.visor-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #2c2c2c;
    position: relative;
}

.visor-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(20, 20, 20, 0.8);
    color: #ddd;
    pointer-events: none;
}

.visor-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    pointer-events: auto;
}

.visor-counter {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 5px 14px;
    border-radius: 20px;
    pointer-events: auto;
}

.visor-counter span {
    color: #ffcc00;
    font-weight: 700;
}

.book-wrapper {
    flex: 1;
    position: relative;
    background: #3a3a3a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 10px 80px 10px;
    perspective: 2000px;
}

#flipbook {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    max-height: 800px;
    background: #fff;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

.page {
    margin: 0;
    padding: 0;
    border: none;
    background-color: #fff; /* O negro, dependiendo de cómo quieras el fondo vacío */
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
    font-size: 0.95rem;
    z-index: 30;
    background: rgba(0, 0, 0, 0.7);
    transition: opacity 0.3s;
    pointer-events: none;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffcc00;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.pagination-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    flex-wrap: wrap;
}

.nav-arrow {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ddd;
    transition: 0.2s;
    flex-shrink: 0;
}

.nav-arrow:hover:not(.disabled) {
    background: #ffcc00;
    border-color: #ffcc00;
    color: #1a1a1a;
}

.nav-arrow.disabled {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-arrow svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.page-numbers {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.page-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ccc;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-dot:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffcc00;
    color: #fff;
}

.page-dot.active {
    background: #ffcc00;
    color: #1a1a1a;
    border-color: #ffcc00;
    font-weight: 700;
    pointer-events: none;
}

/* Botones de zoom (se integran con .nav-arrow) */
#zoomOutBtn,
#resetZoomBtn,
#zoomInBtn {
    font-size: 1.2rem;
    font-weight: bold;
}