/**
 * Zikpic Reader - Diseño Minimalista 2.0
 * Sin header, sidebar con 3 iconos, flechas alargadas, barra móvil desplegable
 */

/* ==================== OCULTAR HEADER ANTIGUO ==================== */
#readerHeader,
.reader-header,
.header-buttons {
    display: none !important;
}

/* ==================== RESET Y CONTENEDOR PRINCIPAL ==================== */
.zikpic-reader {
    width: 100%;
    min-height: 100vh;
    background: #0a0a0a;
    position: relative;
    overflow: hidden;
}

/* ==================== TEMAS DE UI ==================== */
/* Tema Dark (por defecto) */
.zikpic-reader[data-theme="dark"],
.zikpic-reader[data-theme="auto"] {
    background: #0a0a0a;
    background: url(../img/bg-visor_oscuro.webp);
    background-size: cover;
}

/* Tema Light */
.zikpic-reader[data-theme="light"] {
    background: #f5f5f5;
    background: url(../img/bg-visor_claro.webp);
    background-size: cover;
}

.zikpic-reader[data-theme="light"] .reader-title {
    color: #222;
    text-shadow: 2px 2px 8px rgba(255, 255, 255, 0.9);
}

/* Tema Sepia */
.zikpic-reader[data-theme="sepia"] {
    background: #f4ecd8;
    background: url(../img/bg-visor_sepia.webp);
    background-size: cover;
}

.zikpic-reader[data-theme="sepia"] .reader-title {
    color: #5c4a2f;
    text-shadow: 2px 2px 8px rgba(255, 255, 255, 0.7);
}

.zikpic-reader[data-theme="sepia"] .sidebar-icon-btn,
.zikpic-reader[data-theme="sepia"] .page-counter-right {
    background: rgba(92, 74, 47, 0.7);
    border-color: rgba(92, 74, 47, 0.5);
    color: #f4ecd8;
}

.zikpic-reader[data-theme="sepia"] .arrow-nav-btn {
    color: rgba(92, 74, 47, 0.6);
}

.zikpic-reader[data-theme="sepia"] .arrow-nav-btn:hover {
    color: rgba(92, 74, 47, 1);
    background: rgba(92, 74, 47, 0.1);
}

/* ==================== TÍTULO DEL EPISODIO (ARRIBA) ==================== */
.reader-title {
position: relative;
    /* top: 10px; */
    /* left: 50%; */
    /* transform: translateX(-50%); */
    background: transparent;
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    z-index: 90;
    pointer-events: none;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
    transition: opacity 0.3s ease;
    /* display: block; */
}

/* ==================== SIDEBAR IZQUIERDO (3 ICONOS) ==================== */
.reader-sidebar-left {
position: absolute;
    left: -60px;
    top: 20px;
    /* transform: translateY(-50%); */
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
}

.sidebar-icon-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.sidebar-icon-btn:hover {
    background: var(--zikpic-gradient);
    border-color: var(--zikpic-green);
    transform: scale(1.1);
}

/* ==================== CONTADOR DE PÁGINAS (DERECHA) ==================== */
.page-counter-right {
    position: absolute;
    right: -80px;
    top: 20px;
    /* transform: translateY(-50%); */
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 18px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 600;
    border: 2px solid rgb(187 187 187 / 50%);
    z-index: 100;
    white-space: nowrap;
}

