/* ============================================================
   1. VARIABLES Y RESET
   ============================================================ */
:root {
    --bg-dark: #0b0f19;
    --accent-blue: #007bff;
    --text-main: #eeeeee;
    --gray-2: #1a2333;
    --gray-3: #2d3748;
    --shadow: rgba(0, 0, 0, 0.45);
    --nova-accent: #3b82f6;
    --nova-accent-secondary: #06b6d4;
    --nova-text: #e2e8f0;
    --nova-text-muted: #94a3b8;
    --nova-border: #334155;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-main);
    background: linear-gradient(120deg, var(--bg-dark) 0%, #131a30 45%, #0b0f19 100%);
    background-attachment: fixed;
}

/* El contenedor padre que se queda estático arriba */
.main-header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    /* Prioridad máxima sobre las portadas de pelis */
    background: rgba(11, 15, 25, 0.85);
    /* Fondo oscuro traslúcido */
    backdrop-filter: blur(12px);
    /* Efecto cristal */
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--nova-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* Opcional: Si quieres que el buscador se encoja un poco al hacer scroll, 
   puedes ajustar el padding de la barra de búsqueda */
.search-header-bar {
    overflow: hidden;
    backdrop-filter: none !important;
}



/* ============================================================
   2. LAYOUT GLOBAL (MAIN WRAPPERS)
   ============================================================ */
.main-wrapper {
    margin: 0 auto;
    padding: 1.5rem;
    max-width: 1400px;
    transition: margin-left 0.3s ease;
}

.content {
    min-height: 100vh;
    overflow-x: hidden;
}

/* Navbar Sticky con efecto Glass */
#navbar.sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    background: rgba(11, 15, 25, 0.8);
    border-bottom: 1px solid var(--nova-border);
}

.info {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* padding: 1rem; */
    width: 100%;

}

.info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: var(--nova-text);
    font-weight: 700;
    line-height: 1.2;
}

/* ============================================================
   3. COMPONENTES DE NAVEGACIÓN (NOVA CARDS)
   ============================================================ */
.hidden a.nova-card {
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--nova-border);
    color: var(--nova-text);
    text-decoration: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.hidden a.nova-card:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--nova-accent);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Efecto de brillo al pasar el mouse */
.hidden a.nova-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent);
    transition: 0.5s;
}

.hidden a.nova-card:hover::after {
    left: 100%;
}

.nova-card {
    border: 1px solid rgba(59, 130, 246, 0.3);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.nova-card:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--nova-accent);
}

/* ============================================================
   4. GRILLA Y TARJETAS DE PELÍCULAS (MOVIE CARDS)
   ============================================================ */
.grid,
.results-layout {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.movie-card {
    background: linear-gradient(180deg, #1a2a4a, #101c34);
    border: 1px solid #243957;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 18px var(--shadow);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: var(--nova-accent);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6);
}

.movie-card img {
    display: block;
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    background: #0f1421;
}

.movie-card h2 {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1rem;
    padding: 0.8rem 0.5rem 0.2rem 0.5rem;
    margin: 0;
}

/* ============================================================
   5. ELEMENTOS DE UI (BADGES, BANNERS, ICONOS)
   ============================================================ */
.nova-badge {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #475569;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.section-banner {
    background: linear-gradient(135deg, #0f172a 0%, #131e3a 100%);
    border: 1px solid #1f2a45;
    padding: 1.5rem;
    border-radius: 16px;
    margin-top: 1rem;
    box-shadow: 0 4px 12px var(--shadow);
}

.icon-glow {
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.1);
}

/* ============================================================
   6. ESTADOS VACÍOS Y PLACEHOLDERS
   ============================================================ */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 0;
    color: var(--nova-text-muted);
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.2;
    display: block;
}

.empty-state p {
    font-style: italic;
    font-size: 1.1rem;
}

.empty-state-icon {
    background: linear-gradient(135deg, var(--nova-text-muted), var(--nova-accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.2));
}

/* ============================================================
   7. ANIMACIONES
   ============================================================ */
@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.8;
    }
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================================
   8. SCROLLBAR PERSONALIZADA
   ============================================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--nova-accent);
}

