/* Location Search Box Styles */
.location-search-box {
    position: relative;
    width: 100%;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.location-search-input {
    width: 100%;
    padding: 12px 16px;
    padding-right: 40px; /* Space for loading spinner */
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background-color: #ffffff;
    transition: all 0.2s ease;
    outline: none;
}

.location-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.location-search-input:disabled {
    background-color: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

.search-loading {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 14px;
}

/* Suggestions Dropdown */
.location-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-height: 240px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f3f4f6;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: #f8fafc;
}

.suggestion-item.selected {
    background-color: #eff6ff;
}

.suggestion-main {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.suggestion-main i {
    color: #6b7280;
    font-size: 14px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.address-type .suggestion-main i {
    color: #ef4444;
}

.city-name {
    font-weight: 500;
    color: #111827;
    font-size: 14px;
    flex: 1;
}

.zipcode {
    background-color: #f3f4f6;
    color: #6b7280;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-left: auto;
    white-space: nowrap;
}

.address-type .zipcode {
    background-color: #fef2f2;
    color: #dc2626;
}

.suggestion-details {
    padding-left: 24px;
    font-size: 12px;
    color: #6b7280;
}

.locality,
.region,
.country {
    font-size: 12px;
}

.locality {
    font-weight: 500;
    color: #4b5563;
}

/* No Results Message */
.no-suggestions {
    padding: 16px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 8px 8px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
}

.no-suggestions i {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .location-search-input {
        padding: 10px 14px;
        padding-right: 36px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .location-suggestions {
        max-height: 200px;
    }
    
    .suggestion-item {
        padding: 10px 14px;
    }
    
    .suggestion-main {
        gap: 6px;
    }
    
    .suggestion-details {
        padding-left: 20px;
    }
}

/* Loading Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.search-loading .fa-spinner {
    animation: spin 1s linear infinite;
}

/* Focus trap for accessibility */
.location-search-box:focus-within .location-suggestions {
    border-color: #3b82f6;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .location-search-input {
        border-color: #000000;
    }
    
    .location-search-input:focus {
        border-color: #0066cc;
        box-shadow: 0 0 0 2px #0066cc;
    }
    
    .suggestion-item.selected {
        background-color: #0066cc;
        color: #ffffff;
    }
}

/* Selected Country Info */
.selected-country-info {
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #0c4a6e;
}

.selected-country-info i {
    color: #0ea5e9;
    font-size: 14px;
}

.selected-country-info span {
    font-weight: 500;
}

/* Disabled State */
.location-search-disabled {
    position: relative;
}

.location-search-disabled .location-search-input {
    background-color: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

.helper-text {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

.helper-text i {
    color: #3b82f6;
    font-size: 12px;
}

/* Auto-filled fields styling */
.location-search-input.auto-filled {
    background-color: #f0f9ff;
    border-color: #0ea5e9;
    color: #0c4a6e;
}

.location-search-input.auto-filled:read-only {
    cursor: default;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .location-search-input,
    .suggestion-item {
        transition: none;
    }
    
    .search-loading .fa-spinner {
        animation: none;
    }
} 