/* ==================== CONTENEDOR PAGINADO ==================== */
.paginated-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Ocultar scrollbar durante zoom */
.paginated-container.zoom-active {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.paginated-container.zoom-active::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.page-viewer {
    position: relative;
    max-width: calc(100% - 140px);
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    /* margin-bottom: 20px; */
}

.reader-page {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 100vh;
}

.reader-page img.page-image {
    max-width: 100%;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.reader-spread {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 95vh;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 15px 20px rgb(0 0 0 / 70%);
    width: 100%;
}

.reader-spread img.spread-image {
    max-width: 100%;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Centrar cuando solo hay una imagen (página individual) */
.reader-spread.single-page {
    justify-content: center !important;
}

.reader-spread.single-page img {
    margin: 0 auto !important;
}

/* RTL: invertir orden visual de las imágenes dentro del spread */
.reader-spread[data-reading-direction="rtl"] {
    flex-direction: row-reverse;
}


/* ==================== FLECHAS DE NAVEGACIÓN (ALARGADAS, SIN FONDO) ==================== */
.arrow-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: rgba(255,255,255,0.5);
    border: none;
    width: 50px;
    height: 180px; /* Alargadas */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 90;
}

.arrow-nav-btn:hover {
    color: var(--zikpic-green);
    /* background: rgba(0,0,0,0.2); */
}

.arrow-nav-btn:disabled {
    opacity: 0.1;
    cursor: not-allowed;
}

/* Efecto especial cuando hay episodio siguiente/anterior disponible */
.arrow-nav-btn.next-episode-available {
    opacity: 1 !important;
    color: rgba(114, 207, 26, 0.9) !important;
    animation: pulseNextEpisode 1.5s ease-in-out infinite;
    cursor: pointer !important;
}

.arrow-nav-btn.next-episode-available:hover {
    color: rgba(114, 207, 26, 1) !important;
    background: rgba(91, 182, 96, 0.2) !important;
    animation: none;
}

@keyframes pulseNextEpisode {
    0%, 100% {
        transform: translateY(-50%) scale(1);
        opacity: 0.9;
    }
    50% {
        transform: translateY(-50%) scale(1.3);
        opacity: 1;
    }
}

/* Flechas LTR */
.arrow-nav-btn.prev-arrow {
    left: -65px;
}

.arrow-nav-btn.next-arrow {
    right: -65px;
}

/* Flechas RTL (posiciones invertidas) */
.arrow-nav-btn.prev-arrow-rtl {
    right: -65px; /* Prev en RTL avanza, va a la derecha */
}

.arrow-nav-btn.next-arrow-rtl {
    left: -65px; /* Next en RTL retrocede, va a la izquierda */
}

/* Ocultar/mostrar según dirección */
.zikpic-reader[data-reading-direction="ltr"] .rtl-only {
    display: none !important;
}

.zikpic-reader[data-reading-direction="rtl"] .ltr-only {
    display: none !important;
}

/* ==================== PÁGINAS DOBLES (DESKTOP) ==================== */
@media (min-width: 1024px) {
    .page-viewer.double-page-mode {
        gap: 0;
    }
    
    .page-viewer.double-page-mode .reader-page {
        flex: 0 0 auto;
    }
    
    .page-viewer.double-page-mode .reader-page img.page-image {
        max-width: 48vw;
        height: 100vh;
        object-fit: contain;
    }
    
    /* Esquinas redondeadas solo exteriores (LTR) */
    .zikpic-reader[data-reading-direction="ltr"] .page-viewer.double-page-mode .reader-page:first-child img.page-image {
        border-radius: 8px 0 0 8px;
    }
    
    .zikpic-reader[data-reading-direction="ltr"] .page-viewer.double-page-mode .reader-page:last-child img.page-image {
        border-radius: 0 8px 8px 0;
    }
    
    /* RTL */
    .zikpic-reader[data-reading-direction="rtl"] .page-viewer.double-page-mode .reader-page:first-child img.page-image {
        border-radius: 0 8px 8px 0;
    }
    
    .zikpic-reader[data-reading-direction="rtl"] .page-viewer.double-page-mode .reader-page:last-child img.page-image {
        border-radius: 8px 0 0 8px;
    }
    
    .page-viewer.double-page-mode .reader-page:only-child img.page-image {
        border-radius: 8px;
    }
}

/* ==================== BARRA DE PROGRESO PARA CÓMICS PAGINADOS ==================== */
.page-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 150;
}

.page-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #5bb662, #7dd956);
    transition: width 0.3s ease;
    width: 0%;
}

