/* --- VARIABLES Y BASES --- */
:root {
    --primary-purple: #a855f7;
    --bg-dark: #0a0a0b; 
    --card-bg: #161618; 
    --text-main: #ffffff;
    --text-dim: #a1a1aa;
}

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

/* Contenedor principal para control de espaciado global */
#app {
    position: relative;
    z-index: 20;
    margin-top: -60px; /* Sube las filas para que se integren con el Hero */
}

/* --- BARRA DE NAVEGACIÓN --- */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(25px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-text { font-size: 1.6rem; font-weight: 900; letter-spacing: -1.5px; }
.logo-text .plus { color: var(--primary-purple); font-style: italic; }

.actions-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- BUSCADOR --- */
.search-wrapper {
    display: flex;
    align-items: center;
    background: #1c1c1e;
    border: 1px solid #2c2c2e;
    border-radius: 12px;
    width: 45px;
    height: 45px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}

.search-wrapper.active {
    width: 220px;
    border-color: var(--primary-purple);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}

.search-btn {
    min-width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-purple);
}

.search-wrapper input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    outline: none;
    padding: 0;
    opacity: 0;
    transition: 0.3s;
}

.search-wrapper.active input {
    opacity: 1;
    padding: 0 10px;
}

.settings-btn {
    background: #1c1c1e;
    color: var(--text-dim);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
}

/* --- HERO BANNER --- */
.hero-container {
    height: 75vh;
    width: 100%;
    position: relative;
    background-size: cover;
    background-position: center 20%;
    display: flex;
    align-items: flex-end;
    transition: background-image 0.8s ease-in-out, opacity 0.5s;
}

.hero-container::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, var(--bg-dark) 8%, transparent 50%),
                linear-gradient(to right, rgba(0,0,0,0.8) 5%, transparent 60%);
}

.hero-content {
    position: relative;
    z-index: 10;
    padding: 0 20px 80px 20px;
    max-width: 600px;
}

#hero-title { font-size: 3rem; font-weight: 900; margin: 0; letter-spacing: -2px; line-height: 1; }
#hero-desc { font-size: 1rem; color: var(--text-dim); margin: 15px 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

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

.btn-play, .btn-info {
    padding: 10px 22px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}

.btn-play { background: white; color: black; }
.btn-info { background: rgba(255,255,255,0.15); color: white; backdrop-filter: blur(10px); }

/* --- FILAS DE CONTENIDO (INICIO) --- */
.category-title { 
    margin: 20px 0 10px 20px; 
    font-size: 1.1rem; 
    font-weight: 700;
    position: relative;
    z-index: 30;
}

.row {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 12px;
    padding: 0 0 25px 20px; 
    overflow-x: auto;
    scrollbar-width: none;
    position: relative;
    z-index: 30;
}

.row::-webkit-scrollbar { display: none; }

/* --- CARTAS (MOVIE CARDS) --- */
.movie-card {
    min-width: 130px; 
    width: 130px;
    height: 195px;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid #252529;
    flex-shrink: 0;
    transition: transform 0.4s cubic-bezier(0.2, 1, 0.2, 1), border-color 0.4s;
}

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

.movie-card:focus, .movie-card:hover {
    transform: scale(1.05);
    border-color: var(--primary-purple);
    outline: none;
    z-index: 50;
}

.info-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0; padding: 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    opacity: 0;
    transition: 0.3s;
}
.movie-card:focus .info-overlay, .movie-card:hover .info-overlay { opacity: 1; }

/* --- MODO BÚSQUEDA (GRID) --- */
.search-mode .hero-container {
    display: none !important;
}

.search-mode#app {
    display: grid !important;
    margin-top: 0 !important; /* Quita el margen negativo al buscar */
    grid-template-columns: repeat(3, 1fr) !important; 
    gap: 10px !important;
    padding: 15px !important;
    width: 100%;
    box-sizing: border-box;
    align-content: start;
}

.search-mode .movie-card {
    min-width: 0 !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 2 / 3 !important;
    margin: 0 !important;
}

/* --- ADAPTACIÓN A PANTALLAS --- */

/* Tablets / Celular de lado */
@media screen and (min-width: 600px) {
    .search-mode#app { grid-template-columns: repeat(4, 1fr) !important; gap: 15px !important; }
    .movie-card { min-width: 150px; width: 150px; height: 225px; }
}

/* TV / Monitor Grande */
@media screen and (min-width: 1100px) {
    .top-bar { padding: 20px 40px; }
    .hero-content { padding-left: 40px; }
    .category-title, .row { padding-left: 40px; margin-left: 0; }
    .search-mode#app { grid-template-columns: repeat(7, 1fr) !important; padding: 40px !important; }
}

/* Móvil vertical (Ajustes finales) */
@media (max-width: 768px) {
    .hero-container { height: 55vh; }
    #hero-title { font-size: 2.2rem; }
    #app { margin-top: -40px; }
    .category-title { margin-left: 15px; }
    .row { padding-left: 15px; padding-bottom: 15px; }
}
/* --- MENÚ SETTINGS --- */
.overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 150;
    display: none; /* Se activa con JS */
}

.settings-menu {
    position: fixed;
    top: 0; right: -300px; /* Escondido a la derecha */
    width: 300px;
    height: 100%;
    background: #161618;
    z-index: 200;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 30px 20px;
    box-sizing: border-box;
    box-shadow: -5px 0 20px rgba(0,0,0,0.5);
}

.settings-menu.active { right: 0; }

.menu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.close-menu { font-size: 1.5rem; color: var(--text-dim); cursor: pointer; }

.menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 12px;
    transition: 0.3s;
    cursor: pointer;
    margin-bottom: 10px;
}

.menu-item:hover { background: #252529; }
.menu-item i { font-size: 1.2rem; color: var(--primary-purple); }
.item-title { display: block; font-weight: 700; font-size: 0.9rem; }
.item-sub { font-size: 0.75rem; color: var(--text-dim); }

.menu-footer { position: absolute; bottom: 30px; left: 20px; right: 20px; }
.btn-logout { 
    width: 100%; padding: 12px; border-radius: 8px; border: 1px solid #ff4444; 
    background: transparent; color: #ff4444; font-weight: 700; cursor: pointer;
}

