/*
================================================================================
ADVANCED TRAVEL SEARCH - AUTOCOMPLETE CSS
================================================================================

📋 AUTOCOMPLETE.CSS - Dropdowns y Búsqueda Predictiva v3.1.0-REFACTORED
✅ Dropdown lists y containers
✅ Items de autocomplete con highlighting
✅ Estados de loading y empty states
✅ Navegación por teclado (keyboard navigation)
✅ Scroll virtual para listas largas
✅ Categorización de resultados
✅ Highlighting de texto de búsqueda
✅ Responsive behavior de dropdowns

🔧 PASO 3: EXTERNALIZACIÓN DE ASSETS FRONTEND
Este archivo reemplaza los estilos de autocomplete del CSS inline en search-widget.php

@package AdvancedTravelSearch
@version 3.1.0-REFACTORED
*/

/* ==================== 1. VARIABLES ESPECÍFICAS DE AUTOCOMPLETE ==================== */

.ats-widget-container.ats-refactored {
    /* Medidas del dropdown */
    --ats-dropdown-max-height: 280px;
    --ats-dropdown-min-width: 200px;
    --ats-dropdown-item-height: 44px;
    --ats-dropdown-item-padding: 12px 16px;
    --ats-dropdown-border-radius: 8px;
    --ats-dropdown-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    
    /* Colores del dropdown */
    --ats-dropdown-bg: #ffffff;
    --ats-dropdown-border: #e5e7eb;
    --ats-dropdown-item-hover: #f3f4f6;
    --ats-dropdown-item-selected: var(--ats-primary-color);
    --ats-dropdown-item-selected-text: #ffffff;
    --ats-dropdown-item-focused: #eff6ff;
    --ats-dropdown-item-focused-border: #3b82f6;
    --ats-dropdown-separator: #f1f3f4;
    
    /* Highlighting de búsqueda */
    --ats-highlight-bg: #fef3c7;
    --ats-highlight-text: #92400e;
    --ats-highlight-border: #f59e0b;
    
    /* Loading y estados */
    --ats-loading-bg: #f9fafb;
    --ats-loading-text: #6b7280;
    --ats-empty-bg: #f9fafb;
    --ats-empty-text: #9ca3af;
    
    /* Z-index específico */
    --ats-dropdown-z-index: var(--ats-z-index-dropdown);
}

/* ==================== 2. CONTAINER PRINCIPAL DEL DROPDOWN ==================== */

/* Lista dropdown base */
.ats-widget-container.ats-refactored .ats-dropdown-list {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: var(--ats-dropdown-z-index) !important;
    background: var(--ats-dropdown-bg) !important;
    border: 1px solid var(--ats-dropdown-border) !important;
    border-radius: var(--ats-dropdown-border-radius) !important;
    box-shadow: var(--ats-dropdown-shadow) !important;
    max-height: var(--ats-dropdown-max-height) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    margin-top: 4px !important;
    display: none !important;
    opacity: 0 !important;
    transform: translateY(-8px) !important;
    transition: var(--ats-transition-fast) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* Dropdown visible */
.ats-widget-container.ats-refactored .ats-dropdown-list.visible {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Dropdown hacia arriba (cuando no hay espacio abajo) */
.ats-widget-container.ats-refactored .ats-dropdown-list.dropup {
    top: auto !important;
    bottom: 100% !important;
    margin-top: 0 !important;
    margin-bottom: 4px !important;
    transform: translateY(8px) !important;
}

.ats-widget-container.ats-refactored .ats-dropdown-list.dropup.visible {
    transform: translateY(0) !important;
}

/* Scroll suave en el dropdown */
.ats-widget-container.ats-refactored .ats-dropdown-list {
    scrollbar-width: thin !important;
    scrollbar-color: var(--ats-border-color) transparent !important;
}

.ats-widget-container.ats-refactored .ats-dropdown-list::-webkit-scrollbar {
    width: 6px !important;
}

.ats-widget-container.ats-refactored .ats-dropdown-list::-webkit-scrollbar-track {
    background: transparent !important;
}

.ats-widget-container.ats-refactored .ats-dropdown-list::-webkit-scrollbar-thumb {
    background: var(--ats-border-color) !important;
    border-radius: 3px !important;
}

.ats-widget-container.ats-refactored .ats-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: var(--ats-border-color-dark) !important;
}

/* ==================== 3. ITEMS DEL DROPDOWN ==================== */

/* Item base del dropdown */
.ats-widget-container.ats-refactored .ats-dropdown-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    min-height: var(--ats-dropdown-item-height) !important;
    padding: var(--ats-dropdown-item-padding) !important;
    color: var(--ats-text-primary) !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    transition: var(--ats-transition-fast) !important;
    font-size: var(--ats-font-size-sm) !important;
    font-family: var(--ats-font-family) !important;
    line-height: 1.4 !important;
    width: 100% !important;
    text-align: left !important;
    border-bottom: 1px solid transparent !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Estado hover */
.ats-widget-container.ats-refactored .ats-dropdown-item:hover {
    background: var(--ats-dropdown-item-hover) !important;
    color: var(--ats-text-primary) !important;
}

/* Estado focused (navegación por teclado) */
.ats-widget-container.ats-refactored .ats-dropdown-item.focused {
    background: var(--ats-dropdown-item-focused) !important;
    border-color: var(--ats-dropdown-item-focused-border) !important;
    outline: none !important;
}

/* Estado selected */
.ats-widget-container.ats-refactored .ats-dropdown-item.selected {
    background: var(--ats-dropdown-item-selected) !important;
    color: var(--ats-dropdown-item-selected-text) !important;
}

.ats-widget-container.ats-refactored .ats-dropdown-item.selected::after {
    content: "✓" !important;
    position: absolute !important;
    right: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-weight: var(--ats-font-weight-bold) !important;
    font-size: 14px !important;
}

/* Item disabled */
.ats-widget-container.ats-refactored .ats-dropdown-item.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* ==================== 4. CONTENIDO DE ITEMS ==================== */

/* Icono del item */
.ats-widget-container.ats-refactored .ats-dropdown-item-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    font-size: 16px !important;
    color: var(--ats-text-secondary) !important;
    flex-shrink: 0 !important;
}