/* Tema sepia para barra de progreso */
.zikpic-reader[data-theme="sepia"] .page-progress-fill {
    background: linear-gradient(90deg, #8b6914, #b8860b);
}

/* ==================== CONTROL DE ZOOM TOGGLE ==================== */
.zoom-toggle-btn {
    position: absolute;
    bottom: 20px;
    right: -80px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid var(--zikpic-secondary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    z-index: 50;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.zoom-toggle-btn:hover {
    background: var(--zikpic-gradient);
    border-color: #5bb662;
    transform: scale(1.1);
}

/* ==================== MODAL DE ZOOM FULLSCREEN ==================== */
.zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.zoom-modal.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.zoom-modal-content {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: auto;
    padding: 60px;
    /* Ocultar scrollbars pero mantener scroll funcional */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.zoom-modal-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.zoom-image-container {
    display: flex;
    flex-direction: row;
    gap: 0;
    cursor: grab;
    user-select: none;
    min-width: min-content;
    min-height: min-content;
    border-radius: 10px;
    overflow: hidden;
    margin: auto; /* Centrar horizontal y verticalmente */
    justify-content: center;
    width: fit-content;
}

/* RTL: invertir orden de imágenes en zoom */
.zikpic-reader[data-reading-direction="rtl"] .zoom-image-container {
    flex-direction: row-reverse;
}

.zoom-image-container.dragging {
    cursor: grabbing;
}

.zoom-image-container img {
    display: block;
    max-width: none;
    max-height: none;
    height: auto;
    pointer-events: none;
}

.zoom-close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.zoom-close-btn:hover {
    background: rgba(220, 53, 69, 0.9);
    border-color: #dc3545;
    transform: scale(1.1);
}

/* ==================== BARRA INFERIOR MÓVIL ==================== */
.mobile-bottom-bar {
    display: none; /* Oculto en desktop */
}

/* ==================== MODAL DE MINIATURAS ==================== */
.thumbnails-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
    display: none;
    overflow-y: auto;
    padding: 80px 20px 20px;
}

.thumbnails-modal.active {
    display: block;
}

.thumbnails-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.9);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1001;
    backdrop-filter: blur(10px);
}

.thumbnails-header h3 {
    color: white;
    margin: 0;
    font-size: 18px;
}

.thumbnails-close {
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
}

.thumbnails-close:hover {
    background: rgba(255,0,0,0.8);
    transform: rotate(90deg);
}

.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    max-width: 1400px;
    margin: 20px auto;
}

/* Por defecto en DESKTOP: Mostrar grid agrupado, ocultar grid individual */
.thumbnails-grid-desktop {
    display: grid;
}

.thumbnails-grid-mobile {
    display: none;
}

/* En MOBILE (≤1080px): Mostrar grid individual, ocultar grid agrupado */
@media (max-width: 1080px) {
    .thumbnails-grid-desktop {
        display: none;
    }
    
    .thumbnails-grid-mobile {
        display: grid;
    }
}

/* RTL: Invertir dirección del grid */
.thumbnails-grid[data-reading-direction="rtl"] {
    direction: rtl;
}

.thumbnail-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background: #2a2a2a;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

/* Miniaturas simples (una imagen) */
.thumbnail-item.thumbnail-single {
    display: block;
}

.thumbnail-item.thumbnail-single img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

/* Miniaturas dobles (dos imágenes lado a lado) */
.thumbnail-item.thumbnail-double {
    display: flex;
    gap: 2px;
    grid-column: span 2; /* Ocupa dos columnas en el grid */
}

.thumbnail-item.thumbnail-double .thumbnail-page {
    position: relative;
    width: 50%;
    overflow: hidden;
}

.thumbnail-item.thumbnail-double img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

/* Contenedor de página individual dentro de un spread */
.thumbnail-page {
    position: relative;
}

/* Badge de número de página sobre cada imagen */
.thumbnail-page-label {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    z-index: 2;
    pointer-events: none;
}

.thumbnail-page-label.label-cover {
    background: rgba(255, 107, 53, 0.95);
    letter-spacing: 1px;
}

/* Portada (destacar visualmente) */
.thumbnail-item.thumbnail-cover {
    border-color: #ff6b35;
}

.thumbnail-item.thumbnail-cover .thumbnail-label {
    background: linear-gradient(to top, rgba(255, 107, 53, 0.9), transparent);
}

.thumbnail-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--zikpic-dark-green);
    border-color: #bfb620;
}

.thumbnail-item.current {
    border-color: var(--zikpic-green);
    box-shadow: 0 0 20px var(--zikpic-dark-green);
}

.thumbnail-item img {
    width: 100%;
    /* height: 250px; */
    object-fit: cover;
    display: block;
}

/* Badge en la parte inferior (deprecado, ahora se usa thumbnail-page-label) */
.thumbnail-item .thumbnail-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    display: none; /* Oculto porque ahora usamos thumbnail-page-label */
}

.thumbnail-item .thumbnail-label.label-cover {
    background: linear-gradient(to top, rgba(255, 107, 53, 0.9), transparent);
    font-weight: 700;
    letter-spacing: 1px;
    display: none; /* Oculto porque ahora usamos thumbnail-page-label */
}

/* ==================== MODO WEBTOON (SCROLL VERTICAL) ==================== */
.webtoon-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 0 20px;
}

.webtoon-page {
    margin-bottom: 0;
    background: #0a0a0a;
}

