/**
 * Yandex Location Autocomplete Styles
 * Version: 2.0.0
 */

/* Enhanced Select2 styling for Yandex integration */
.select2-container--default .select2-results__option--highlighted[data-selected] {
    background-color: #0073aa !important;
    color: white !important;
}

.select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: #f0f0f0 !important;
    color: #333 !important;
}

/* Yandex result styling */
.select2-results__option .yandex-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.select2-results__option .yandex-badge {
    background-color: #0073aa;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

/* Separator styling */
.select2-results__option[aria-disabled="true"] {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    font-style: italic;
    font-size: 12px;
    text-align: center;
    padding: 8px 12px !important;
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
}

/* Search input styling */
.select2-search--inline .select2-search__field {
    font-size: 14px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.select2-search--inline .select2-search__field:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Results container styling */
.select2-results {
    max-height: 300px;
    overflow-y: auto;
}

.select2-results__options {
    padding: 0;
}

.select2-results__option {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.select2-results__option:hover {
    background-color: #f8f9fa;
}

.select2-results__option:last-child {
    border-bottom: none;
}

/* Loading state */
.select2-results__option.loading-results {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 16px 12px;
}

/* No results state */
.select2-results__option.select2-results__message {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 16px 12px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .select2-container {
        width: 100% !important;
    }
    
    .select2-dropdown {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .select2-results__option {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .select2-search--inline .select2-search__field {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Enhancement for booking form containers */
.input-block .select2-container {
    width: 100% !important;
}

.input-block .select2-selection {
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 40px;
    background-color: white;
}

.input-block .select2-selection__rendered {
    padding: 8px 12px;
    line-height: 24px;
    color: #333;
}

.input-block .select2-selection__placeholder {
    color: #999;
}

.input-block .select2-selection__arrow {
    height: 38px;
    position: absolute;
    top: 1px;
    right: 1px;
    width: 20px;
}

/* Focus state */
.select2-container--focus .select2-selection {
    border-color: #0073aa !important;
    box-shadow: 0 0 0 1px #0073aa !important;
}

/* Clear button styling */
.select2-selection__clear {
    color: #999;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    margin-right: 20px;
}

.select2-selection__clear:hover {
    color: #666;
}

/* Dropdown positioning */
.select2-dropdown {
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.select2-dropdown--above {
    border-top: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

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

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

/* Accessibility improvements */
.select2-container--default .select2-selection--single:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.select2-container--default .select2-results__option[aria-selected="true"]:not([data-selected]) {
    background-color: #e6f3ff;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .select2-container--default .select2-selection {
        border: 2px solid #000;
    }
    
    .select2-container--default .select2-results__option--highlighted {
        background-color: #000 !important;
        color: #fff !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .select2-dropdown {
        animation: none;
    }
    
    .select2-results__option {
        transition: none;
    }
} 