/* ===================================
   MEJORAS ADICIONALES Y PULIDO FINAL
   =================================== */

/* Mejora del body y contenedor principal */
body {
    background: linear-gradient(to bottom, #0a0a0a 0%, #0f0f0f 100%);
    min-height: 100vh;
}

/* Sutil línea de separación entre secciones */
.movie-section:not(:last-child)::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, 
        transparent 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        transparent 100%);
    margin-top: 3rem;
}

/* Mejora del header para la sección recomendada */
.movie-section.recommended .section-title {
    position: relative;
    display: inline-block;
}

.movie-section.recommended .section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* Botón "Ver todo" mejorado con hover más elegante */
.view-all {
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
}

.view-all::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%);
    transition: left 0.6s ease;
}

.view-all:hover::before {
    left: 100%;
}

/* Mejora del efecto hover en las tarjetas */
.movie-card {
    position: relative;
}

.movie-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
    border-radius: 0.375rem;
}

.movie-card:hover::before {
    opacity: 1;
}

/* Efecto de luz en hover */
.movie-card:hover .movie-poster {
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(255, 255, 255, 0.05);
}

/* Mejora del overlay con gradiente más suave */
.movie-card:hover .movie-overlay {
    opacity: 1;
    backdrop-filter: blur(2px);
}

/* Animación sutil de entrada para las películas */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.movie-card {
    animation: fadeInUp 0.5s ease backwards;
}

.movie-card:nth-child(1) { animation-delay: 0.05s; }
.movie-card:nth-child(2) { animation-delay: 0.1s; }
.movie-card:nth-child(3) { animation-delay: 0.15s; }
.movie-card:nth-child(4) { animation-delay: 0.2s; }
.movie-card:nth-child(5) { animation-delay: 0.25s; }
.movie-card:nth-child(6) { animation-delay: 0.3s; }
.movie-card:nth-child(7) { animation-delay: 0.35s; }

/* Botones de navegación mejorados */
.carousel-nav {
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.carousel-nav:hover {
    background: rgba(40, 40, 40, 0.95);
    border-color: rgba(255, 255, 255, 0.15);
}

.carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

/* Indicador de scroll más sutil */
.movie-carousel {
    position: relative;
}

/* Scrollbar personalizado para navegadores que lo soporten */
@supports (scrollbar-width: thin) {
    .movie-carousel {
        /*scrollbar-width: thin;*/
        scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    }
}

.movie-carousel::-webkit-scrollbar {
    height: 4px;
}

.movie-carousel::-webkit-scrollbar-track {
    background: transparent;
}

.movie-carousel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.movie-carousel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mejora para pantallas muy grandes (4K) */
@media (min-width: 2560px) {
    .movie-section {
        max-width: 2400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .movie-card {
        width: 240px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .movie-carousel {
        gap: 1.75rem;
    }
}

/* Optimización para modo oscuro del sistema */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #000000;
        --bg-secondary: #0a0a0a;
    }
}

/* Mejora de accesibilidad - focus visible */
.movie-card:focus-visible,
.view-all:focus-visible,
.carousel-nav:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

/* Transición suave al cargar imágenes */
.movie-poster img {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.movie-poster img.loaded,
.movie-poster img[complete] {
    opacity: 1;
}

/* Estado de carga para las imágenes */
.movie-poster::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 0;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.movie-poster img.loaded ~ ::before {
    display: none;
}

/* Mejora del título con truncado elegante */
.movie-title {
    position: relative;
}

.movie-card:hover .movie-title {
    color: var(--text-primary);
}

/* Pequeño indicador de nueva película (opcional) */
.movie-card[data-new="true"] .movie-poster::after {
    content: 'NUEVO';
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--accent);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    letter-spacing: 0.05em;
    z-index: 2;
}

/* Efecto parallax sutil en scroll (opcional) */
@supports (transform: translateZ(0)) {
    .movie-section {
        transform: translateZ(0);
        will-change: transform;
    }
}