/**
 * Select2 Custom Styles
 * Matches search bar design: rounded-[50px], h-[50px], border-gray-300
 * Applied to elements with class: select2js
 */

/* Select2 Container - Match search bar rounded-[50px] design */
  /* Select2 css */

.select2-container .select2-selection--single {
    height: 56px;
    border-color: var(--border-color);
    border: none;
    border-radius: 8px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--search-text);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 56px;
    color: var(--title-color);
    padding: 0 30px 0 16px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 56px;
    right: 10px;
}
.select2js.select2-container {
    border: 1px solid var(--border-color); /* border-gray-300 */
    border-radius: 50px; /* rounded-[50px] */
    height: 50px;
    min-width: 120px;
    display: inline-block;
    vertical-align: middle;
}

.select2js.select2-container .select2-selection {
    border: 0;
    border-radius: 50px; /* rounded-[50px] */
    height: 50px;
    background-color: white;
    outline: none;
    cursor: pointer;
}

.select2js.select2-container .select2-selection__rendered {
    font-size: 16px; /* text-base */
    font-weight: 500; /* font-medium */
    line-height: 50px;
    padding-left: 16px; /* px-4 */
    padding-right: 35px; /* pr-10 for arrow space */
    color: var(--color-primary-500); /* text-gray-900 */
    display: block;
}

.select2js.select2-container .select2-selection__arrow {
    height: 50px;
    right: 12px;
    top: 0;
    width: 20px;
}

.select2js.select2-container .select2-selection__arrow b {
    border-color: #6b7280 transparent transparent transparent; /* text-gray-500 */
    border-style: solid;
    border-width: 5px 4px 0 4px;
    height: 0;
    left: 50%;
    margin-left: -4px;
    margin-top: -2px;
    position: absolute;
    top: 50%;
    width: 0;
}

/* Select2 Dropdown - Clean modern design matching search bar */
.select2js-dropdown {
    border-radius: 12px; /* rounded-xl */
    border: 1px solid transparent; /* border-gray-300 */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
    margin-top: 0;
    z-index: 9999;
    background-color: white;
    padding: 1rem;
    min-width: 150px;
}

.select2js-dropdown .select2-results__option {
    padding: 8px 16px; /* px-4 py-3 */
    font-size: 14px; /* text-base */
    color: #212121; /* text-gray-700 */
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
    border-radius: 8px; /* rounded-lg */
    margin-top: 8px;
}

.select2js-dropdown .select2-results__option:first-child {
    margin-top: 0;
}

.select2js-dropdown .select2-results__option:hover,
.select2js-dropdown .select2-results__option--highlighted {
    background-color: #e0f2fe; /* light blue for hover/highlight */
    color: #111827; /* text-gray-900 */
}

.select2js-dropdown .select2-results__option[aria-selected=true] {
    background-color: var(--color-primary-50);
    color: var(--title-color) ;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
        background-color: var(--color-primary-50);
}
.select2-container--default .select2-results__option--selected {
    background-color: var(--color-primary-50);
    color: var(--title-color);
}

/* Focus state - ring-2 ring-blue-500 */
.select2js.select2-container--focus .select2-selection,
.select2js.select2-container--open .select2-selection {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5); /* ring-2 ring-blue-500 */
    border-color: transparent;
    outline: none;
}

/* Hover state - bg-gray-50 */
.select2js.select2-container:hover .select2-selection {
    background-color: #f9fafb; /* bg-gray-50 */
}

/* Remove default Select2 focus outline */
.select2js.select2-container--focus .select2-selection__rendered,
.select2js.select2-container--open .select2-selection__rendered {
    outline: none;
}

/* Ensure proper alignment with other search bar elements */
.select2js.select2-container {
    margin: 0;
    vertical-align: middle;
}

/* no border design */
.no-border-merge-select .select2-container--default .select2-selection--single {
    border: none;
    box-shadow: none;
    min-width: 80px;
}


.banner-seacrch-panel .select2-container .select2-selection--single {
    min-width: 216px;
    border-radius: 50px;
    height: 50px;
}

.banner-seacrch-panel .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 50px;
}
.banner-seacrch-panel .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 50px;
}

.banner-seacrch-panel .select2-container.select2-container--open .select2-selection--single {
    border-radius: 30px 30px 0 0;
}
/* border select */
.border-select .select2-container--default .select2-selection--single {
    border: 1px solid var(--border-color);
}

/* bodybg select */
.body-color-select .select2-container .select2-selection--single {
    background-color: var(--body-bg);
}

/* width auto select */
.w-auto-select .select2-container {
    width: auto !important;
}

