/* /var/www/html/assets/css/style.css */
body {
    background-color: #141414;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    font-size: 14px; /* Base más pequeña y elegante */
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700; /* Títulos en negrita */
}

a { text-decoration: none; color: inherit; }

.navbar {    
    padding: 20px 4%;
    background: transparent;
    transition: background-color 0.3s ease;
}

/* Estilo del navbar cuando se hace scroll */
.navbar.scrolled {
    background-color: #141414;
}

.logo { color: #e50914; font-size: 24px; font-weight: bold; }

.navbar-nav .nav-link { 
    margin-right: 20px; 
    color: #e5e5e5; 
    font-size: 13px; 
    font-weight: 600; 
}
.navbar-nav .nav-link:hover, .navbar-nav .nav-link:focus { color: #b3b3b3; }
.navbar-nav .nav-link i { font-size: 1.2rem; vertical-align: middle; }

/* Estilos para menú móvil */
@media (max-width: 991px) {
    .navbar-collapse {
        background-color: #141414;
        padding: 20px;
        border-radius: 8px;
        margin-top: 10px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    }
    .navbar-nav .nav-link {
        margin-right: 0;
        padding: 12px 0;
        border-bottom: 1px solid #2a2a2a;
    }
    .navbar-nav .nav-item:last-child .nav-link {
        border-bottom: none;
    }
}

.btn-primary { background-color: #e50914; padding: 7px 17px; border-radius: 3px; color: white; font-weight: bold; }
.btn-secondary { background-color: transparent; border: 1px solid white; padding: 7px 17px; border-radius: 3px; }

/* --- Hero Section --- */
.hero {
    min-height: 85vh; /* Altura más inmersiva y flexible */
    height: auto;
    display: flex;
    align-items: center;
    justify-content: start;
    padding: 100px 4% 60px 4%; /* Espacio superior para el header fijo */
    background-size: cover;
    background-position: center top; /* Enfocar la parte superior de la imagen (caras/títulos) */
    position: relative;
    background-color: #141414; /* Fallback color */
    margin-bottom: 30px;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to right, rgba(20,20,20,0.9) 20%, transparent 70%), linear-gradient(to top, #141414 0%, transparent 20%);
}

.hero-content {
    position: relative;
    z-index: 20;
    max-width: 500px;
}

/* Hero Carousel Indicators (Thumbnails) */
.carousel-indicators {
    position: absolute;
    right: 4%;
    bottom: 30px;
    left: auto;
    margin: 0;
    justify-content: flex-end;
    gap: 10px;
    z-index: 15;
    width: auto;
}

.carousel-indicators [data-bs-target] {
    width: 80px;
    height: 120px;
    text-indent: 0;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    background: #000;
    opacity: 0.6;
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    flex: 0 0 auto;
}

.carousel-indicators [data-bs-target].active {
    opacity: 1;
    border-color: #e50914;
    transform: scale(1.15);
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

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

/* --- Carousel Styles --- */
.content-row {
    margin-bottom: 30px;
    overflow: hidden;
}

.content-row h2 {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.9rem;
}

.carousel-container {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 40px 0 40px 4%; /* Espacio extra para el efecto hover */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #444 #141414;
}

/* Ajuste para que los controles del carrusel no cubran el contenido */
.carousel-control-prev, .carousel-control-next {
    width: 5%;
    z-index: 10;
}

/* Scrollbar para Webkit (Chrome, Safari) */
.carousel-container::-webkit-scrollbar { height: 10px; }
.carousel-container::-webkit-scrollbar-track { background: transparent; }
.carousel-container::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.2); border-radius: 10px; }

/* Wrapper to handle the space for the scaled card */
.card-wrapper {
    flex: 0 0 auto;
    width: 180px;
    margin-right: 10px;
    position: relative;
    height: 270px; /* Same as card image height */
}

.card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none !important; /* Override Bootstrap */
    background-color: transparent !important; /* Override Bootstrap */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
}

.card-wrapper:hover .card {
    transform: scale(1.2);
    z-index: 20;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
}

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

.card-hover-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 60%, transparent 100%);
    padding: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.card-wrapper:hover .card-hover-info {
    opacity: 1;
    transform: translateY(0);
}

.card-title {
    font-size: 0.85rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
}

