/* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
    width: 100%;
    min-height: 44px;
}

/* Disable focus states on parent containers when they contain custom dropdowns */
.form-group:has(.custom-dropdown):focus-within,
.date-passengers-row:has(.custom-dropdown):focus-within,
.selector-row:has(.custom-dropdown):focus-within {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}


.custom-dropdown__selection {
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.15);
    border-bottom-color: rgba(255, 255, 255, 0.05);
    border-radius: 0.25rem;
    padding: 10px 40px 10px 12px;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #fff;
    font-size: 1rem;
    line-height: 1.4;
    box-sizing: border-box;
    transition: all 0.2s ease;
    position: relative;
}

.custom-dropdown__selection:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.custom-dropdown.open .custom-dropdown__selection {
    border-color: #67d9fc;
    background: rgba(103, 217, 252, 0.05);
}

.custom-dropdown.disabled .custom-dropdown__selection {
    background: rgba(255, 255, 255, 0.02);
    cursor: not-allowed;
    opacity: 0.6;
}

.custom-dropdown__text {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
}

.custom-dropdown:not(.has-value) .custom-dropdown__text {
    color: rgba(255, 255, 255, 0.5);
}

.custom-dropdown__arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    transition: transform 0.2s ease;
    pointer-events: none;
}

.custom-dropdown.open .custom-dropdown__arrow {
    transform: translateY(-50%) rotate(180deg);
}

.custom-dropdown__list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #242424;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.custom-dropdown.open .custom-dropdown__list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-dropdown__item {
    padding: 12px;
    cursor: pointer;
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.4;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-dropdown__item:last-child {
    border-bottom: none;
}

.custom-dropdown__item:hover,
.custom-dropdown__item.focused {
    background: #67d9fc;
    color: #242424;
}

.custom-dropdown__item.selected {
    background: #0ea5b6;
    color: #ffffff;
}

.custom-dropdown__item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.3) !important;
}

/* Floating label behavior matching Date field */
.form-group .custom-dropdown ~ label,
.date-passengers-row .custom-dropdown ~ label {
    position: absolute;
    left: 12px;
    /* Default state: centered like placeholder */
    top: 50%;
    transform: translateY(-50%);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    transition: all 0.3s ease;
    pointer-events: none;
    background: transparent;
    padding: 0 4px;
    z-index: 2;
    opacity: 1;
    visibility: visible;
}

/* When has value or focused, move label to top */
.custom-dropdown.has-value ~ label,
.custom-dropdown.open ~ label {
    /* Float to top when there's content */
    top: 0;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #67d9fc;
    background: #242424;
    font-weight: 600;
    z-index: 2;
}

/* Hide label during loading state */
.form-group.loading .custom-dropdown ~ label,
.date-passengers-row.loading .custom-dropdown ~ label {
    opacity: 0;
    visibility: hidden;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .custom-dropdown__list {
        max-height: 150px;
    }

    .custom-dropdown__item {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
}
