/**
 * ============================================
 * CUSTOM CSS - Estilos Personalizados
 * ============================================
 *
 * Este archivo contiene estilos personalizados adicionales
 * que complementan Tailwind CSS.
 *
 * @author HentaiSD
 * @version 1.0
 */

/* ============================================
   BÚSQUEDA - Animaciones y transiciones
   ============================================ */

/* Contenedor de búsqueda con animación suave */
#searchContainer {
    transition: all 0.3s ease-in-out;
    opacity: 0;
    transform: translateX(-10px);
}

#searchContainer.show {
    opacity: 1;
    transform: translateX(0);
}

/* Input de búsqueda más grande cuando está visible */
#searchContainer.show #searchInput {
    width: 400px;
    min-width: 300px;
}

/* Animación del botón de cerrar */
#searchCloseButton {
    transition: all 0.2s ease-in-out;
}

#searchCloseButton:hover {
    transform: rotate(90deg);
    color: #ef4444; /* red-500 */
}

/* Ocultar ícono de lupa cuando el input está visible */
#searchIconButton.hidden {
    display: none;
}

/* ============================================
   BOTONES LOGIN Y REGISTRO
   ============================================ */

/* Espaciado entre ícono y texto en botones */
.btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   ANIMACIONES GENERALES
   ============================================ */

/* Animación de fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* ============================================
   MENÚ MÓVIL
   ============================================ */

/* Menú móvil - Oculto inicialmente */
#mobileMenu.hidden {
    display: none !important;
}

/* Menú móvil - Oculto por defecto */
#mobileMenu.hidden {
    display: none !important;
}

/* Menú móvil - Visible cuando NO tiene hidden */
#mobileMenu:not(.hidden) {
    display: block;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Panel del menú móvil - Asegurar que esté fuera de la pantalla inicialmente */
#mobileMenuPanel {
    transition: transform 0.3s ease-in-out;
    will-change: transform;
}

/* Panel fuera de la pantalla por defecto */
#mobileMenuPanel.translate-x-full {
    transform: translateX(100%);
}

/* Panel en su posición cuando tiene translate-x-0 */
#mobileMenuPanel.translate-x-0 {
    transform: translateX(0) !important;
}

/* Búsqueda móvil dentro del menú */
#mobileSearchContainer {
    transition: all 0.3s ease-in-out;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

#mobileSearchContainer.show {
    opacity: 1;
    max-height: 200px;
    margin-top: 0.5rem;
}

/* Búsqueda móvil del header (independiente) */
#mobileSearchHeaderContainer {
    transition: all 0.3s ease-in-out;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

#mobileSearchHeaderContainer.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Animación del botón de cerrar búsqueda móvil */
#mobileSearchCloseButton {
    transition: all 0.2s ease-in-out;
}

#mobileSearchCloseButton:hover {
    transform: rotate(90deg);
    color: #ef4444; /* red-500 */
}

/* ============================================
   RESPONSIVE - Ajustes para móvil
   ============================================ */

@media (max-width: 768px) {
    /* Input más pequeño en móvil */
    #searchContainer.show #searchInput {
        width: 280px;
        min-width: 250px;
    }
}

@media (max-width: 640px) {
    /* Input aún más pequeño en móviles pequeños */
    #searchContainer.show #searchInput {
        width: 240px;
        min-width: 200px;
    }
}

/* ============================================
   FILTROS Y CATÁLOGO
   ============================================ */

/* Botones de filtro de letras activos */
.letter-filter.active {
    background-color: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #ef4444 !important;
}

/* ============================================
   SELECTS MODERNOS
   ============================================ */

/* Selects personalizados - Estilo moderno */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: rgba(255, 255, 255, 0.05);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ef4444'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    padding-right: 2.75rem;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

/* Hover state */
select:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Focus state */
select:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Active state */
select:active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Estilos para las opciones del select */
select option {
    background-color: #1e293b; /* slate-800 */
    color: #ffffff;
    padding: 0.75rem 1rem;
    border: none;
}

/* Hover en opciones (solo funciona en algunos navegadores) */
select option:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

/* Opción seleccionada */
select option:checked {
    background-color: rgba(239, 68, 68, 0.3);
    color: #ffffff;
}

/* Firefox: Estilos para el dropdown */
@-moz-document url-prefix() {
    select {
        background-color: rgba(255, 255, 255, 0.05);
    }

    select option {
        background-color: #1e293b;
        color: #ffffff;
    }
}

/* Webkit (Chrome, Safari, Edge): Estilos para el dropdown */
select::-webkit-select-menu {
    background-color: #1e293b;
}

/* Contenedor wrapper para select (opcional, para más control) */
.select-wrapper {
    position: relative;
    display: inline-block;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #ef4444;
    transition: transform 0.3s ease;
}

.select-wrapper:hover::after {
    transform: translateY(-50%) scale(1.1);
}

/* Vista de lista para cards */
#catalogGrid.list-view .group {
    flex-direction: row !important;
}

#catalogGrid.list-view .group > div {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    width: 100%;
}

#catalogGrid.list-view .group .relative.h-96 {
    height: 200px;
    width: 150px;
    flex-shrink: 0;
}

/* Animación de carga de resultados */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.catalog-item {
    animation: fadeInUp 0.3s ease-out;
}

/* Estilos para paginación activa */
.pagination-button.active {
    background-color: #dc2626;
    border-color: #dc2626;
    color: white;
}

/* ============================================
   GÉNEROS SELECCIONABLES
   ============================================ */

/* Estilos para checkboxes de géneros */
.genre-checkbox {
    position: relative;
    user-select: none;
}

.genre-checkbox.active {
    background-color: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #ef4444 !important;
}

.genre-checkbox.active .genre-label {
    color: #ef4444;
    font-weight: 600;
}

/* Scrollbar personalizado para el contenedor de géneros */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(239, 68, 68, 0.5);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(239, 68, 68, 0.7);
}

/* Responsive para filtros en móvil */
@media (max-width: 1024px) {
    /* En móvil, los filtros pueden ser un acordeón */
    aside {
        margin-bottom: 2rem;
    }
}

/* ============================================
   ANIMACIONES PARA SELECTOR DE FECHA
   ============================================ */

/* Animación shimmer para efecto de brillo en botones de mes */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.animate-shimmer {
    animation: shimmer 0.6s ease-in-out;
}

