/**
 * Select2 Custom Styles
 * Custom styling for Select2 dropdown in location modal
 */

/* Select2 Container */
.location-form-group .select2-container {
    width: 100% !important;
}

/* Select2 Selection (Main input area) */
.location-form-group .select2-container--default .select2-selection--single {
    height: auto;
    padding: 14px 40px 14px 16px;
    font-size: 15px;
    color: #1A1A1A;
    border: 1px solid #E7E7E7;
    border-radius: 8px;
    background-color: #FFFFFF;
    transition: all 0.2s ease;
}

/* Remove default arrow */
.location-form-group .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 12px;
    top: 0;
}

.location-form-group .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border: none;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px;
    width: 16px;
    height: 16px;
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Rendered text */
.location-form-group .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 0;
    line-height: normal;
    color: #1A1A1A;
}

/* Placeholder text */
.location-form-group .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #999999;
}

/* Hover state */
.location-form-group .select2-container--default .select2-selection--single:hover {
    border-color: #CCCCCC;
}

/* Focus state */
.location-form-group .select2-container--default.select2-container--focus .select2-selection--single,
.location-form-group .select2-container--default.select2-container--open .select2-selection--single {
    outline: none;
    border-color: #4F75FB;
    box-shadow: 0 0 0 3px rgba(79, 117, 251, 0.1);
}

/* Keep border radius when dropdown is open below */
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,
.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Dropdown below - remove top border and keep top radius */
.select2-container--open .select2-dropdown--below {
    border-top: none;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

/* Dropdown */
.select2-dropdown {
    border: 1px solid #E7E7E7;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    margin-top: 4px;
}

/* Search field */
.select2-container--default .select2-search--dropdown .select2-search__field {
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #E7E7E7;
    border-radius: 6px;
    outline: none;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #4F75FB;
}

/* Dropdown options */
.select2-container--default .select2-results__option {
    padding: 12px 16px;
    font-size: 15px;
    color: #1A1A1A;
}

/* Hover option */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #F5F7FF;
    color: #1A1A1A;
}

/* Selected option */
.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #4F75FB;
    color: #FFFFFF;
}

/* Disabled select */
.location-form-group .select2-container--disabled .select2-selection--single {
    background-color: #F5F5F5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Loading state */
.location-form-group .select2-container.select2-loading .select2-selection--single {
    position: relative;
    padding-right: 60px;
}

.location-form-group .select2-container.select2-loading .select2-selection--single::after {
    content: '';
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #E7E7E7;
    border-top: 2px solid #4F75FB;
    border-radius: 50%;
    animation: select2-spin 0.8s linear infinite;
}

@keyframes select2-spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .location-form-group .select2-container--default .select2-selection--single {
        padding: 12px 36px 12px 14px;
        font-size: 14px;
    }

    .select2-container--default .select2-results__option {
        padding: 10px 14px;
        font-size: 14px;
    }
}