.w-auto-select .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-right: 30px;
}

/* Heigth 52px select */
.h-52-select .select2-container .select2-selection--single {
    height: 52px;
}

.h-52-select .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 52px;
}
.h-52-select .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 52px;
}

/* arrow design */
.select2-container .select2-selection__arrow b {
  display: none;
}

.select2-container .select2-selection__arrow {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='9' viewBox='0 0 16 9' fill='none'%3E%3Cpath d='M14.9243 1.17429L8.04929 8.04929C7.98544 8.11321 7.90962 8.16392 7.82615 8.19852C7.74269 8.23312 7.65323 8.25092 7.56288 8.25092C7.47253 8.25092 7.38307 8.23312 7.29961 8.19852C7.21615 8.16392 7.14033 8.11321 7.07648 8.04929L0.201476 1.17429C0.072473 1.04529 0 0.87032 0 0.687882C0 0.505445 0.072473 0.330479 0.201476 0.201476C0.330479 0.0724727 0.505445 0 0.687882 0C0.87032 0 1.04529 0.0724727 1.17429 0.201476L7.56288 6.59093L13.9515 0.201476C14.0154 0.1376 14.0912 0.0869309 14.1746 0.0523616C14.2581 0.0177923 14.3475 0 14.4379 0C14.5282 0 14.6177 0.0177923 14.7011 0.0523616C14.7846 0.0869309 14.8604 0.1376 14.9243 0.201476C14.9882 0.265351 15.0388 0.341183 15.0734 0.424641C15.108 0.508099 15.1258 0.597548 15.1258 0.687882C15.1258 0.778216 15.108 0.867666 15.0734 0.951124C15.0388 1.03458 14.9882 1.11041 14.9243 1.17429Z' fill='%23212121'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.filterPanel .select2-container .select2-selection__arrow {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='9' viewBox='0 0 16 9' fill='none'%3E%3Cpath d='M14.9243 1.17429L8.04929 8.04929C7.98544 8.11321 7.90962 8.16392 7.82615 8.19852C7.74269 8.23312 7.65323 8.25092 7.56288 8.25092C7.47253 8.25092 7.38307 8.23312 7.29961 8.19852C7.21615 8.16392 7.14033 8.11321 7.07648 8.04929L0.201476 1.17429C0.072473 1.04529 0 0.87032 0 0.687882C0 0.505445 0.072473 0.330479 0.201476 0.201476C0.330479 0.0724727 0.505445 0 0.687882 0C0.87032 0 1.04529 0.0724727 1.17429 0.201476L7.56288 6.59093L13.9515 0.201476C14.0154 0.1376 14.0912 0.0869309 14.1746 0.0523616C14.2581 0.0177923 14.3475 0 14.4379 0C14.5282 0 14.6177 0.0177923 14.7011 0.0523616C14.7846 0.0869309 14.8604 0.1376 14.9243 0.201476C14.9882 0.265351 15.0388 0.341183 15.0734 0.424641C15.108 0.508099 15.1258 0.597548 15.1258 0.687882C15.1258 0.778216 15.108 0.867666 15.0734 0.951124C15.0388 1.03458 14.9882 1.11041 14.9243 1.17429Z' fill='%23757575'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.filterPanel .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--search-text);
}
body:has(.hero-section) .select2-container--open .select2js-dropdown {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    border-color: var(--color-gray-300);
}


.hero-section .select2-container--default .select2-results>.select2-results__options {
    max-height: 225px;
}


.select2-container.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--color-primary-50);
    color: var(--title-color) ;
}

.search-request-city-select.select2-container--default .select2-selection--multiple.select2-selection--clearable {
        flex-wrap: wrap;
}
.select2-container--default.select2-container--open .select2-results__options .select2-results__option  {
    color: var(--title-color);
}

.select2.select2-container--default.search-request-city-select .select2-selection--multiple .select2-selection__choice__display {
    width: auto;
    white-space: wrap;
    line-break: anywhere;
}

.select2.select2-container--default.search-request-city-select .select2-selection--multiple .select2-selection__rendered {
    flex-wrap: wrap;
}


.select2.select2-container--default.search-request-city-select.select2-container--focus .select2-selection--multiple {
    flex-wrap: wrap;
}

.preferred-location .select2.select2-container--default .select2-selection--multiple {
    flex-wrap: wrap;
}
.preferred-location .select2.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    flex-wrap: wrap;
} 
.preferred-location .select2.select2-container--default .select2-selection--multiple .select2-selection__choice__display {
    width: auto;
    white-space: wrap;
    line-break: anywhere;
}