/* readers.css - Estilos unificados para reader.php y reader-novel.php */

:root {
    --zikpic-green: #81d742;
    --zikpic-gradient: linear-gradient(to right, #81d742 40%, #3ac403);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #fdfdfd;
    color: white;
    overflow-x: hidden;
}

/* ===== HEADER DEL READER ===== */
.reader-header {
    background: rgba(0,0,0,0.9);
    padding: 15px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: transform 0.3s;
}

.reader-header.hidden {
    transform: translateY(-100%);
}

.reader-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reader-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.reader-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.control-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.control-btn:hover {
    background: var(--zikpic-green);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== CONTENIDO DEL READER ===== */

.novel-reader-container{
    background: #1a1a1a;
    display: flex;
}
.reader-content {
    padding-top: 80px;
    padding-bottom: 50px;
    text-align: center;
    background-color: #1a1a1a;
}

/* Estilos específicos para reader-novel.php */
.reader-content.novel-reader {
    text-align: left;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== CONTENIDO DE NOVELA ===== */
.novel-content {
    font-family: 'Crimson Text', serif;
    font-size: 1.23em;
    line-height: 1.7;
    background: #fff;
    color: #181a1b;
    padding: 2em;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    min-height: 60vh;
}

.novel-content img {
    max-width: 100%;
    height: auto !important;
    display: block;
    margin: 1.5em auto;
    border-radius: 8px;
    box-shadow: 0 2px 12px #0002;
}

.novel-content h1, .novel-content h2, .novel-content h3, .novel-content h4 {
    color: #222;
    font-family: 'Crimson Text', serif;
    font-weight: 700;
}

.novel-content p {
    margin-bottom: 1.2em;
}

.novel-content blockquote {
    border-left: 4px solid #81d742;
    background: #f7f7f7;
    color: #333;
    margin: 1.5em 0;
    padding: 1em 1.5em;
    border-radius: 6px;
}

.novel-content ul, .novel-content ol {
    margin-left: 2em;
}

.novel-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}

.novel-content th, .novel-content td {
    border: 1px solid #ddd;
    padding: 0.5em 1em;
}

.novel-content pre, .novel-content code {
    background: #f3f3f3;
    color: #222;
    border-radius: 4px;
    padding: 0.2em 0.5em;
}

/* Permitir videos y iframes responsivos */
.novel-content iframe,
.novel-content video,
.novel-content embed {
    display: block;
    max-width: 100%;
    margin: 2em auto;
    border-radius: 8px;
    box-shadow: 0 2px 12px #0002;
    background: #000;
}

.novel-content figure {
    margin: 1.5em auto;
    text-align: center;
}

.novel-content figcaption {
    color: #888;
    font-size: 0.98em;
    margin-top: 0.5em;
}

/* CKEditor estilos básicos */
.novel-content .ck-content {
    font-family: 'Crimson Text', serif;
    font-size: 1.18em;
    color: #181a1b;
}

/* ===== PÁGINAS DE CÓMIC (READER.PHP) ===== */
.page-image {
    max-width: 800px;
    margin: auto;
    height: auto;
    margin-bottom: 20px;
    border-radius: 8px;
}

.page-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

.no-pages-message {
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    margin: 50px auto;
    max-width: 600px;
    padding: 50px 30px;
}

.no-pages-message i {
    font-size: 4rem;
    color: var(--zikpic-green);
    margin-bottom: 20px;
}

.no-pages-message h3 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.no-pages-message p {
    color: rgba(255,255,255,0.8);
    font-size: 1.1rem;
}

.page-info {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 0.9rem;
}

/* ===== NAVEGACIÓN ===== */
.navigation-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.9);
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.navigation-overlay.show {
    transform: translateY(0);
}

.nav-btn {
    background: var(--zikpic-gradient);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.nav-btn:hover {
    transform: translateY(-2px);
}

.nav-btn:disabled {
    background: #666;
    cursor: not-allowed;
}

/* ===== BARRA DE PROGRESO ===== */
#scrollProgressBar {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 0;
    height: 4px;
    background: #81d742;
    z-index: 9999;
    transition: width 0.2s;
    box-shadow: 0 2px 8px #81d74280;
    border-radius: 0 8px 8px 0;
}

/* ===== MODOS DE LECTURA (WEBTOON/VERTICAL) ===== */
/* Modo de lectura vertical (webtoon) */
.vertical-reader .page-image {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 0 auto;
}
.vertical-reader .page-image img {
    border-radius: 0px !important;
}

/* Sobrescribir estilos base para webtoons */
.webtoon-reader .vertical-reader .page-image {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* Estilos específicos para webtoons - Solo eliminar espacios entre imágenes */
.webtoon-spacing .page-image {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    display: flex;
    justify-content: center;
    border-radius: 0 !important;
}

.webtoon-spacing .page-image img {
    margin: 0 auto !important;
    display: block;
    border-radius: 0 !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .reader-content.novel-reader {
        max-width: 98vw;
    }
    
    .novel-content {
        padding: 1em;
    }
}

@media (max-width: 768px) {
    .reader-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .reader-controls {
        gap: 10px;
    }
    
    .control-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}
#novel-content-container {
    width: 90%;
    margin: 5rem auto;
    max-width: 900px;
}