/* =============================================================================
   SGCI THEME V2 - FILTROS Y BÚSQUEDA
   Estilos específicos para filtros, búsqueda AJAX y animaciones
   ============================================================================= */

/* =============================================================================
   CONTENEDOR DE FILTROS PROFESIONAL
   ============================================================================= */

.filters-container {
    background: linear-gradient(135deg, var(--sgci-bg-primary) 0%, var(--sgci-gray-50) 100%);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--sgci-shadow-md);
    border: 1px solid var(--sgci-gray-200);
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Botón limpiar filtros - estilo profesional */
#btn-limpiar-filtros {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s ease-in-out;
    pointer-events: none;
    background-color: var(--sgci-danger);
    border-color: var(--sgci-danger);
    color: white;
    font-weight: 500;
    border-radius: 6px;
    padding: 0.65rem 1.2rem;
}

/* Cruz X para cerrar filtros */
.filters-close-x {
    position: absolute;
    top: 6px;
    right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    color: white;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.1);
}

.filters-close-x:hover {
    background-color: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

/* =============================================================================
   FILTROS ACTIVOS CON DISEÑO PROFESIONAL
   ============================================================================= */

.filters-active .filters-container {
    background: var(--sgci-bg-secondary);
    border: 2px solid var(--sgci-primary);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.15);
    transition: all 0.4s ease-in-out;
}

.filters-active .filters-container::before {
    content: "🔍 Filtros activos";
    display: block;
    background: var(--sgci-primary);
    color: white;
    padding: 8px 12px;
    margin: -1.5rem -1.5rem 1rem -1.5rem;
    border-radius: 6px 6px 0 0;
    font-size: var(--sgci-font-size-xs);
    font-weight: 500;
    text-align: center;
    animation: slideDownFade 0.5s ease-out;
}

/* Botón limpiar filtros cuando están activos */
.filters-active #btn-limpiar-filtros {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    background: var(--sgci-warning);
    border-color: var(--sgci-warning);
    color: white;
    pointer-events: auto;
    transition: all 0.3s ease-in-out;
}

.filters-active #btn-limpiar-filtros:hover {
    background-color: #cc6600;
    border-color: #cc6600;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(221, 107, 32, 0.3);
}

/* Mostrar cruz X cuando están activos */
.filters-active .filters-close-x {
    opacity: 1;
    visibility: visible;
}

/* Mejorar contraste de texto en filtros activos */
.filters-active .filters-container label {
    color: var(--sgci-gray-700);
    font-weight: 500;
}

.filters-active .filters-container input,
.filters-active .filters-container select {
    background: white;
    border-color: var(--sgci-gray-300);
}

/* =============================================================================
   EFECTOS DE ANIMACIÓN Y TRANSICIONES
   ============================================================================= */

/* Efecto de salida de filtros */
.filters-container.filter-exit {
    background: var(--sgci-bg-secondary);
    border: 1px solid var(--sgci-gray-300);
    transform: scale(0.98);
    opacity: 0.7;
}

.filters-container.filter-exit::before {
    animation: slideUpFade 0.4s ease-in-out forwards;
}

/* Animaciones suaves */
@keyframes slideDownFade {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpFade {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-15px);
        display: none;
    }
}

/* Efecto especial para sección activa */
.filters-active .sgci-table-container {
    animation: highlightSection 0.8s ease-out;
    box-shadow: 0 8px 25px rgba(0, 115, 170, 0.15);
    border-radius: 8px;
    overflow: hidden;
}

@keyframes highlightSection {
    0% {
        transform: scale(0.98);
        box-shadow: var(--sgci-shadow);
    }
    50% {
        transform: scale(1.01);
        box-shadow: 0 12px 30px rgba(0, 115, 170, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(0, 115, 170, 0.15);
    }
}

/* =============================================================================
   BÚSQUEDA/AUTOCOMPLETAR PROFESIONAL
   ============================================================================= */

.sgci-search-results {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    border: 1px solid var(--sgci-gray-300) !important;
    border-top: none !important;
    max-height: 250px !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
    box-shadow: var(--sgci-shadow-lg) !important;
    width: 100% !important;
    display: none;
    border-radius: 0 0 8px 8px !important;
}

.sgci-search-results .sgci-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--sgci-gray-100);
    transition: background-color 0.2s ease;
}

.sgci-search-results .sgci-item:last-child {
    border-bottom: none;
}

.sgci-search-results .sgci-item:hover {
    background: var(--sgci-gray-50);
}

.sgci-search-results .sgci-item.active {
    background: var(--sgci-gray-100);
}

.sgci-search-results .sgci-codigo {
    font-weight: 600;
    color: var(--sgci-primary);
}

.sgci-search-results .sgci-nombre {
    color: var(--sgci-gray-600);
    font-size: var(--sgci-font-size-sm);
    margin-top: 2px;
}

.sgci-search-results .no-results {
    padding: 16px;
    color: var(--sgci-gray-500);
    font-style: italic;
    text-align: center;
}

/* Contenedores de filtros con búsqueda */
.cell.medium-2, .cell.medium-3, .cell.medium-4, .cell.medium-6 {
    position: relative;
}

 