/* --- Configuración general y paleta de colores --- */
:root {
    --bg-dark: #141415;
    --bg-card: #1f2022;
    --accent-blood: #d32f2f;
    --accent-blood-hover: #b71c1c;
    --text-main: #ffffff;
    --text-muted: #a0a0a5;
}

/* Transición de scroll suave para todo el sitio */
html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* --- Encabezado / Menú Superior --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 50px;
    background-color: rgba(20, 20, 21, 0.9);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-container img {
    height: 80px;
    object-fit: contain;
}

.nav-right-container {
    display: flex;
    align-items: center;
    gap: 35px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

/* --- Efecto de línea inferior y brillo tétrico en el menú --- */
nav ul li a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    padding: 6px 0;
    transition: color 0.25s ease;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-blood);
    box-shadow: 0 0 8px rgba(211, 47, 47, 0.7);
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

nav ul li a:hover, 
nav ul li a.active {
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

nav ul li a:hover::after, 
nav ul li a.active::after {
    width: 100%;
}

/* --- Redes Sociales --- */
.social-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.social-icons a {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
}

.social-icons a:hover {
    color: var(--text-main);
    transform: translateY(-2px);
}

/* --- Contenedor Principal --- */
.streaming-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 20px;
}

/* --- Banner Principal (Hero Section) --- */
.hero-banner {
    position: relative;
    height: 520px;
    width: 100%;
    background: 
        linear-gradient(180deg, rgba(20,20,21,0.1) 10%, rgba(20,20,21,0.95) 85%),
        url('img/logo_serie.png') no-repeat center center;
    background-size: cover;
    background-color: var(--bg-dark);
    display: flex;
    align-items: flex-end;
    padding: 40px 50px;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
}

.badge {
    background-color: var(--accent-blood);
    color: white;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-content h1 {
    font-size: 2.8rem;
    margin: 10px 0;
    font-weight: 800;
    line-height: 1.1;
    color: #ffffff;
}

.hero-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.btn-primary {
    background-color: var(--accent-blood);
    color: white;
    padding: 10px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--accent-blood-hover);
    transform: scale(1.02);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 10px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    backdrop-filter: blur(5px);
    transition: background 0.2s;
}

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

/* --- Sección de Capítulos (Episodios) --- */
.episodes-section {
    padding: 50px;
}

.episodes-section h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    border-left: 4px solid var(--accent-blood);
    padding-left: 12px;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.episode-card {
    background-color: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.episode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.6);
    border-color: rgba(211, 47, 47, 0.4);
}

.thumbnail-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #000;
}

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.episode-card:hover .thumbnail-container img {
    opacity: 1;
}

.duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.75);
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 2;
}

.badge-new {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: var(--accent-blood);
    color: white;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 800;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.badge-upcoming {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: #666666;
    color: white;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 800;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1;
}

.episode-card:hover .play-overlay {
    opacity: 1;
}

.episode-info {
    padding: 20px;
}

.ep-number {
    font-size: 11px;
    color: var(--accent-blood);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 6px;
}

.episode-info h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
    color: var(--text-main);
    font-weight: 700;
}

.episode-info p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* --- Sección de Historia --- */
.story-section {
    padding: 50px 50px 40px 50px;
    background-color: var(--bg-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.story-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-bottom: 40px;
}

.section-tag {
    font-size: 12px;
    color: var(--accent-blood);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 10px;
}

.story-text h2 {
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-main);
}

.story-lead {
    font-size: 1.1rem;
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 15px;
    font-weight: 600;
}

.story-text p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.story-image {
    width: 100%;
    aspect-ratio: 4/3;
    background-color: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.story-image:hover img {
    transform: scale(1.03);
}

/* --- Ficha Técnica Integrada --- */
.series-meta-container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.meta-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    align-items: baseline;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.meta-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.meta-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.5;
}

.meta-warning {
    color: #ff8a80;
    font-weight: 600;
}

