/**
 * Search Location Styles
 * Dropdown suggestions for location search
 */

/* Location suggestions container */
.location-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 2px;
}

/* Form group positioning */
.form-group {
    position: relative;
}

.felan-form-location {
    position: relative;
}

/* Ensure archive search inputs have proper parent positioning */
.archive-search-location {
    position: relative;
}

.archive-search-location + .location-suggestions,
.input-search-location + .location-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
}

/* Loading state */
.location-suggestions.loading {
    padding: 12px 16px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.location-suggestions.loading .fa-spinner {
    margin-right: 8px;
}

/* Error state */
.location-suggestions.error {
    padding: 12px 16px;
    text-align: center;
    color: #e74c3c;
    font-size: 14px;
    background-color: #fdf2f2;
}

.location-suggestions.error .fa-exclamation-triangle {
    margin-right: 8px;
}

/* No results state */
.location-suggestions.no-results {
    padding: 12px 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
    font-style: italic;
}

/* Suggestion items */
.suggestion-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.highlighted {
    background-color: #f8f9fa;
}

/* Suggestion content */
.suggestion-primary {
    font-weight: 500;
    color: #333;
    font-size: 14px;
    margin-bottom: 2px;
}

.suggestion-secondary {
    font-size: 12px;
    color: #666;
    line-height: 1.3;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .location-suggestions {
        max-height: 250px;
    }
    
    .suggestion-item {
        padding: 10px 12px;
    }
    
    .suggestion-primary {
        font-size: 13px;
    }
    
    .suggestion-secondary {
        font-size: 11px;
    }
}

/* Custom scrollbar for suggestions */
.location-suggestions::-webkit-scrollbar {
    width: 6px;
}

.location-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.location-suggestions::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.location-suggestions::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation for dropdown */
.location-suggestions {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus styles for accessibility */
.suggestion-item:focus {
    outline: 2px solid #007cba;
    outline-offset: -2px;
    background-color: #f0f8ff;
}

/* Archive specific adjustments */
.archive-filter .location-suggestions,
.form-archive-top-filter .location-suggestions {
    border-color: #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Theme integration */
.location-suggestions {
    font-family: inherit;
}

.suggestion-item {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

/* Dark theme support (if needed) */
@media (prefers-color-scheme: dark) {
    .location-suggestions {
        background: #2c2c2c;
        border-color: #444;
        color: #fff;
    }
    
    .suggestion-item:hover,
    .suggestion-item.highlighted {
        background-color: #3a3a3a;
    }
    
    .suggestion-primary {
        color: #fff;
    }
    
    .suggestion-secondary {
        color: #ccc;
    }
    
    .location-suggestions.no-results {
        color: #aaa;
    }
    
    .location-suggestions.error {
        background-color: #3c1f1f;
        color: #ff6b6b;
    }
}