/* ================================= Select2 Custom Styles =========================== */

/* Override default select2 container styles from main.css */
.form-group .select2-container,
.account .select2-container,
#country_id + .select2-container,
#materials + .select2-container,
#category + .select2-container,
#grade + .select2-container,
#level + .select2-container {
    display: block !important;
    width: 100% !important;
    height: auto !important;
}

/* Override awful default styles from main.css */
.form-group .select2-selection.select2-selection--single,
.account .select2-selection.select2-selection--single,
#country_id + .select2-container .select2-selection.select2-selection--single,
#materials + .select2-container .select2-selection.select2-selection--single,
#category + .select2-container .select2-selection.select2-selection--single,
#grade + .select2-container .select2-selection.select2-selection--single,
#level + .select2-container .select2-selection.select2-selection--single {
    width: 100% !important;
    height: auto !important;
    min-height: 48px !important;
    display: block !important;
    border-radius: 5px !important;
    padding: 12px 24px !important;
    border: 1px solid #d1d5db !important;
    background-color: hsl(var(--white)) !important;
}

/* Multiple Select Styling */
.select2-container--default .select2-selection--multiple {
    border: 1px solid #d1d5db !important;
    border-radius: 5px;
    min-height: 48px;
    padding: 6px 12px;
    background-color: hsl(var(--white)) !important;
    width: 100%;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #667eea !important;
    box-shadow: none;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #3b82f6;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    color: white;
    margin-top: 4px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: white;
    margin-right: 6px;
    font-size: 16px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #dbeafe;
}

/* Single Select Styling */
.select2-container--default .select2-selection--single {
    border: 1px solid #d1d5db !important;
    border-radius: 5px;
    padding: 12px 24px;
    background-color: hsl(var(--white)) !important;
    width: 100%;
    height: auto;
    min-height: 48px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1 !important;
    color: hsl(var(--black)) !important;
    padding-left: 0 !important;
    padding-right: 20px !important;
    font-size: 1.0625rem !important;
}

/* Override the crazy padding from main.css */
.form-group .select2-container .select2-selection--single .select2-selection__rendered,
.account .select2-container .select2-selection--single .select2-selection__rendered,
#country_id + .select2-container .select2-selection--single .select2-selection__rendered,
#materials + .select2-container .select2-selection--single .select2-selection__rendered,
#category + .select2-container .select2-selection--single .select2-selection__rendered,
#grade + .select2-container .select2-selection--single .select2-selection__rendered,
#level + .select2-container .select2-selection--single .select2-selection__rendered {
    padding: 0 !important;
    padding-inline-start: 0 !important;
    padding-inline-end: 20px !important;
    line-height: 1 !important;
    color: hsl(var(--black)) !important;
    font-size: 1.0625rem !important;
}

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

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    top: 0;
    right: 12px;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #667eea !important;
    box-shadow: none;
}

/* Dropdown Styling */
.select2-dropdown {
    border: 1px solid #d1d5db !important;
    border-radius: 5px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #3b82f6;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #dbeafe;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #d1d5db !important;
    border-radius: 5px;
    padding: 8px 12px;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    outline: none;
    border-color: #667eea !important;
}

/* Account page specific styles */
.account .select2-container--default .select2-selection--single,
.account .select2-container--default .select2-selection--multiple {
    background-color: var(--bg-primary) !important;
    border-color: var(--border-color) !important;
}

.account .select2-container--default.select2-container--focus .select2-selection--single,
.account .select2-container--default.select2-container--focus .select2-selection--multiple {
    background-color: var(--bg-primary) !important;
    border-color: var(--bs-main-600) !important;
}

.account .select2-container--default .select2-selection--single .select2-selection__rendered,
.account .select2-container--default .select2-selection--multiple .select2-search__field {
    color: var(--text-primary) !important;
}