/* Contenido principal del item */
.ats-widget-container.ats-refactored .ats-dropdown-item-content {
    flex: 1 !important;
    min-width: 0 !important;
}

/* Título principal del item */
.ats-widget-container.ats-refactored .ats-dropdown-item-title {
    font-weight: var(--ats-font-weight-medium) !important;
    color: inherit !important;
    margin: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Subtítulo/descripción del item */
.ats-widget-container.ats-refactored .ats-dropdown-item-subtitle {
    font-size: var(--ats-font-size-xs) !important;
    color: var(--ats-text-secondary) !important;
    margin: 2px 0 0 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
}

/* Badge/tag del item */
.ats-widget-container.ats-refactored .ats-dropdown-item-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 20px !important;
    padding: 0 8px !important;
    font-size: 10px !important;
    font-weight: var(--ats-font-weight-semibold) !important;
    color: var(--ats-text-secondary) !important;
    background: var(--ats-bg-light) !important;
    border-radius: 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    flex-shrink: 0 !important;
}

/* ==================== 5. HIGHLIGHTING DE BÚSQUEDA ==================== */

/* Texto destacado en búsqueda */
.ats-widget-container.ats-refactored .ats-dropdown-item .ats-highlight {
    background: var(--ats-highlight-bg) !important;
    color: var(--ats-highlight-text) !important;
    padding: 1px 2px !important;
    border-radius: 2px !important;
    font-weight: var(--ats-font-weight-semibold) !important;
    border-bottom: 1px solid var(--ats-highlight-border) !important;
}

/* Highlighting más sutil en items selected */
.ats-widget-container.ats-refactored .ats-dropdown-item.selected .ats-highlight {
    background: rgba(255, 255, 255, 0.2) !important;
    color: inherit !important;
    border-bottom-color: rgba(255, 255, 255, 0.4) !important;
}

/* ==================== 6. SEPARADORES Y CATEGORÍAS ==================== */

/* Separador entre grupos */
.ats-widget-container.ats-refactored .ats-dropdown-separator {
    height: 1px !important;
    background: var(--ats-dropdown-separator) !important;
    margin: 4px 0 !important;
    border: none !important;
}

