/**
 * Location Autocomplete Styles
 * RTL/LTR compatible, Booking Core theme integration
 * Professional Redesign - V2
 */

.location-autocomplete-wrapper {
    position: relative;
}

.location-autocomplete-results {
    position: absolute;
    z-index: 9999;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Subtle border */
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.05);
    max-height: 380px;
    overflow-y: auto;
    width: 100%;
    min-width: 320px;
    margin-top: 15px;
    top: 100%;
    left: 0;
    padding: 12px;
    box-sizing: border-box;
    /* Ensure padding doesn't affect width */
}

/* Ensure list reset */
.autocomplete-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 10px;
    border: 1px solid #f0f0f0;
    background: #ffffff;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
    /* Contain children */
}

/* Remove any default list markers */
.autocomplete-item::before,
.autocomplete-item::after {
    display: none !important;
    content: none !important;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: #f8fbff;
    border-color: #5191fa;
    box-shadow: 0 4px 15px rgba(81, 145, 250, 0.15);
    transform: translateY(-2px);
}

.location-icon {
    width: 40px;
    height: 40px;
    background: #f1f7ff;
    border-radius: 12px;
    /* Softer square */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5191fa;
    flex-shrink: 0;
    font-size: 18px;
    transition: all 0.2s ease;
}

.autocomplete-item:hover .location-icon {
    background: #5191fa;
    color: #ffffff;
}

.location-content {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.location-title {
    font-weight: 700;
    color: #1a2b48;
    font-size: 15px;
    margin-bottom: 3px;
    line-height: 1.2;
}

.location-meta {
    font-size: 13px;
    color: #818d9d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.location-badge {
    flex-shrink: 0;
    margin-inline-start: auto;
    /* Push to the end based on direction */
    padding-left: 10px;
    /* Spacer */
}

/* Specific Badge Style */
.location-badge .badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.5px;
    background-color: #e3f2fd;
    color: #1976d2;
    border: none;
}

.autocomplete-loading,
.autocomplete-item.no-results {
    padding: 30px 20px;
    text-align: center;
    color: #666;
    background: transparent;
    border: none;
    box-shadow: none;
    font-weight: 500;
}

/* RTL Support - Strict overrides */
[dir="rtl"] .location-autocomplete-results {
    text-align: right;
    right: 0;
    left: auto;
}

[dir="rtl"] .autocomplete-item {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .location-icon {
    margin-left: 0;
    /* Clear left margin if any */
}

/* Ensure gap works in older browsers or add fallback margins */
/* For RTL: Icon is first, Content is second. Gap handles spacing. */

/* LTR Support */
[dir="ltr"] .location-autocomplete-results {
    text-align: left;
    left: 0;
    right: auto;
}

[dir="ltr"] .autocomplete-item {
    text-align: left;
    direction: ltr;
}

/* Scrollbar styling */
.location-autocomplete-results::-webkit-scrollbar {
    width: 8px;
}

.location-autocomplete-results::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.location-autocomplete-results::-webkit-scrollbar-thumb {
    background: #dce0e5;
    border-radius: 4px;
}

.location-autocomplete-results::-webkit-scrollbar-thumb:hover {
    background: #cdd5df;
}