/* Separación entre páginas cuando GAP está activado */
.webtoon-page.with-gap {
    margin-bottom: 60px;
    border-radius: 10px;
    overflow: hidden;
}

.webtoon-page img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
}

/* ==================== TRANSICIONES ==================== */
.reader-page {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==================== RESPONSIVE MOBILE ==================== */
/* ==================== RESPONSIVE: 1080px - 1420px (Spreads dobles escalados) ==================== */
@media (min-width: 1081px) and (max-width: 1420px) {
    /* Ocultar flechas laterales */
    .arrow-nav-btn {
        display: none !important;
    }
    
    /* Ajustar viewer para que spreads dobles quepan */
    .page-viewer {
        max-width: 100%;
        max-height: 95vh;
    }
    
    .reader-spread {
        max-height: 95vh;
        width: auto;
        height: auto;
    }
    
    .reader-spread img.spread-image {
        max-height: 95vh;
        width: auto;
        height: auto;
        object-fit: contain;
    }
    
    /* Sidebar y contador siguen visibles */
/*     .reader-sidebar-left {
         display: none !important;
    }
    
    .page-counter-right {
         display: none !important;
    }
    
    .zoom-toggle-btn {
         display: none !important;
    } */
    
    /* Ocultar páginas individuales mobile */
/*     .reader-page-mobile {
        display: none !important;
    } */
    
    /* Mobile bar oculta */
/*     .mobile-bottom-bar {
        display: none !important;
    } */
}

/* ==================== RESPONSIVE: <= 1080px (Modo página simple + Mobile UI) ==================== */
@media (max-width: 1080px) {
    /* Ocultar elementos desktop */
    .reader-sidebar-left,
    .page-counter-right,
    .arrow-nav-btn,
    .reader-title {
        display: none !important;
    }
    
    /* Imagen a pantalla completa */
    .paginated-container {
        padding: 0;
        /* ✅ Altura calculada: 100dvh menos altura de controles móviles */
        height: calc(100dvh - 84px);
        /* ✅ Contenedor del viewer */
        display: block;
        /* ✅ Importante: ocultar overflow para evitar scroll */
        overflow: hidden;
        position: relative;
    }
    
    .page-viewer {
        width: 100%;
        /* ✅ Ocupa el 100% de su contenedor (ya calculado como 100dvh - 84px) */
        height: 100%;
        max-width: 100%;
        /* ✅ Flex para centrado y funcionalidad */
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        position: relative;
        padding: 0;
    }
    
    /* OCULTAR spreads en mobile, mostrar solo páginas individuales */
    .reader-spread {
        display: none !important;
    }
    
    /* ✅ Páginas individuales estilo slider optimizado */
    .reader-page-mobile,
    .reader-page {
        width: 100%;
        height: 100%;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 0;
        left: 0;
        /* ✅ Ocultar páginas no activas por defecto */
        display: none;
    }

    /* ✅ Mostrar solo la página activa */
    .reader-page-mobile.active,
    .reader-page.active {
        display: flex !important;
        z-index: 1;
    }

    /* Mostrar páginas individuales mobile */
    .reader-page-mobile img.page-image,
    .reader-page img.page-image {
        width: auto;
        max-width: 100%;
        height: auto;
        /* ✅ Altura máxima del 100% del contenedor */
        max-height: 100%;
        object-fit: contain;
        border-radius: 0px;
    }    /* ==================== BARRA INFERIOR MÓVIL ==================== */
    .mobile-bottom-bar {
        display: block !important;
        position: relative;
        width: 100%;
        z-index: 200;
        background: rgb(10 10 10);
        padding: 0;
    }
    
    /* ✅ Mostrar controles móviles siempre extendidos */
    .mobile-controls {
        transform: translateY(0) !important;
        display: flex !important;
        position: relative !important;
        background: rgb(10 10 10);
        backdrop-filter: blur(10px);
        padding: 12px 10px;
        height: 84px;
        box-sizing: border-box;
        align-items: center;
        justify-content: center;
        gap: 15px;
    }
    
    /* ✅ Ocultar botón toggle completamente */
    .mobile-toggle-btn {
        display: none !important;
    }
    
    /* ✅ Ocultar barra fuera del visor (solo mostrar en reader.php) */
    body:not(.reader-body) .mobile-bottom-bar {
        display: none !important;
    }
    
    /* ✅ Código de toggle obsoleto eliminado - ahora siempre visible */
    
    .mobile-control-btn {
        background: var(--comment-text);
        border: 2px solid rgba(255, 255, 255, 0.2);
        color: white;
        padding: 12px 16px;
        border-radius: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 16px;
        min-width: 50px;
    }
    
    .mobile-control-btn span {
        font-size: 11px;
        font-weight: 600;
    }
    
    .mobile-control-btn:hover,
    .mobile-control-btn:active {
        background: var(--zikpic-gradient);
        border-color: var(--zikpic-green);
    }
    
    .mobile-page-counter {
        background: rgb(91 159 38 / 30%);
        border: 2px solid var(--zikpic-dark-green);
        color: white;
        padding: 12px 20px;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 700;
        min-width: 75px;
        text-align: center;
    }
    
    /* Miniaturas grid mobile */
    .thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .thumbnail-item img {
        height: 200px;
    }
}

/* ==================== TABLET ==================== */
@media (min-width: 769px) and (max-width: 1023px) {
/*     .reader-sidebar-left {
        left: 10px;
    }
    
    .page-counter-right {
        right: 10px;
    }
     
    .arrow-nav-btn.prev-arrow {
        left: 60px;
    }
    
    .arrow-nav-btn.next-arrow {
        right: 60px;
    }
    
    .sidebar-icon-btn {
        width: 42px;
        height: 42px;
        font-size: 17px;
    }*/
}

/* ==================== MENSAJE DE PÁGINAS VACÍAS ==================== */
.no-pages-message {
    text-align: center;
    padding: 100px 20px;
    color: #888;
}

.no-pages-message i {
    font-size: 64px;
    margin-bottom: 20px;
    color: #555;
}

.no-pages-message h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #aaa;
}

