/* ============================================================
   Manga 4 All - CSS Completo Corregido (v18)
   Corrección: Fix portadas aplastadas en manga.html
   ============================================================ */

/* --- 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; text-decoration: none; transition: 0.3s; }
.update-cover-wrapper { width: 100%; aspect-ratio: 2 / 3; 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 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; }
/* FIX IMPORTANTE: Apuntamos directamente a 'img' dentro del contenedor, no a una clase .cover que no existe */
.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 - Ajustamos minmax a 180px para tarjetas un poco más anchas */
.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; }