.card-resume-info {
    font-size: 0.7rem;
    font-weight: 600;
    color: #46d369;
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

.card-meta {
    font-size: 0.8rem;
    color: #a3a3a3;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}
.card-meta .rating i { color: #f5c518; }

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-actions .play-icon i, .card-actions .info-icon i, .card-actions .fav-icon i {
    font-size: 2.2rem;
    color: white;
    transition: color 0.2s ease;
}

.card-actions a:hover i, .card-actions .fav-icon:hover i {
    color: #e50914;
}

.card-actions button.fav-icon {
    background: none;
    border: none;
    padding: 0;
    width: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.info-block {
    max-width: 600px;
    margin-bottom: 50px;
}

.info-block h1 { font-size: 2.2rem; margin-bottom: 10px; line-height: 1.1; }
.info-block .meta { color: #a3a3a3; font-weight: 600; margin-bottom: 15px; font-size: 0.9rem; }
.info-block .plot { font-size: 0.9rem; line-height: 1.6; margin-bottom: 25px; color: #dcdcdc; }

.btn-play {
    background-color: white;
    color: black;
    padding: 10px 25px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    display: inline-block;
}
.btn-play:hover { background-color: rgba(255, 255, 255, 0.75); }

/* Hero Meta Info */
.hero-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #e5e5e5;
}
.hero-meta .rating { color: #46d369; font-weight: bold; }
.badge-genre {
    font-size: 0.8rem;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

.episodes-list { margin-top: 20px; }
.grid-list { display: flex; flex-direction: column; gap: 10px; }
.episode-card { background: #333; padding: 15px; border-radius: 4px; display: flex; justify-content: space-between; align-items: center; }
.btn-play-sm { background: #e50914; padding: 5px 10px; border-radius: 3px; font-size: 12px; }

footer {
    padding: 40px 0;
    text-align: center;
    color: #757575;
    font-size: 13px;
    margin-top: 50px;
}

.badges-right {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    z-index: 5;
}

.badge-quality {
    background: rgba(229, 9, 20, 0.9);
    color: white;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 3px;
    font-weight: bold;
}

.badge-language {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 3px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Details Page Styles */
.actions-container {
    margin-top: 20px;
}

.quality-selector .selector-title {
    font-weight: bold;
    margin-right: 15px;
    font-size: 1.1rem;
}

.btn-quality {
    background-color: rgba(109, 109, 110, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.7);
    padding: 8px 15px;
    border-radius: 4px;
    margin-right: 10px;
    font-weight: bold;
    transition: background-color 0.2s ease;
    display: inline-block;
    margin-bottom: 10px;
}

.btn-quality:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-quality.active {
    background-color: white;
    color: black;
    border-color: white;
}

.quality-selector-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}
.quality-selector-inline::-webkit-scrollbar { display: none; }

.quality-selector-inline .btn-quality {
    margin-bottom: 0;
    flex: 0 0 auto;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .info-block h1 { font-size: 28px; }
    .info-block .plot { font-size: 14px; }
    .info-block { margin-bottom: 20px; }
    .btn-play { font-size: 16px; padding: 8px 20px; }
    .quality-selector-inline { flex-wrap: nowrap; }
    .badges-right { top: 5px; right: 5px; }
    .badges-left { top: 5px; left: 5px; }
    .carousel-indicators {
        display: flex;
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        justify-content: flex-start;
        overflow-x: auto;
        gap: 8px;
        scrollbar-width: none; /* Firefox */
        padding: 15px 5px; /* Espacio extra para que el zoom no corte los bordes */
        align-items: center; /* Centrar verticalmente las miniaturas */
    }
    .carousel-indicators::-webkit-scrollbar { display: none; } /* Chrome/Safari */
    .carousel-indicators [data-bs-target] {
        width: 80px;
        height: 120px;
        flex: 0 0 auto;
    }
}

.badges-left {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    z-index: 5;
}

/* Credits & Trailer */
.credits {
    margin-bottom: 25px;
    font-size: 0.9rem;
    color: #e5e5e5;
}
.credit-line {
    margin-bottom: 5px;
}
.credit-label {
    color: #737373; /* Gris estilo Netflix */
    font-weight: bold;
    margin-right: 5px;
}
.btn-trailer {
    background-color: rgba(109, 109, 110, 0.7);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}
.btn-trailer:hover {
    background-color: rgba(109, 109, 110, 0.4);
    color: white;
}

/* Season Selector & Episodes */
.season-selector {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid #404040;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.btn-season {
    background: none;
    border: none;
    color: #a3a3a3;
    font-size: 1rem;
    font-weight: bold;
    padding: 10px 5px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: color 0.2s, border-bottom-color 0.2s;
}

.btn-season:hover, .btn-season.active {
    color: white;
}

.btn-season.active {
    border-bottom-color: #e50914;
}

.episodes-carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: #444 #141414;
}

.episode-card-wrapper {
    flex: 0 0 280px;
    max-width: 280px;
}

.episode-link {
    text-decoration: none;
    color: inherit;
    display: block; /* Importante para evitar desbordamientos */
}

.episode-card {
    background-color: #1f1f1f;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s ease, background-color 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column; /* Apilar imagen y texto verticalmente */
    padding: 0; /* Eliminar padding heredado */
    align-items: stretch; /* Estirar contenido al ancho completo */
}

.episode-card:hover {
    transform: scale(1.02);
    background-color: #2f2f2f;
    z-index: 2;
}

/* En móviles mostrar siempre el botón de play */
@media (max-width: 768px) {
    .play-overlay {
        opacity: 1;
        background: rgba(0,0,0,0.1);
    }
}

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

/* Progress Bar for Resume */
.resume-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: rgba(255,255,255,0.3);
    z-index: 4;
}
.resume-progress-bar {
    height: 100%;
    background-color: #e50914;
    width: 0%;
}

.episode-img-box {
    position: relative;
    width: 100%;
    height: 157px; /* 16:9 aspect ratio for 280px width */
    background-color: #2a2a2a; /* Fondo por si falla la imagen */
}

.episode-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.play-overlay i {
    font-size: 3rem;
    color: white;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));
}

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

.ep-badges-bottom-left {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 5;
}

.ep-badges-bottom-right {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 5;
}

.ep-badge {
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 6px;
    font-size: 11px;
    border-radius: 2px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ep-badge.watched {
    color: white;
}
.ep-badge.elapsed {
    color: white; /* Un poco más suave para diferenciar del total */
}

.episode-details {
    padding: 15px;
}

.episode-details h4 {
    font-size: 0.8rem;
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.ep-plot {
    font-size: 0.85rem;
    color: #a3a3a3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Watched Indicators */
.watched-badge {
    background: rgba(0, 0, 0, 0.6);
    color: #46d369; /* Verde estilo "completado" */
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}
.watched-badge i {
    font-size: 16px;
}
