/* Reader v2.0 - Componentes Reutilizables */

/* Chapter Next Button - Consistente con el diseÃ±o de la web */
.chapter-next-button {
    position: fixed;
    bottom: 90px; /* Justo arriba de la barra de navegaciÃ³n (altura ~70px + margen) */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.chapter-next-button.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* BotÃ³n con estilo consistente de la web */
.chapter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    background-color: #27272a; /* zinc-800 */
    border-radius: 0.375rem; /* rounded-md */
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 44px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.chapter-btn:hover {
    background-color: #3f3f46; /* zinc-700 */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Variante para serie terminada */
.floating-series-end {
    background-color: #dc2626; /* red-600 */
}

.floating-series-end:hover {
    background-color: #b91c1c; /* red-700 */
}

/* WEBTOON Mode - Estilos base (posicionamiento especÃ­fico en media queries) */
.webtoon-mode .chapter-next-button.visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.webtoon-mode .chapter-btn {
    width: auto;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    border-radius: 24px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive - MÃ³vil */
@media (max-width: 768px) {
    .chapter-next-button {
        bottom: 80px; /* Para modo manga */
        left: 1rem;
        right: 1rem;
        transform: none;
    }
    
    .chapter-next-button.visible {
        transform: translateY(0);
    }
    
    .chapter-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    /* WEBTOON mÃ³vil - DEBE IR AL FINAL para override */
    .webtoon-mode .chapter-next-button {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 16px) !important;
        right: 72px !important; /* 16px + 48px + 8px = 72px desde el borde */
        left: auto !important;
        width: auto !important;
        transform: none !important;
    }
    
    .webtoon-mode .chapter-btn {
        width: auto;
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* Responsive - Tablet */
@media (min-width: 769px) and (max-width: 1023px) {
    .chapter-next-button {
        bottom: 85px;
    }
    
    /* WEBTOON Tablet - override para tablet */
    .webtoon-mode .chapter-next-button {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
        right: 80px; /* Mismo cÃ¡lculo que desktop */
        left: auto;
        transform: none;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .chapter-next-button {
        bottom: 90px;
    }
    
    .chapter-btn {
        font-size: 0.875rem;
        padding: 0.75rem 1.25rem;
    }
    
    /* WEBTOON Desktop - DEBE IR DESPUÃ‰S para override */
    .webtoon-mode .chapter-next-button {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
        right: 80px; /* 20px + 48px + 12px = 80px desde el borde */
        left: auto;
        transform: none;
    }
}

.prompt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.prompt-content {
    position: relative;
    background: #1a1a1a;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.prompt-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.prompt-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.series-name {
    font-size: 1rem;
    color: #ccc;
    opacity: 0.8;
}

.prompt-body {
    margin-bottom: 2rem;
}

.next-chapter-info h4,
.series-completed h4,
.no-next-chapter h4 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: #4ecdc4;
}

.chapter-preview {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.75rem;
}

.chapter-number {
    font-weight: 600;
    color: #fff;
    display: block;
    margin-bottom: 0.25rem;
}

.chapter-title {
    color: #ccc;
    display: block;
    margin-bottom: 0.25rem;
    font-style: italic;
}

.chapter-pages {
    color: #999;
    font-size: 0.9rem;
}

.series-completed,
.no-next-chapter {
    text-align: center;
    padding: 1rem;
}

.prompt-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem; /* âœ… MISMO TAMAÃ‘O QUE page-info PARA CONSISTENCIA */
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    min-height: 30px; /* Mobile touch target - reducido 30% desde 44px */
    box-sizing: border-box;
}

.btn-primary {
    background: #4ecdc4;
    color: #000;
}

.btn-primary:hover {
    background: #45b7aa;
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-tertiary {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.btn-tertiary:hover {
    background: rgba(255, 107, 107, 0.2);
}

/* Chapter Navigation Buttons */
.chapter-navigation-buttons {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    z-index: 1500;
}

.btn-nav {
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    min-height: 44px;
    display: flex;
    align-items: center;
}

.btn-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: #4ecdc4;
}

/* Social Share Section */
.social-share-section {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.share-text {
    margin-bottom: 1rem;
    color: #ccc;
    font-size: 0.9rem;
}

/* Mobile adjustments - MUST GO FIRST */
@media (max-width: 768px) {
    .btn {
        font-size: 0.8rem; /* âœ… MISMO TAMAÃ‘O QUE page-info MÃ“VIL PARA CONSISTENCIA */
    }
}

/* Tablet adjustments */
@media (min-width: 768px) {
    .prompt-content {
        max-width: 500px;
        padding: 2.5rem 2rem;
    }
    
    .prompt-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .btn {
        flex: 1;
        max-width: 200px;
    }
    
    .chapter-navigation-buttons {
        bottom: 3rem;
    }
}

/* Desktop adjustments */
@media (min-width: 1024px) {
    .prompt-content {
        max-width: 600px;
    }
    
    .chapter-navigation-buttons {
        position: fixed;
        top: 50%;
        left: 2rem;
        right: 2rem;
        transform: translateY(-50%);
        justify-content: space-between;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .btn-nav {
        position: relative;
    }
    
    .btn-previous {
        left: 0;
    }
    
    .btn-next {
        right: 0;
    }
}

/* Efectos de transiciÃ³n comunes para componentes */
.component-transition {
    transition: all 0.3s ease;
}

.component-fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading states */
.preloading {
    opacity: 0.7;
}

.preload-indicator {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: rgba(78, 205, 196, 0.1);
    color: #4ecdc4;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preload-indicator.visible {
    opacity: 1;
}