/**
 * Select2 Custom Styling - Palmetto Rail Brand
 * @package Palmetto Rail
 */

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

/* Select2 Selection (closed state) */
.select2-container--default .select2-selection--single {
    position: relative !important;
    width: 100%;
    padding: 13px 15px !important;
    font-family: var(--sans) !important;
    font-size: var(--text-base) !important;
    line-height: 1 !important;
    font-weight: 500 !important;
    color: var(--color-white) !important;
    background: transparent !important;
    border: 1px solid var(--color-white) !important;
    border-radius: 10px !important;
    height: auto !important;
    transition: 0.3s ease-in-out !important;
    cursor: pointer !important;
}

/* Focus state */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--color-green) !important;
    outline: none !important;
}

/* Selected value text */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--color-white) !important;
    padding: 0 !important;
    line-height: 1 !important;
}

/* Placeholder text */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--color-white) !important;
    opacity: 1 !important;
}

/* Hide default Select2 arrow */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    display: none !important;
}

/* Custom arrow using ::after pseudo-element */
.select2-container--default .select2-selection--single::after {
    content: "" !important;
    position: absolute !important;
    right: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 14px !important;
    height: 8px !important;
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='8' viewBox='0 0 14 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L7 7L13 1' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 14px 8px !important;
    pointer-events: none !important;
    transition: transform 0.3s ease !important;
}

/* Rotate arrow when open */
.select2-container--default.select2-container--open .select2-selection--single::after {
    transform: translateY(-50%) rotate(180deg) !important;
}

/* Dropdown container */
.select2-container--default .select2-dropdown {
    background-color: var(--color-blue) !important;
    border: 1px solid var(--color-white) !important;
    border-radius: 10px !important;
    margin-top: 4px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

/* Search box (if enabled) */
.select2-container--default .select2-search--dropdown .select2-search__field {
    background: transparent !important;
    border: 1px solid var(--color-white) !important;
    border-radius: 8px !important;
    color: var(--color-white) !important;
    padding: 8px 12px !important;
    font-family: var(--sans) !important;
    font-size: var(--text-base) !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field::placeholder {
    color: var(--color-white) !important;
    opacity: 0.6;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--color-green) !important;
    outline: none !important;
}

/* Results list */
.select2-container--default .select2-results__options {
    max-height: 300px !important;
    overflow-y: auto !important;
}

/* Individual options */
.select2-container--default .select2-results__option {
    padding: 13px 15px !important;
    font-family: var(--sans) !important;
    font-size: var(--text-base) !important;
    font-weight: 500 !important;
    color: var(--color-white) !important;
    background-color: var(--color-blue) !important;
    transition: 0.2s ease-in-out !important;
    cursor: pointer !important;
    border: none !important;
}

/* First option - top rounded corners */
.select2-container--default .select2-results__option:first-child {
    border-radius: 10px 10px 0 0 !important;
}

/* Last option - bottom rounded corners */
.select2-container--default .select2-results__option:last-child {
    border-radius: 0 0 10px 10px !important;
}

/* Only option - all corners rounded */
.select2-container--default .select2-results__option:only-child {
    border-radius: 10px !important;
}

/* Hover state */
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted {
    background-color: var(--color-green) !important;
    color: var(--color-white) !important;
    font-weight: 500 !important;
}

/* Selected option */
.select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: var(--color-light-blue) !important;
    color: var(--color-white) !important;
    font-weight: 700 !important;
}

/* Override selected option when hovered */
.select2-container--default .select2-results__option[aria-selected="true"].select2-results__option--highlighted {
    font-weight: 500 !important;
}

/* Disabled option */
.select2-container--default .select2-results__option[aria-disabled="true"] {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* No results message */
.select2-container--default .select2-results__option--no-results {
    color: var(--color-white) !important;
    opacity: 0.7;
}

/* Clear selection button (if enabled) */
.select2-container--default .select2-selection__clear {
    color: var(--color-white) !important;
    font-size: 1.2rem !important;
    margin-right: 10px !important;
}

/* Scrollbar styling for dropdown */
.select2-container--default .select2-results__options::-webkit-scrollbar {
    width: 8px;
}

.select2-container--default .select2-results__options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.select2-container--default .select2-results__options::-webkit-scrollbar-thumb {
    background: var(--color-green);
    border-radius: 4px;
}

.select2-container--default .select2-results__options::-webkit-scrollbar-thumb:hover {
    background: var(--color-light-blue);
}
