/**
 * Location Autocomplete Styles - WASM Premium Redesign
 * Optimized for RTL, Modern Glassmorphism, and Smooth Transitions
 */

.location-autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.location-autocomplete-results {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    z-index: 1050; /* Ensure it stays above other elements but below modals if needed */
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), 0 0 1px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(226, 232, 240, 0.8);
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
    animation: wasmSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top center;
}

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

/* List container */
.autocomplete-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Individual Item */
.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.autocomplete-item.selected {
    background: #eef2ff;
    border-color: #c7d2fe;
}

/* Icon */
.location-icon {
    width: 42px;
    height: 42px;
    background: #f8fafc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.autocomplete-item:hover .location-icon,
.autocomplete-item.selected .location-icon {
    background: #3b82f6;
    color: #ffffff;
}

/* Content */
.location-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.location-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.location-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

/* Badge */
.location-badge {
    padding-left: 8px;
}

.location-badge .badge {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 6px;
}

/* Empty/Loading States */
.autocomplete-loading,
.autocomplete-item.no-results {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
}

.autocomplete-loading::after {
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    margin: 10px auto 0;
    animation: wasmSpinner 0.8s linear infinite;
}

@keyframes wasmSpinner {
    to { transform: rotate(360deg); }
}

/* RTL Support */
[dir="rtl"] .location-autocomplete-results {
    left: 0;
    right: 0;
    text-align: right;
}

[dir="rtl"] .autocomplete-item {
    flex-direction: row;
}

[dir="rtl"] .location-badge {
    margin-right: auto;
    margin-left: 0;
}

/* Scrollbar Customization */
.location-autocomplete-results::-webkit-scrollbar {
    width: 6px;
}
.location-autocomplete-results::-webkit-scrollbar-track {
    background: transparent;
}
.location-autocomplete-results::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}
.location-autocomplete-results::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}