/* ============================================================
   ESTILOS PARA SEARCH-SECTION (RESPONSIVE & PREMIUM)
   ============================================================ */

/* Contenedor Glassmorphism Principal */
.glass-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--nova-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* El contenido interno que maneja el layout horizontal/vertical */
.glass-content .flex {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    /* Centra el buscador si está solo */
    min-height: 50px;
}

.search-wrapper {
    position: relative;
    /* Esto le dice al brillo: 'no te salgas de aquí' */
    overflow: hidden;
    /* Corta cualquier resplandor que intente escaparse */
}

/* INPUT PREMIUM */
.search-input-premium {
    width: 100%;
    height: 50px;
    /* Altura fija para consistencia visual */
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid var(--nova-border) !important;
    border-radius: 15px !important;
    /* Padding lateral generoso para que el texto no toque los iconos */
    padding: 0 50px !important;
    color: var(--nova-text) !important;
    font-size: 1rem;
    outline: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input-premium:focus {
    border-color: var(--nova-accent) !important;
    background: rgba(15, 23, 42, 1) !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

/* ICONO LUPA: Siempre centrado a la izquierda */
.lupa-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--nova-accent);
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 10;
    transition: color 0.3s ease;
}

/* BOTÓN CERRAR: Circular y Animado */
.clear-btn {
    display: none;
    /* Se activa por JS */
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    /* Fondo blanco inicial */
    color: #1a1a1a;
    /* Icono oscuro */
    border: none;
    width: 24px;
    /* Ancho y alto iguales para círculo perfecto */
    height: 24px;
    border-radius: 50%;
    /* Esto lo hace circular */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    z-index: 10;
}

/* Efecto Hover (Rojo al pasar el mouse) */
.clear-btn:hover {
    background: #ff4444;
    /* Rojo */
    color: white;
    transform: translateY(-50%) scale(1.2) rotate(90deg);
    /* Se agranda y gira */
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.5);
}

/* Efecto Click (Presionado) */
.clear-btn:active {
    transform: translateY(-50%) scale(0.9);
}

.search-wrapper {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.search-wrapper:focus-within .input-glow {
    width: 70%;
    opacity: 1;
}

.input-glow {
    position: absolute;
    bottom: 0;
    left: 15%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--nova-accent), transparent);
    transition: width 0.4s ease, opacity 0.3s ease;
    pointer-events: none;
    opacity: 0;
}

.search-input-premium:focus~.input-glow {
    width: 80%;
    opacity: 1;
}



@media (max-width: 640px) {
    .glass-content {
        padding: 1.2rem !important;
        /* Menos espacio en móviles */
    }

    .search-input-premium {
        height: 45px;
        /* Ligeramente más pequeño */
        font-size: 0.9rem;
        /* Texto más legible en pantallas pequeñas */
        padding: 0 45px !important;
    }

    .lupa-icon {
        left: 15px;
        font-size: 1rem;
    }
}

.contenedor-peliculas {
    display: grid;
    /* Crea columnas de mínimo 150px, y llena el espacio disponible */
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    /* Espacio entre películas */
    padding: 10px;
}

/* ============================================================
   AJUSTES PARA EL LOGO Y SU CONTENEDOR (HOVER GLASS EFFECT)
   ============================================================ */
.logo-container {
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.group:hover .logo-container {
    border-color: rgba(var(--nova-accent-rgb), 0.5);
    box-shadow: 0 0 20px rgba(var(--nova-accent-rgb), 0.2);
    transform: translateY(-1px);
}

/* Texto del Logo con Gradiente */
.logo-text {
    color: white;
    text-transform: uppercase;
    font-style: italic;
    letter-spacing: -0.05em;
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.5));
}

/* Efecto de pulso en el icono al hacer hover */
.group:hover i {
    filter: drop-shadow(0 0 8px var(--nova-accent));
    animation: pulse-icon 1.5s infinite;
}

@keyframes pulse-icon {
    0% {
        transform: scale(1) rotate(12deg);
    }

    50% {
        transform: scale(1.2) rotate(12deg);
    }

    100% {
        transform: scale(1) rotate(12deg);
    }
}