.no-pages-message p {
    font-size: 16px;
    color: #777;
}

/* ==================== BARRA SELECTOR DE EPISODIOS ==================== */
.episode-selector-bar {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    padding: 15px 25px;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 150;
    animation: slideUpFadeIn 0.3s ease;
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.episode-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.episode-nav-btn:hover:not(:disabled) {
    background: var(--zikpic-gradient);
    border-color: var(--zikpic-green);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(34, 197, 94, 0.3);
}

.episode-nav-btn:disabled,
.episode-nav-btn.disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    background: rgba(50, 50, 50, 0.5) !important;
    pointer-events: none;
}

.episode-nav-btn i {
    font-size: 12px;
}

/* ==================== INDICADOR DE TRANSICIÓN DE EPISODIO ==================== */
.episode-transition-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(34, 197, 94, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-radius: 30px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    z-index: 140;
    animation: pulseGlow 0.8s ease infinite;
    pointer-events: none;
    box-shadow: 0 5px 20px rgba(34, 197, 94, 0.5);
}

@keyframes pulseGlow {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.9;
    }
}

.hint-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hint-text::before {
    content: '→';
    font-size: 18px;
    animation: arrowBounce 0.8s ease infinite;
}

@keyframes arrowBounce {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(5px);
    }
}

/* ==================== MODAL DE INFORMACIÓN DEL EPISODIO ==================== */
/* ==================== MODAL DE INFORMACIÓN (DISEÑO V1) ==================== */
.episode-info-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
    border-radius: 25px;
    padding: 40px;
    max-width: 550px;
    width: 90%;
    z-index: 200;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.info-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    color: #666;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.info-modal-close:hover {
    background: rgba(255, 59, 48, 0.8);
    color: white;
    transform: rotate(90deg);
}

.modal-title {
    color: #1a1a1a;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 20px;
    text-align: left;
}

.info-modal-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.episode-details {
    background: white;
    border-left: 4px solid #22c55e;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-weight: 700;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    color: #1a1a1a;
    font-weight: 600;
}

.detail-value a {
    color: #22c55e;
    text-decoration: none;
    font-weight: 700;
}

.detail-value a:hover {
    text-decoration: underline;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #22c55e;
}

.author-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-name {
    color: #1a1a1a;
    font-weight: 600;
    font-size: 13px;
}

.author-username {
    color: #22c55e;
    font-size: 12px;
    text-decoration: none;
}

.author-username:hover {
    text-decoration: underline;
}