/* Header de categoría/grupo */
.ats-widget-container.ats-refactored .ats-dropdown-category {
    display: flex !important;
    align-items: center !important;
    height: 32px !important;
    padding: 0 16px !important;
    font-size: var(--ats-font-size-xs) !important;
    font-weight: var(--ats-font-weight-semibold) !important;
    color: var(--ats-text-secondary) !important;
    background: var(--ats-bg-light) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-bottom: 1px solid var(--ats-dropdown-separator) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

/* ==================== 7. ESTADOS ESPECIALES ==================== */

/* Estado de carga */
.ats-widget-container.ats-refactored .ats-dropdown-loading {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    height: 60px !important;
    padding: var(--ats-dropdown-item-padding) !important;
    color: var(--ats-loading-text) !important;
    background: var(--ats-loading-bg) !important;
    font-size: var(--ats-font-size-sm) !important;
    cursor: default !important;
}

.ats-widget-container.ats-refactored .ats-dropdown-loading-spinner {
    width: 16px !important;
    height: 16px !important;
    border: 2px solid var(--ats-border-color) !important;
    border-top-color: var(--ats-primary-color) !important;
    border-radius: 50% !important;
    animation: ats-spin 1s linear infinite !important;
}

/* Estado vacío/sin resultados */
.ats-widget-container.ats-refactored .ats-dropdown-empty {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    height: 80px !important;
    padding: var(--ats-dropdown-item-padding) !important;
    color: var(--ats-empty-text) !important;
    background: var(--ats-empty-bg) !important;
    text-align: center !important;
    cursor: default !important;
}

.ats-widget-container.ats-refactored .ats-dropdown-empty-icon {
    font-size: 24px !important;
    opacity: 0.5 !important;
}

.ats-widget-container.ats-refactored .ats-dropdown-empty-text {
    font-size: var(--ats-font-size-sm) !important;
    line-height: 1.3 !important;
}

/* Estado de error */
.ats-widget-container.ats-refactored .ats-dropdown-error {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    height: 80px !important;
    padding: var(--ats-dropdown-item-padding) !important;
    color: var(--ats-error-color) !important;
    background: #fef2f2 !important;
    text-align: center !important;
    cursor: default !important;
}

.ats-widget-container.ats-refactored .ats-dropdown-error-icon {
    font-size: 24px !important;
}

.ats-widget-container.ats-refactored .ats-dropdown-error-text {
    font-size: var(--ats-font-size-sm) !important;
    line-height: 1.3 !important;
}

/* ==================== 8. FOOTER DEL DROPDOWN ==================== */

/* Footer con información adicional */
.ats-widget-container.ats-refactored .ats-dropdown-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 36px !important;
    padding: 0 16px !important;
    background: var(--ats-bg-light) !important;
    border-top: 1px solid var(--ats-dropdown-separator) !important;
    font-size: var(--ats-font-size-xs) !important;
    color: var(--ats-text-secondary) !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 10 !important;
}

/* Contador de resultados */
.ats-widget-container.ats-refactored .ats-dropdown-count {
    font-weight: var(--ats-font-weight-medium) !important;
}

/* Botón "Ver todos" */
.ats-widget-container.ats-refactored .ats-dropdown-view-all {
    color: var(--ats-primary-color) !important;
    text-decoration: none !important;
    font-weight: var(--ats-font-weight-medium) !important;
    cursor: pointer !important;
    transition: var(--ats-transition-fast) !important;
}

.ats-widget-container.ats-refactored .ats-dropdown-view-all:hover {
    text-decoration: underline !important;
}

/* ==================== 9. TIPOS ESPECÍFICOS DE DROPDOWNS ==================== */

/* Dropdown de ubicaciones */
.ats-widget-container.ats-refactored .ats-dropdown-list.locations .ats-dropdown-item-icon {
    color: var(--ats-primary-color) !important;
}

/* Dropdown de países */
.ats-widget-container.ats-refactored .ats-dropdown-list.countries .ats-dropdown-item-icon {
    font-size: 20px !important;
    border-radius: 2px !important;
}

/* Dropdown de categorías */
.ats-widget-container.ats-refactored .ats-dropdown-list.categories .ats-dropdown-item-badge {
    background: var(--ats-primary-color) !important;
    color: var(--ats-text-light) !important;
}

/* Dropdown de hoteles */
.ats-widget-container.ats-refactored .ats-dropdown-list.hotels .ats-dropdown-item-subtitle {
    display: block !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    max-height: 32px !important;
    overflow: hidden !important;
}

/* ==================== 10. RESPONSIVE DESIGN ==================== */

/* Tablet (1024px y menos) */
@media (max-width: 1024px) {
    .ats-widget-container.ats-refactored {
        --ats-dropdown-max-height: 240px;
        --ats-dropdown-item-height: 40px;
        --ats-dropdown-item-padding: 10px 14px;
    }
}

