/* Manga Viewer - Frontend Styles */

/* Índice de capítulos */
.manga-index-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.manga-index-header {
    text-align: center;
    margin-bottom: 40px;
}

.manga-index-header h1 {
    font-size: 36px;
    margin-bottom: 10px;
    color: #333;
}

.manga-no-chapters {
    text-align: center;
    padding: 60px 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.manga-no-chapters p {
    font-size: 18px;
    color: #666;
}

.manga-chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.manga-chapter-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.manga-chapter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.chapter-card-content {
    padding: 20px;
}

.chapter-title {
    font-size: 20px;
    margin: 0 0 12px 0;
    color: #222;
    line-height: 1.4;
}

.chapter-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.chapter-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.chapter-pages,
.chapter-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.chapter-read-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    background: #2271b1;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s;
    border: none;
}

.chapter-read-btn:hover {
    background: #135e96;
    color: #fff;
}

/* Lector de manga */
.manga-reader-container {
    max-width: 100%;
    margin: 0 auto;
}

.manga-reader-header {
    background: #fff;
    border-bottom: 2px solid #e0e0e0;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.reader-header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.reader-title {
    font-size: 24px;
    margin: 0;
    color: #222;
}

.reader-controls {
    display: flex;
    gap: 10px;
}

.view-mode-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.view-mode-btn:hover {
    background: #135e96;
}

#fullscreen-toggle {
    padding: 10px 15px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

#fullscreen-toggle:hover {
    background: #e0e0e0;
}

.reader-navigation {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s;
    border: 1px solid #ddd;
}

.nav-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.back-to-index {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.back-to-index:hover {
    background: #135e96;
    color: #fff;
}

/* Contenido del lector */
.manga-reader-content {
    background: #1a1a1a;
    min-height: 600px;
    position: relative;
}

.no-pages-message {
    text-align: center;
    padding: 100px 20px;
    color: #ccc;
}

/* Modo Cascada */
.cascade-mode {
    display: none;
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px;
}

.cascade-mode.active {
    display: block;
}

.manga-page-wrapper {
    margin-bottom: 20px;
    position: relative;
}

.manga-page {
    width: 100%;
    height: auto;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.manga-page-wrapper .page-number {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

/* Modo Doble Página */
.double-page-mode {
    display: none;
    position: relative;
    padding: 30px 80px;
    min-height: 600px;
}

.double-page-mode.active {
    display: block;
}

.double-page-container {
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
}

.double-page-spread {
    display: none;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
    min-height: 600px;
}

.double-page-spread.active {
    display: flex;
}

.page-side {
    flex: 0 0 48%;
    max-width: 800px;
    position: relative;
}

.manga-page-double {
    width: 100%;
    height: auto;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.page-side .page-number {
    position: absolute;
    bottom: 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.page-left .page-number {
    right: 10px;
}

.page-right .page-number {
    left: 10px;
}

/* Botones de navegación de doble página */
.page-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.page-nav-btn:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.page-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.prev-page {
    left: 20px;
}

.next-page {
    right: 20px;
}

.page-nav-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

/* Indicador de páginas */
.page-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

/* Footer del lector */
.manga-reader-footer {
    background: #fff;
    border-top: 2px solid #e0e0e0;
    padding: 20px;
}

.manga-reader-footer .reader-navigation {
    max-width: 1400px;
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 1024px) {
    .manga-chapters-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .reader-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .reader-title {
        font-size: 20px;
    }
    
    .double-page-mode {
        padding: 20px 60px;
    }
    
    .page-nav-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 768px) {
    .manga-index-container {
        padding: 15px;
    }
    
    .manga-chapters-grid {
        grid-template-columns: 1fr;
    }
    
    .reader-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cascade-mode {
        padding: 20px 10px;
    }
    
    .double-page-mode {
        padding: 20px 50px;
    }
    
    .double-page-spread {
        flex-direction: column;
        gap: 20px;
    }
    
    .page-side {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .reader-title {
        font-size: 18px;
    }
    
    .reader-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .view-mode-btn,
    #fullscreen-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .double-page-mode {
        padding: 20px 40px;
    }
    
    .page-nav-btn {
        width: 35px;
        height: 35px;
    }
    
    .prev-page {
        left: 10px;
    }
    
    .next-page {
        right: 10px;
    }
}
