/* Location Filter Component Styles */

/* Ensure mobile filters are hidden on desktop */
@media (min-width: 992px) {
    #mobileFilters {
        display: none !important;
    }
    
    .d-lg-none {
        display: none !important;
    }
}

/* Ensure desktop filters are hidden on mobile */
@media (max-width: 991.98px) {
    .d-none.d-lg-flex {
        display: none !important;
    }
}

.location-filter-container {
    position: relative;
    width: 100%;
}

.location-filter-display {
    position: relative;
    padding-right: 30px; /* Space for clear button */
}

.location-filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.location-filter-loading {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-top: none;
    padding: 0.75rem;
    text-align: center;
    color: #6c757d;
    display: none;
    z-index: 1001;
    border-radius: 0 0 0.375rem 0.375rem;
}

.location-filter-section {
    border-bottom: 1px solid #f8f9fa;
}

.location-filter-section:last-child {
    border-bottom: none;
}

.location-filter-section-header {
    background: #f8f9fa;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
    letter-spacing: 0.025em;
}

.location-filter-option {
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.15s ease-in-out;
}

.location-filter-option:last-child {
    border-bottom: none;
}

.location-filter-option:hover {
    background-color: #f8f9fa;
}

.location-filter-option.selected {
    background-color: #e3f2fd;
    color: #1976d2;
}

.location-filter-option-name {
    flex: 1;
    font-size: 0.875rem;
}

.location-filter-option-count {
    font-size: 0.75rem;
    color: #6c757d;
    background: #e9ecef;
    padding: 0.125rem 0.375rem;
    border-radius: 0.625rem;
    margin-left: 0.5rem;
    min-width: 1.25rem;
    text-align: center;
}

.location-filter-option.popular .location-filter-option-name::before {
    content: "⭐ ";
    color: #ffc107;
    margin-right: 0.25rem;
}

.location-filter-option.recent .location-filter-option-name::before {
    content: "🕒 ";
    margin-right: 0.25rem;
}

.location-filter-section-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recent-clear-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 0.75rem;
    transition: all 0.15s ease-in-out;
}

.recent-clear-btn:hover {
    background: #e9ecef;
    color: #333;
}

.location-filter-no-results {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    font-size: 0.875rem;
}

.location-filter-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.125rem;
    border-radius: 50%;
    width: 1.25rem;
    height: 1.25rem;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    line-height: 1;
    transition: all 0.15s ease-in-out;
}

.location-filter-clear:hover {
    background: #f0f0f0;
    color: #495057;
}

.location-filter-display.has-value + .location-filter-clear {
    display: flex;
}

/* Bootstrap form integration */
.location-filter-container .form-control {
    position: relative;
}

.location-filter-dropdown.show {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .location-filter-dropdown {
        max-height: 250px;
        font-size: 0.875rem;
    }
    
    .location-filter-option {
        padding: 0.75rem;
    }
    
    .location-filter-section-header {
        padding: 0.625rem 0.75rem;
        font-size: 0.6875rem;
    }
    
    .location-filter-option-name {
        font-size: 0.8125rem;
    }
    
    .location-filter-option-count {
        font-size: 0.6875rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .location-filter-dropdown {
        background: #212529;
        border-color: #495057;
    }
    
    .location-filter-loading {
        background: #212529;
        border-color: #495057;
        color: #adb5bd;
    }
    
    .location-filter-section-header {
        background: #343a40;
        color: #adb5bd;
        border-color: #495057;
    }
    
    .location-filter-option {
        border-color: #343a40;
        color: #f8f9fa;
    }
    
    .location-filter-option:hover {
        background-color: #343a40;
    }
    
    .location-filter-option.selected {
        background-color: #0d47a1;
        color: #fff;
    }
    
    .location-filter-option-count {
        background: #495057;
        color: #adb5bd;
    }
    
    .location-filter-no-results {
        color: #adb5bd;
    }
    
    .location-filter-clear {
        color: #adb5bd;
    }
    
    .location-filter-clear:hover {
        background: #495057;
        color: #f8f9fa;
    }
}

/* Focus states for accessibility */
.location-filter-display:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.location-filter-option:focus {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
}

.location-filter-clear:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Animation for dropdown appearance */
.location-filter-dropdown {
    opacity: 0;
    transform: translateY(-0.5rem);
    transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out;
}

.location-filter-dropdown.show {
    opacity: 1;
    transform: translateY(0);
}

/* Scrollbar styling */
.location-filter-dropdown::-webkit-scrollbar {
    width: 0.375rem;
}

.location-filter-dropdown::-webkit-scrollbar-track {
    background: #f1f3f4;
}

.location-filter-dropdown::-webkit-scrollbar-thumb {
    background: #c1c8cd;
    border-radius: 0.1875rem;
}

.location-filter-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a8b2ba;
}