.genres-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.genre-tag {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

/* Botones Like y Compartir */
.buttons-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-like,
.btn-share {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-like {
    background: linear-gradient(135deg, #ff1744 0%, #ff4569 100%);
    box-shadow: 0 4px 12px rgba(255, 23, 68, 0.3);
}

.btn-like:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 23, 68, 0.4);
}

.btn-like.liked {
    background: linear-gradient(135deg, #c41230 0%, #ff1744 100%);
}

.btn-like.liked i {
    animation: heartBeat 0.5s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
    75% { transform: scale(1.2); }
}

.btn-share {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.4);
}

/* Sección de Reacciones */
.reactions-label {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    font-weight: 700;
}

.reactions-grid {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    margin-bottom: 20px;
}

.reaction-btn {
    width: 65px;
    height: 65px;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.reaction-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    border-color: #22c55e;
}

.reaction-btn.active {
    border-color: #22c55e;
    box-shadow: 0 5px 15px rgba(34, 197, 94, 0.3);
}

.reaction-btn .emoji {
    font-size: 32px;
    line-height: 1;
}

.reaction-btn .count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 3px 10px rgba(34, 197, 94, 0.4);
}

/* ==================== MODAL DE VISTA 3D (FLIPBOOK) ==================== */
.flipbook-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.flipbook-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Ocultar header - ya no se usa */
.flipbook-header {
    display: none;
}

/* Botón de cierre flotante estilo Zikpic - Arriba derecha */
.flipbook-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid var(--zikpic-green, #22c55e);
    color: var(--zikpic-green, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 22px;
    z-index: 10001;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
}

.flipbook-close:hover {
    background: var(--zikpic-green, #22c55e);
    color: white;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 30px rgba(34, 197, 94, 0.6);
}

/* Ícono de libro 3D - Arriba izquierda */
.flipbook-icon {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid var(--zikpic-green, #22c55e);
    color: var(--zikpic-green, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    z-index: 10001;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
    pointer-events: none;
}

.flipbook-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.flipbook {
    margin: 0 auto;
    position: relative;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
    background: transparent;
}

/* Páginas de turn.js */
.flipbook .turn-page {
    background-color: white !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Sombra entre páginas para efecto 3D */
.flipbook .page-wrapper,
.flipbook .hard {
    background-color: white;
    box-shadow: inset -7px 0 25px rgba(0, 0, 0, 0.3), 
                inset 7px 0 25px rgba(0, 0, 0, 0.3);
}

/* Sombra del pliegue cuando se voltea la página */
.flipbook .shadow {
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%);
}

/* Efecto de gradiente en el borde de la página */
.flipbook .gradient {
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 100%);
}

/* Página volteándose */
.flipbook .own-size {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8) !important;
}

/* Asegurar que las esquinas sean visibles e interactivas */
.flipbook .turn-page-wrapper {
    cursor: pointer;
}

.flipbook .turn-page:hover {
    cursor: grab;
}

.flipbook .turn-page:active {
    cursor: grabbing;
}

/* Indicador visual sutil para las esquinas interactivas */
.flipbook::before,
.flipbook::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
    border: 3px solid var(--zikpic-green, #22c55e);
    border-radius: 8px;
}

.flipbook::before {
    top: 10px;
    right: 10px;
    border-left: none;
    border-bottom: none;
}

.flipbook::after {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
}

.flipbook:hover::before,
.flipbook:hover::after {
    opacity: 0.3;
}

/* Asegurar que el contenedor permita interacción */
.flipbook-container {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* Mejorar visibilidad de la página volteándose */
.flipbook .p1,
.flipbook .p2,
.flipbook .p3,
.flipbook .p4 {
    background-color: white !important;
}

.flipbook-page {
    background: white;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.flipbook-page img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Ocultar controles inferiores - turn.js tiene navegación integrada */
.flipbook-controls {
    display: none;
}

/* Indicador de página - Debajo del ícono de libro */
.flipbook-page-indicator {
    position: fixed;
    top: 85px;
    left: 20px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    padding: 10px 18px;
    border-radius: 25px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    border: 2px solid var(--zikpic-green, #22c55e);
    z-index: 10001;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
    pointer-events: none;
}

.flipbook-page-indicator span {
    color: var(--zikpic-green, #22c55e);
}

/* Responsive para vista 3D */
@media (max-width: 1080px) {
    .flipbook {
        height: 90vh;
    }
    
    .flipbook-container {
        padding: 10px;
    }
    
    .flipbook-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
        top: 15px;
        left: 15px;
    }
    
    .flipbook-close {
        width: 45px;
        height: 45px;
        font-size: 20px;
        top: 15px;
        right: 15px;
    }
    
    .flipbook-page-indicator {
        font-size: 13px;
        padding: 8px 16px;
        top: 70px;
        left: 15px;
    }
}
