:root {
    --bg-color: #0b0f19;
    --acc-color: #0071eb;
    --acc-hover: #005bb5;
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --brand-color: #0071eb;
    /* HomeLab dark -> HomeLab Blue */
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --glass-bg: rgba(20, 20, 20, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Navbar Premium */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4%;
    height: 70px;
    background: linear-gradient(to bottom, rgba(11, 15, 25, 0.9) 0%, transparent 100%);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
}

.navbar.scrolled {
    background-color: rgba(11, 15, 25, 0.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    color: #0071eb;
    /* Azul HomeLab */
    font-family: 'Netflix Sans', Arial, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -1px;
    cursor: pointer;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

.navbar nav {
    flex: 1;
    margin-left: 3rem;
    display: flex;
    gap: 20px;
}

.navbar nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.3s;
    cursor: pointer;
}

.navbar nav a:hover,
.navbar nav a.active {
    color: white;
    font-weight: 700;
}

/* --- Lado Derecho de la Navbar --- */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-text-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
}

.nav-icon {
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.nav-profile {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    position: relative;
    /* Necesario para posicional el dropdown de cuenta */
}

.nav-profile img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    /* Avatar cuadradito como clásico Netflix */
    object-fit: cover;
}

.nav-profile i {
    color: white;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nav-profile:hover i.fa-caret-down {
    transform: rotate(180deg);
}

/* --- Menú desplegable Cuenta --- */
.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 20px;
    width: 220px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    display: none;
    flex-direction: column;
    padding: 10px 0;
    z-index: 1000;
}

.nav-profile:hover .profile-dropdown {
    display: flex;
}

.profile-dropdown p {
    color: #e5e5e5;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 10px 15px;
    margin: 0;
    cursor: pointer;
    transition: color 0.2s;
}

.profile-dropdown p:hover {
    color: white;
    text-decoration: underline;
}

.profile-dropdown hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 5px 0;
}

/* --- Buscador Premium Flotante --- */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    background: transparent;
    padding: 0.2rem 0.5rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.search-container:focus-within {
    background: rgba(0, 0, 0, 0.75);
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow: none;
}

.search-icon {
    color: var(--text-muted);
    margin-right: 10px;
}

#search-input {
    background: transparent;
    border: none;
    color: white;
    width: 250px;
    font-size: 1rem;
    outline: none;
}

#search-input::placeholder {
    color: var(--text-muted);
}

.clear-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
}

/* --- Search Dropdown --- */
.search-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 15px;
    width: 320px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    max-height: 450px;
    overflow-y: auto;
    z-index: 1000;
}

.search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.search-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.search-dropdown::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.search-item {
    display: flex;
    align-items: center;
    padding: 10px;
    gap: 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.search-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-item img {
    width: 45px;
    height: 65px;
    object-fit: cover;
    border-radius: 4px;
}

.search-item-info {
    display: flex;
    flex-direction: column;
}

.search-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    margin-bottom: 3px;
}

.search-item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Hero Banner (como MIWEB) */
.hero-section {
    position: relative;
    height: 65vh;
    min-height: 500px;
    width: 100%;
    background-size: cover;
    background-position: center 20%;
    display: flex;
    align-items: center;
    padding: 0 4%;
    margin-bottom: 20px;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(20, 20, 20, 0.4) 80%, var(--bg-color) 100%);
    z-index: 1;
}

.hero-fade-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 15rem;
    background-image: linear-gradient(to bottom, transparent, rgba(20, 20, 20, 0.6), var(--bg-color));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 600px;
    margin-top: 50px;
}

.hero-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    background: #fff;
    color: #000;
    font-weight: 800;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #ffffff;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.9), 0px 0px 5px rgba(0, 0, 0, 0.8);
    font-family: 'Netflix Sans', Arial, sans-serif;
}

.hero-series-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.h-icon {
    color: #0071eb;
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1;
}

.series-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 4px;
}

.hero-desc {
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1.4;
    color: #ffffff;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9), 0px 0px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 2rem;
    max-width: 600px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.play-button,
.more-info-button {
    padding: 0.8rem 2rem;
    border-radius: 4px;
    /* Cuadradito redondeado puro Netflix */
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
}

.play-button {
    background: white;
    color: black;
}

.play-button:hover {
    background: rgba(255, 255, 255, 0.75);
    transform: scale(1.05);
}

.more-info-button {
    background: rgba(109, 109, 110, 0.7);
    color: white;
}

.more-info-button:hover {
    background: rgba(109, 109, 110, 0.4);
    transform: scale(1.05);
}

/* Catálogo Grid */
.catalog-section {
    padding: 100px 4rem 5rem 4rem;
    z-index: 10;
    position: relative;
}

/* --- SECCIONES GENÉRICAS --- */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-left: 1rem;
    color: #ffffff;
    /* Ajustado el título de categoría 'Series Populares' a blanco puro */
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
}

.movie-card {
    position: relative;
    cursor: pointer;
    border-radius: 4px;
    /* Bordes rectos estilo original */
    overflow: hidden;
    transition: var(--transition-smooth);
    background-color: #222;
    aspect-ratio: 2/3;
    will-change: transform;
}

.movie-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.movie-card:hover {
    transform: scale(1.15) translateY(-15px);
    z-index: 30;
    box-shadow: 0px 20px 30px -10px rgba(0, 0, 0, 0.9), 0px 0px 15px rgba(255, 255, 255, 0.1);
}

.movie-card:hover img {
    border-radius: 6px;
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem 1rem 1rem 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.movie-card:hover .card-overlay {
    opacity: 1;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #ffffff;
    /* Ajustado el título principal del catálogo a blanco sólido */
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9), 0px 0px 4px rgba(0, 0, 0, 0.8);
    /* Doble sombra para ser visible sobre fondos claros o texto fundido */
}

.card-rating {
    font-size: 0.9rem;
    color: #ffd700;
}

/* Player View */
.player-view {
    padding: 100px 4% 50px 4%;
    color: white;
    /* Asegurar texto blanco por defecto */
}

.back-btn {
    background: transparent;
    color: white;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Series Selector Premium */
.season-selector {
    background: transparent;
    padding: 0;
    margin-bottom: 30px;
    border: none;
}

.episodes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.episodes-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.compact-select {
    background: #2a2a2a;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    border: 1px solid #444;
    outline: none;
    cursor: pointer;
    font-weight: 600;
}

/* Lista Visual Episodios */
.episodes-compact-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.episode-card {
    display: flex;
    gap: 20px;
    background: #1e1e1e;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
    border: 1px solid transparent;
}

.episode-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.01);
    border-color: rgba(255, 255, 255, 0.2);
}

.episode-img-wrapper {
    width: 180px;
    height: 101px;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.episode-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.episode-img-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.episode-card:hover .episode-img-overlay i {
    color: var(--brand-color);
}

.episode-info {
    flex: 1;
}

.episode-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.episode-title {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    flex: 1;
}

.episode-runtime {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: 15px;
    white-space: nowrap;
}

.episode-desc {
    color: #999;
    font-size: 0.95rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.info-section h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: white;
    /* Corregido! */
}

.meta-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.meta-tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#playing-desc {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #ddd;
    /* Texto más claro */
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinners */
.hero-loader,
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    color: #e50914; /* Rojo Netflix/Doodstream para máxima visibilidad */
    font-size: 2rem;
    padding: 50px 0;
}