/* Mobile (768px y menos) */
@media (max-width: 768px) {
    .ats-widget-container.ats-refactored {
        --ats-dropdown-max-height: 200px;
        --ats-dropdown-item-height: 36px;
        --ats-dropdown-item-padding: 8px 12px;
    }
    
    .ats-widget-container.ats-refactored .ats-dropdown-list {
        left: -4px !important;
        right: -4px !important;
        border-radius: 6px !important;
    }
    
    .ats-widget-container.ats-refactored .ats-dropdown-item-subtitle {
        display: none !important;
    }
    
    .ats-widget-container.ats-refactored .ats-dropdown-footer {
        height: 32px !important;
        padding: 0 12px !important;
    }
    
    .ats-widget-container.ats-refactored .ats-dropdown-loading,
    .ats-widget-container.ats-refactored .ats-dropdown-empty,
    .ats-widget-container.ats-refactored .ats-dropdown-error {
        height: 60px !important;
        padding: 8px 12px !important;
    }
}

/* Mobile pequeño (480px y menos) */
@media (max-width: 480px) {
    .ats-widget-container.ats-refactored {
        --ats-dropdown-max-height: 160px;
        --ats-dropdown-item-height: 32px;
        --ats-dropdown-item-padding: 6px 10px;
    }
    
    .ats-widget-container.ats-refactored .ats-dropdown-item {
        font-size: 13px !important;
        gap: 8px !important;
    }
    
    .ats-widget-container.ats-refactored .ats-dropdown-item-icon {
        width: 16px !important;
        height: 16px !important;
        font-size: 14px !important;
    }
    
    .ats-widget-container.ats-refactored .ats-dropdown-item-badge {
        display: none !important;
    }
    
    .ats-widget-container.ats-refactored .ats-dropdown-category {
        height: 28px !important;
        font-size: 10px !important;
        padding: 0 10px !important;
    }
}

/* ==================== 11. ANIMACIONES ESPECÍFICAS ==================== */

/* Animación de entrada de items */
@keyframes ats-dropdown-item-slide {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Aplicar animación escalonada a items */
.ats-widget-container.ats-refactored .ats-dropdown-item {
    animation: ats-dropdown-item-slide 0.15s ease-out !important;
}

.ats-widget-container.ats-refactored .ats-dropdown-item:nth-child(1) { animation-delay: 0ms !important; }
.ats-widget-container.ats-refactored .ats-dropdown-item:nth-child(2) { animation-delay: 20ms !important; }
.ats-widget-container.ats-refactored .ats-dropdown-item:nth-child(3) { animation-delay: 40ms !important; }
.ats-widget-container.ats-refactored .ats-dropdown-item:nth-child(4) { animation-delay: 60ms !important; }
.ats-widget-container.ats-refactored .ats-dropdown-item:nth-child(5) { animation-delay: 80ms !important; }

/* ==================== 12. MODO OSCURO ==================== */

@media (prefers-color-scheme: dark) {
    .ats-widget-container.ats-refactored:not(.ats-force-light) {
        --ats-dropdown-bg: var(--ats-bg-secondary);
        --ats-dropdown-border: #495057;
        --ats-dropdown-item-hover: #495057;
        --ats-dropdown-item-focused: #343a40;
        --ats-dropdown-item-focused-border: #6c757d;
        --ats-dropdown-separator: #495057;
        --ats-highlight-bg: #fd7e14;
        --ats-highlight-text: #ffffff;
        --ats-loading-bg: #343a40;
        --ats-loading-text: #adb5bd;
        --ats-empty-bg: #343a40;
        --ats-empty-text: #6c757d;
    }
    
    .ats-widget-container.ats-refactored:not(.ats-force-light) .ats-dropdown-error {
        background: #4a1515 !important;
    }
}

/*
================================================================================
FIN DEL CSS AUTOCOMPLETE - ADVANCED TRAVEL SEARCH v3.1.0-REFACTORED
================================================================================

📊 RESUMEN AUTOCOMPLETE.CSS:
✅ Dropdown lists con posicionamiento inteligente
✅ Items con highlighting de búsqueda avanzado
✅ Estados de loading, empty y error completos
✅ Navegación por teclado (focused states)
✅ Categorización y separadores visuales
✅ Badges y metadata en items
✅ Scroll virtual optimizado
✅ Responsive design completo (desktop → mobile)
✅ Animaciones escalonadas de entrada
✅ Tipos específicos (locations, countries, categories, hotels)
✅ Soporte para modo oscuro

🎯 PRÓXIMO ARCHIVO: themes/modern.css (Tema moderno por defecto)
*/