/* --- Sección de Personajes con Imágenes --- */
.characters-section {
    padding: 60px 50px 30px 50px;
    background-color: var(--bg-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.characters-header {
    max-width: 1200px;
    margin: 0 auto 35px auto;
}

.characters-header h2 {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}

.characters-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.characters-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.character-card {
    background-color: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.character-card:hover {
    transform: translateY(-4px);
    border-color: rgba(211, 47, 47, 0.4);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.character-img-container {
    width: 100%;
    aspect-ratio: 1/1;
    background-color: #000;
    overflow: hidden;
}

.character-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.character-card:hover .character-img-container img {
    transform: scale(1.05);
}

.character-info {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.highlight-card {
    border-left: 3px solid var(--accent-blood);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(211, 47, 47, 0.08) 100%);
}

.character-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.char-species {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.char-role {
    font-size: 0.75rem;
    color: var(--accent-blood);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: auto;
}

/* --- Sección de Galería en Carrusel Dinámico --- */
.gallery-carousel-section {
    padding: 60px 50px 30px 50px;
    background-color: var(--bg-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.carousel-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
}

.carousel-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 10px 0;
    width: 100%;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-card {
    flex: 0 0 70%;
    max-width: 800px;
    aspect-ratio: 16/9;
    scroll-snap-align: center;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    transition: transform 0.3s ease;
}

.carousel-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.9) 100%);
    display: flex;
    align-items: flex-end;
}

.carousel-caption span {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

.carousel-btn {
    position: absolute;
    z-index: 10;
    background-color: rgba(20, 20, 21, 0.85);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
}

.carousel-btn:hover {
    background-color: var(--accent-blood);
    border-color: var(--accent-blood);
    transform: scale(1.1);
}

.carousel-prev {
    left: -25px;
}

.carousel-next {
    right: -25px;
}

/* --- Reproductor Modal de Video --- */
.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
}

.video-modal-overlay.active {
    display: flex;
}

.video-modal-container {
    position: relative;
    width: 90%;
    max-width: 960px;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.9);
}

.video-responsive {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
}

.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    font-size: 1.8rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s;
}

.modal-close:hover {
    background-color: var(--accent-blood);
    border-color: var(--accent-blood);
}

/* --- Botón de "Volver al inicio" --- */
.back-to-top-container {
    margin: 35px 0 10px 0;
    display: flex;
    justify-content: center;
}

.btn-back-top {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-back-top svg {
    color: var(--accent-blood);
    transition: transform 0.25s ease;
}

.btn-back-top:hover {
    background-color: rgba(211, 47, 47, 0.12);
    color: var(--text-main);
    border-color: rgba(211, 47, 47, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(211, 47, 47, 0.15);
}

.btn-back-top:hover svg {
    transform: translateY(-2px);
}

/* --- Footer Oficial del Sitio --- */
.site-footer {
    background-color: #0d0d0e;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 50px 20px;
    margin-top: 20px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    text-align: center;
}

.footer-logo img {
    height: 40px;
    object-fit: contain;
    opacity: 0.85;
}

.footer-nav {
    display: flex;
    list-style: none;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-nav li a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s;
}

.footer-nav li a:hover {
    color: var(--text-main);
}

.footer-social {
    display: flex;
    gap: 20px;
}

.footer-social a {
    color: var(--text-muted);
    transition: color 0.2s, transform 0.2s;
}

.footer-social a:hover {
    color: var(--text-main);
    transform: translateY(-2px);
}

.footer-copyright {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* --- Responsivo para dispositivos móviles --- */
@media (max-width: 900px) {
    .story-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .story-section {
        padding: 40px 20px;
    }
    .carousel-card {
        flex: 0 0 90%;
    }
    .carousel-btn {
        display: none;
    }
}

@media (max-width: 768px) {
    header {
        padding: 15px 20px;
    }
    .nav-right-container nav ul {
        display: none;
    }
    .hero-banner {
        height: 400px;
        padding: 20px;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    .episodes-section {
        padding: 25px 20px;
    }
    .series-meta-container {
        padding: 20px;
    }
    .meta-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .meta-label {
        font-size: 0.75rem;
        color: var(--accent-blood);
    }
    .characters-section {
        padding: 40px 20px;
    }
    .gallery-carousel-section {
        padding: 40px 20px;
    }
    .footer-nav {
        gap: 15px;
    }
}
