/* ============================================================
   READ.CSS - Core Reading Engine (Luxury Edition)
   ============================================================ */

/* --- CORE PAGE STYLES --- */
.reader-page {
    background-image: none !important;
    transition: background 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

/* Themes Logic */
.theme-light { background-color: #ffffff !important; color: #1a1a1a !important; }
.theme-sepia { background-color: #f4ecd8 !important; color: #433422 !important; }
.theme-dark  { background-color: #0c0f16 !important; color: #f5f7ff !important; }

/* Layout & Container */
.wattpad-layout { 
    padding-top: 100px; 
    min-height: 100vh; 
}

.reading-container {
    max-width: 720px; /* The perfect width for digital reading */
    margin: 0 auto;
    padding: 0 25px 120px 25px;
    position: relative;
}

/* --- TYPOGRAPHY --- */
.book-title-display { 
    font-family: 'Quentin', cursive; 
    color: #f8d061 !important; 
    font-size: 3.2rem; 
    margin-bottom: 5px; 
}

.chapter-number { 
    font-family: 'League Spartan', sans-serif; 
    text-transform: uppercase; 
    letter-spacing: 4px; 
    font-size: 0.85rem; 
    opacity: 0.5; 
}

.wattpad-text { 
    font-family: 'EB Garamond', serif; 
    line-height: 1.95; /* Airy spacing for readability */
    margin-top: 50px;
    font-size: 20px; /* Default size */
}

.wattpad-text p { 
    margin-bottom: 2.2rem; 
}

/* Scene Divider (***) */
.scene-divider {
    text-align: center;
    font-size: 2rem;
    color: #f8d061;
    margin: 60px 0;
    letter-spacing: 15px;
    opacity: 0.6;
}

/* --- SYSTEM LOGS (Sci-Fi / Classified) --- */
.reader-log {
    font-family: 'Courier New', Courier, monospace;
    background: rgba(248, 208, 97, 0.04);
    padding: 25px;
    border-left: 3px solid #f8d061;
    margin: 45px 0;
    font-size: 0.9em;
    color: #f8d061;
    line-height: 1.6;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2);
}

.log-cursor {
    font-weight: bold;
    margin-right: 5px;
    animation: blink 1s infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* --- UI ELEMENTS (Progress, Buttons) --- */
.progress-container { 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 4px; 
    z-index: 2100; 
    background: rgba(255,255,255,0.05); 
}

.progress-bar { 
    height: 100%; 
    background: linear-gradient(90deg, #f8d061, #e6a843); 
    width: 0%; 
    transition: width 0.2s; 
}

/* FAB BUTTONS (Floating Action Buttons) */
.reader-settings-fab, .reader-toc-fab {
    position: fixed; 
    bottom: 40px; 
    width: 55px; height: 55px;
    background: #f8d061; 
    color: #111; 
    border: none; 
    border-radius: 50%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); 
    z-index: 2001; 
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reader-settings-fab { right: 30px; }
.reader-toc-fab { left: 30px; }

.reader-settings-fab:hover, .reader-toc-fab:hover { 
    transform: scale(1.15) rotate(15deg); 
    background: #fff;
    box-shadow: 0 0 20px #f8d061;
}

/* Settings Menu Card */
.settings-card {
    position: fixed; 
    bottom: 110px; 
    right: 30px; 
    width: 280px;
    background: #fff; 
    color: #333; 
    border-radius: 15px; 
    padding: 25px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.6); 
    z-index: 2000;
}

.setting-label { 
    font-family: 'League Spartan'; 
    font-size: 0.75rem; 
    font-weight: 800; 
    color: #999; 
    margin-bottom: 15px; 
    letter-spacing: 1px;
}

.theme-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.t-btn { 
    border: 1px solid #eee; 
    padding: 12px 0; 
    font-size: 10px; 
    font-weight: bold; 
    border-radius: 8px; 
    cursor: pointer; 
}
.t-btn.white { background: #fff; color: #333; }
.t-btn.sepia { background: #f4ecd8; color: #5b4636; }
.t-btn.dark  { background: #222; color: #eee; border-color: #444; }

/* --- TABLE OF CONTENTS (SIDEBAR) --- */
.modal.left .modal-dialog {
    position: fixed;
    margin: auto;
    width: 320px;
    height: 100%;
    left: -320px;
    transition: left 0.4s ease-in-out;
}

.modal.left.show .modal-dialog { left: 0; }

.toc-link {
    display: flex;
    align-items: center;
    padding: 20px 25px;
    color: #eef2fb;
    text-decoration: none !important;
    font-family: 'Andarilho', sans-serif;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: all 0.2s;
    font-size: 0.95rem;
}

.toc-link:hover { 
    background: rgba(248, 208, 97, 0.1); 
    color: #f8d061; 
    padding-left: 30px;
}

.toc-link.active {
    background: rgba(248, 208, 97, 0.12);
    border-left: 4px solid #f8d061;
    color: #f8d061;
    font-weight: bold;
}

/* --- COMMENTS (THEORY LAB) --- */
.comments-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.comment-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px 0;
}

.comment-user {
    color: #f8d061;
    font-weight: 700;
    font-family: 'League Spartan', sans-serif;
    font-size: 0.9rem;
}

.comment-text {
    font-family: 'Andarilho', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(238, 242, 251, 0.85);
    margin-top: 5px;
}

/* --- FOOTER NAV --- */
/* Centered Bottom Nav - FIX ALIGNEMENT */
/* --- FOOTER NAVIGATION (FLÈCHES) --- */
.reader-footer-nav {
    display: flex; 
    justify-content: center; 
    align-items: center;
    margin-top: 80px; 
    padding: 60px 0; 
    border-top: 1px solid rgba(248, 208, 97, 0.1); /* Petite ligne dorée discrète */
    width: 100%;
}

.nav-control-group { 
    display: flex !important; 
    flex-direction: row !important; 
    align-items: center; 
    justify-content: center;
    gap: 40px; /* Plus d'espace pour laisser respirer le texte */
}

/* LE BOUTON ROND DORÉ */
.nav-round-btn {
    width: 55px; 
    height: 55px; 
    border-radius: 50% !important; /* Force le cercle parfait */
    background: linear-gradient(135deg, #f8d061, #f29c38) !important;
    border: none !important;
    color: #111 !important; /* Icône noire pour le contraste */
    display: flex; 
    align-items: center; 
    justify-content: center;
    cursor: pointer; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    padding: 0;
    outline: none !important;
}

/* EFFET AU SURVOL */
.nav-round-btn:hover:not(:disabled) { 
    background: #fff !important; 
    transform: translateY(-5px); 
    box-shadow: 0 0 20px rgba(248, 208, 97, 0.6);
}

/* ÉTAT DÉSACTIVÉ (ex: pas de chapitre précédent) */
.nav-round-btn:disabled { 
    background: #222 !important; 
    color: #444 !important; 
    cursor: not-allowed; 
    box-shadow: none;
    opacity: 0.5;
}

/* LE TEXTE "CHAPTER X OF Y" */
.chapter-indicator { 
    font-family: 'League Spartan', sans-serif !important; 
    font-weight: 700; 
    font-size: 0.85rem; 
    text-transform: uppercase; 
    letter-spacing: 2px;
    color: #f8d061;
    text-align: center;
    min-width: 150px;
}

/* Taille des icônes à l'intérieur */
.nav-round-btn i {
    font-size: 1.2rem;
}

/* --- MOBILE OPTIMIZATIONS --- */
@media (max-width: 768px) {
    .wattpad-layout { padding-top: 80px; }
    .reading-container { padding-left: 20px; padding-right: 20px; }
    .book-title-display { font-size: 2.2rem; }
    
    .reader-toc-fab { left: 15px; bottom: 25px; width: 50px; height: 50px; }
    .reader-settings-fab { right: 15px; bottom: 25px; width: 50px; height: 50px; }
    
    .settings-card { 
        right: 10px; 
        bottom: 90px; 
        width: calc(100% - 20px); 
    }
}





/* --- INITIAL LOADER STYLES --- */
.reader-loader {
    position: fixed;
    inset: 0;
    background: #0c0f16;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loader-content { text-align: center; }

.loader-bar {
    width: 200px;
    height: 2px;
    background: rgba(248, 208, 97, 0.1);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.loader-progress {
    width: 40%;
    height: 100%;
    background: #f8d061;
    position: absolute;
    animation: loaderMove 1.5s infinite ease-in-out;
}

@keyframes loaderMove {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

/* --- BARRE DE PROGRESSION DE LECTURE (FIX VISIBILITÉ) --- */
.progress-container {
    height: 5px !important; /* Un peu plus épaisse */
    background: rgba(0, 0, 0, 0.5) !important;
}

.progress-bar {
    box-shadow: 0 0 10px #f8d061; /* Ajoute une lueur pour qu'on la voie mieux */
}