/**
 * Custom Dropdown Styles für Locations Filter
 */

.locations-filter-container {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* Custom Dropdown Container */
.custom-dropdown {
    position: relative;
    min-width: 280px;
    flex: 1;
    transition: all 0.3s ease;
    /* border-radius: 25px 25px 25px 25px; */
    /* border: 2px solid var(--clr-blue); */
}

/* Dropdown Header */
.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;    
    transition: all 0.2s ease;
    background-color: white;
    border-radius: 100vmax;
    border: 2px solid var(--clr-blue);
}

.dropdown-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--clr-blue-dark);
    flex: 1;
}

.dropdown-icon {
    width: 12px;
    height: 12px;
    transition: transform 0.3s ease;
    color: #666666;
    flex-shrink: 0;
    margin-left: 10px;
}
.custom-dropdown.active .dropdown-header{
    border-radius: 25px 25px 0 0;
    border-bottom: 0px solid var(--clr-blue);
}
.custom-dropdown.active .dropdown-icon {
    transform: rotate(180deg);
    color: var(--clr-purple-dark);
}

/* Dropdown Content */
.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid var(--clr-blue);
    border-radius: 0 0 8px 8px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    width: 100%;
}

.custom-dropdown.active .dropdown-content {
    max-height: 400px;
    opacity: 1;
    visibility: visible;
    overflow-y: auto;
}

/* Dropdown Options */
.dropdown-option {
    padding: 12px 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--clr-blue-dark);
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--clr-blue);
    width: 100%;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background-color: #f0f7ff;
    color: var(--clr-purple-dark);
}

.dropdown-option.selected {
    background-color: #e6f3ff;
    color: var(--clr-purple-dark);
    font-weight: 700;
    position: relative;
}

.dropdown-option.selected::after {
    content: '✓';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #007cba;
    font-weight: bold;
}

/* Scrollbar Styling für Dropdown */
.dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.dropdown-content::-webkit-scrollbar-track {
    background: var(--clr-blue);
    border-radius: 0 8px 8px 0;
}

.dropdown-content::-webkit-scrollbar-thumb {
    background: var(--clr-blue-dark);
    border-radius: 3px;
}

.dropdown-content::-webkit-scrollbar-thumb:hover {
    background: var(--clr-purple-dark);
}

/* Active State für ausgewählte Werte */
.custom-dropdown.has-selection .dropdown-title {
    color: var(--clr-purple-dark);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .locations-filter-container {
        gap: 12px;
    }
    
    .custom-dropdown {
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .locations-filter-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .custom-dropdown {
        min-width: 100%;
        width: 100%;
    }
    
    .dropdown-title {
        font-size: 14px;
    }
    
    .dropdown-option {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Animation für Dropdown Öffnen */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-dropdown.active .dropdown-content {
    animation: slideDown 0.3s ease-out;
}

.dropdown-option:focus {
    background-color: #f0f7ff;
    outline: none;
}

/* Disabled State */
.custom-dropdown.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.custom-dropdown.disabled .dropdown-header {
    cursor: not-allowed;
    background-color: #f5f5f5;
}

/* Loading State */
.custom-dropdown.loading .dropdown-header::after {
    content: '';
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top-color: #007cba;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Placeholder für leere Dropdowns */
.dropdown-content:empty::after {
    content: 'Keine Optionen verfügbar';
    display: block;
    padding: 12px 16px;
    color: #999999;
    font-size: 14px;
    font-style: italic;
    text-align: center;
}
