/* 1. Contenedor Principal: Separación y alineación */
.md\:flex.flex-row {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    /* Separa los botones entre sí */
    flex-wrap: nowrap !important;
}

.year-search-wrapper {
    display: flex;
    align-items: center;
    background: rgba(15, 15, 20, 0.6);
    /* Fondo más oscuro para contraste */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 4px 6px 4px 12px;
    margin-left: 8px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 130px;
    flex-shrink: 0;
}

.year-search-wrapper:focus-within {
    border-color: var(--nova-accent);
    background: rgba(20, 20, 30, 0.8);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.25);
    transform: scale(1.02);
}

/* 4. El Input de texto */
#manualYearInput {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #fff !important;
    font-size: 0.9rem !important;
    width: 65px !important;
    font-weight: 500;
}

#manualYearInput::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* 5. El Botón de flecha (btnGoYear) ESTILIZADO */
#btnGoYear {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nova-accent);
    /* Color sólido de fondo */
    color: #000;
    /* Icono oscuro para contraste */
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

#btnGoYear:hover {
    background: #fff;
    transform: rotate(90deg) scale(1.1);
    /* Animación de rotación al pasar el mouse */
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

#btnGoYear i {
    font-size: 1.1rem;
}

/* Limpieza de flechas de número */
#manualYearInput::-webkit-inner-spin-button,
#manualYearInput::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.home-card {
    position: relative;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.home-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.15);
    border-color: rgba(0, 229, 255, 0.3);
}

/* Wrapper de imagen */
.home-card-image-wrapper {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

/* Imagen */
.home-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.home-card:hover .home-card-image {
    transform: scale(1.05);
}

/* Badges - pequeños cuadritos en esquinas */
.home-badge {
    position: absolute;
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 10;
    color: #fff;
    backdrop-filter: blur(4px);
}

/* Badge NUEVO - arriba izquierda (rojo/naranja) */
.badge-nuevo {
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* Badge HD - arriba derecha */
.badge-hd {
    top: 8px;
    right: 8px;
    background: rgba(0, 229, 255, 0.9);
    color: #000;
}

/* Info Temporada/Episodio - abajo izquierda */
.home-info {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10;
}

/* Overlay de play - aparece en hover */
.home-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 5;
}

.home-card:hover .home-play-overlay {
    background: rgba(0, 0, 0, 0.4);
}

/* Botón de play */
.home-play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 229, 255, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.home-card:hover .home-play-btn {
    background: rgba(0, 229, 255, 0.9);
    transform: scale(1);
    border-color: rgba(255, 255, 255, 0.3);
}

.home-play-btn i {
    color: #fff;
    font-size: 18px;
    margin-left: 3px;
}

/* Contenido debajo de imagen */
.home-card-content {
    padding: 12px;
    background: rgba(30, 41, 59, 0.8);
}

/* Título */
.home-card-title {
    color: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.home-card:hover .home-card-title {
    color: #00e5ff;
}

/* Responsive */
@media (max-width: 640px) {
    .home-badge {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    .home-info {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    .home-play-btn {
        width: 40px;
        height: 40px;
    }
    
    .home-play-btn i {
        font-size: 14px;
    }
    
    .home-card-content {
        padding: 8px;
    }
    
    .home-card-title {
        font-size: 12px;
    }
}

/* ========================================
   SECCIONES HORIZONTALES (NUEVO)
   ======================================== */

.home-section {
    width: 100%;
}

.home-section-header {
    padding: 0 0 12px 0;
    border-bottom: 2px solid rgba(0, 229, 255, 0.2);
    margin-bottom: 16px;
}

.home-section-header h2 {
    color: #f8fafc;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.home-section-header h2 i {
    color: #00e5ff;
    font-size: 20px;
}

/* Contenedor scroll horizontal */
.home-horizontal-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 4px 20px 4px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 229, 255, 0.5) transparent;
}

.home-horizontal-scroll::-webkit-scrollbar {
    height: 8px;
}

.home-horizontal-scroll::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 4px;
}

.home-horizontal-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.5);
    border-radius: 4px;
}

.home-horizontal-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.8);
}

/* Card horizontal */
.home-hcard {
    flex: 0 0 auto;
    width: 180px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.home-hcard:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.15);
    border-color: rgba(0, 229, 255, 0.3);
}

/* Imagen de card horizontal */
.home-hcard-image-wrapper {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.home-hcard-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.home-hcard:hover .home-hcard-image {
    transform: scale(1.05);
}

/* Badges en cards horizontales */
.home-hcard-badge {
    position: absolute;
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.badge-rating {
    top: 8px;
    right: 8px;
    background: rgba(0, 229, 255, 0.9);
    color: #000;
}

.badge-year {
    top: 8px;
    left: 8px;
    background: rgba(30, 41, 59, 0.9);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Badge de tipo (Película, Serie, Anime, Dorama) */
.home-hcard-type {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.type-movie {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    color: #fff;
}

.type-serie {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
}

.type-anime {
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    color: #fff;
}

.type-dorama {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
}

/* Badges específicos para episodios */
.badge-nuevo-ep {
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.badge-hd-ep {
    top: 8px;
    right: 8px;
    background: rgba(0, 229, 255, 0.9);
    color: #000;
}

.badge-te-ep {
    top: 8px;
    right: 40px;
    background: rgba(139, 92, 246, 0.9);
    color: #fff;
}

/* Info Temporada/Episodio en cards horizontales */
.home-ep-info {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: rgba(139, 92, 246, 0.9);
    backdrop-filter: blur(4px);
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Overlay de play */
.home-hcard-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 5;
}

.home-hcard:hover .home-hcard-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.home-hcard-play {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 229, 255, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.home-hcard:hover .home-hcard-play {
    background: rgba(0, 229, 255, 0.9);
    transform: scale(1);
    border-color: rgba(255, 255, 255, 0.3);
}

.home-hcard-play i {
    color: #fff;
    font-size: 20px;
    margin-left: 3px;
}

/* Contenido de card horizontal */
.home-hcard-content {
    padding: 12px;
    background: rgba(30, 41, 59, 0.8);
}

.home-hcard-title {
    color: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.home-hcard:hover .home-hcard-title {
    color: #00e5ff;
}

/* Responsive para horizontal scroll */
@media (max-width: 768px) {
    .home-hcard {
        width: 140px;
    }
    
    .home-hcard-content {
        padding: 8px;
    }
    
    .home-hcard-title {
        font-size: 11px;
    }
    
    .home-hcard-badge {
        font-size: 8px;
        padding: 2px 6px;
    }
    
    .home-hcard-type {
        font-size: 8px;
        padding: 2px 6px;
    }
    
    .home-hcard-play {
        width: 40px;
        height: 40px;
    }
    
    .home-hcard-play i {
        font-size: 14px;
    }
    
    .home-section-header h2 {
        font-size: 18px;
    }
}