/* ============================================================
   Manga 4 All - CSS Completo Corregido (v19)
   Corrección: Centrado de nombres y estabilidad en carrusel
   ============================================================ */

/* --- RESET Y BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', sans-serif; }
body { background-color: #070707; color: white; line-height: 1.4; padding-top: 70px; }

/* --- NAVBAR FIJA --- */
nav { 
    background: #111; padding: 0 40px; display: flex; 
    justify-content: space-between; align-items: center; 
    border-bottom: 2px solid #ff0055; position: fixed; 
    top: 0; left: 0; width: 100%; height: 70px; z-index: 3000;
}
.nav-left { display: flex; align-items: center; gap: 45px; }
.logo { color: #ff0055; font-weight: bold; font-size: 1.7rem; text-decoration: none; }
.nav-links { display: flex; gap: 35px; }
.nav-links a { color: #ccc; text-decoration: none; font-size: 1rem; transition: 0.3s; font-weight: 500; }
.nav-links a:hover { color: #ff0055; }
.search-container input {
    background: #1a1a1a; border: 1px solid #333; padding: 10px 18px; 
    border-radius: 25px; color: white; outline: none; width: 280px;
}

/* --- HEADER / BANNER --- */
header { 
    position: relative; height: 380px; display: flex; 
    align-items: center; justify-content: center; overflow: hidden;
}
.banner-img { position: absolute; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent, #070707); z-index: 0; }
.header-content { position: relative; z-index: 10; text-align: center; max-width: 850px; padding: 20px; }
.header-content h1 { font-size: 4rem; margin-bottom: 15px; }
.header-content p { font-size: 1.2rem; color: #ddd; line-height: 1.7; }

/* --- CONTENEDORES --- */
.container { max-width: 1250px; margin: 0 auto; padding: 20px; }
.section-title { font-size: 1.7rem; margin: 40px 0 20px 0; border-left: 6px solid #ff0055; padding-left: 18px; }

/* --- CARRUSEL AUTOMÁTICO (ULTIMAS ACTUALIZACIONES) --- */
.updates-wrapper { width: 100%; overflow: hidden; position: relative; padding: 20px 0; }
.updates-track { display: flex; gap: 30px; width: max-content; animation: scroll-loop 40s linear infinite; }
.updates-wrapper:hover .updates-track { animation-play-state: paused; }
@keyframes scroll-loop { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

.update-item { 
    flex: 0 0 160px; 
    width: 160px; 
    text-decoration: none; 
    transition: 0.3s; 
    display: flex; 
    flex-direction: column; 
    align-items: center; /* Asegura el centrado de los hijos */
}

.update-cover-wrapper { 
    width: 160px; /* Ancho fijo para que no salte */
    height: 230px; /* Alto fijo para simetría total */
    border-radius: 12px; 
    overflow: hidden; 
    border: 1px solid #222; 
    margin-bottom: 10px; 
}
.update-cover-wrapper img { width: 100%; height: 100%; object-fit: cover; }

.update-info { width: 100%; text-align: center; }
.update-info strong { 
    display: block; 
    text-align: center; 
    width: 100%; 
}
.update-info span { 
    font-size: 0.85rem; 
    color: #ff0055; 
    font-weight: bold; 
    display: block; 
    text-align: center; 
}

/* --- GRID GENERAL / CARDS COMUNES --- */
.cover-container { width: 100%; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 12px 12px 0 0; }
.cover-container img { width: 100%; height: 100%; object-fit: cover; display: block; }

.manga-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 35px; }
.manga-card { 
    background: #111; border-radius: 12px; border: 1px solid #222; 
    text-decoration: none; color: white; transition: 0.4s; position: relative;
    display: flex; flex-direction: column;
}
.manga-card:hover { transform: translateY(-12px); border-color: #ff0055; }
.manga-info { padding: 18px; text-align: center; }
.manga-info h3 { font-size: 1.1rem; margin-bottom: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn { background: #ff0055; color: white; padding: 10px; border-radius: 8px; font-weight: bold; text-decoration: none; display: block; text-align: center; }

/* --- DISEÑO DE LA PÁGINA DE MANGA (manga.html) --- */
.manga-page { display: flex; gap: 50px; margin-top: 30px; align-items: flex-start; }
.manga-cover-side { flex: 0 0 320px; }
.manga-cover-side img { width: 100%; border-radius: 15px; border: 1px solid #222; box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
.manga-content-side { flex: 1; }
.manga-content-side h1 { font-size: 2.5rem; margin-bottom: 10px; }

/* Grid de capítulos */
.chapters-grid { 
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
    gap: 20px; margin-top: 30px; 
}
.chapter-card { 
    background: #111; border-radius: 10px; overflow: hidden; 
    text-decoration: none; color: white; border: 1px solid #1f1f1f; transition: 0.3s;
}
.chapter-card:hover { border-color: #ff0055; transform: translateY(-5px); }
.chapter-info { padding: 12px; text-align: center; }
.chapter-info h3 { font-size: 0.9rem; margin-bottom: 10px; }

/* --- READER --- */
.manga-container { max-width: 900px; margin: 30px auto; display: flex; flex-direction: column; align-items: center; }
.manga-container img { width: 100%; height: auto; display: block; }
.nav-controls { display: flex; justify-content: center; align-items: center; gap: 25px; padding: 35px; background: #070707; }

footer { text-align: center; padding: 60px; color: #444; border-top: 1px solid #111; margin-top: 50px; }

/* --- TOOLTIP DE INFORMACIÓN (NUEVO) --- */
.manga-card .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    width: 240px;
    background: #1a1a1a;
    border: 1px solid #ff0055;
    color: #eee;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.manga-card .tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: #ff0055 transparent transparent transparent;
}

.manga-card:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-20px);
}

.manga-card .tooltip p {
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- FIX ESPECÍFICO PARA LISTA DE CAPÍTULOS --- */
.chapters-grid-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 900px;
    margin: 0 auto;
}

.chapter-row-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: #161616 !important;
    padding: 12px 25px !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    color: white !important;
    border: 1px solid #222 !important;
    transition: 0.3s;
}

.chapter-row-item:hover {
    border-color: #ff0055 !important;
    background: #1c1c1c !important;
}

.chapter-row-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.chapter-row-img {
    width: 45px !important;
    height: 65px !important;
    object-fit: cover;
    border-radius: 4px;
}
