/**
 * Modern Select2 Styling
 * Custom styles for Select2 plugin
 * Global styles for all Select2 instances
 */

/* =================================
   GLOBAL SELECT2 BASE STYLES
   ================================= */

.select2-container {
    width: 100% !important;
    z-index: 9999 !important;
}

.select2-dropdown {
    z-index: 10000 !important;
}

/* =================================
   SELECTION BOX - MODERN INPUT STYLE
   ================================= */

.select2-container--default .select2-selection--single {
    height: 45px !important;
    border: 2px solid #e8ecef !important;
    border-radius: 8px !important;
    background: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.select2-container--default .select2-selection--single:hover {
    border-color: #c5cdd4 !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    outline: none;
}

/* Text Inside Selection */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 41px !important;
    color: #2c3e50;
    padding-left: 16px !important;
    font-weight: 500;
    font-size: 14px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #95a5a6;
    font-weight: 400;
}

/* Arrow Icon */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 41px !important;
    right: 8px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #6c757d transparent transparent transparent;
    border-width: 6px 5px 0 5px;
    margin-left: -5px;
    margin-top: -3px;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #6c757d transparent;
    border-width: 0 5px 6px 5px;
}

/* =================================
   DROPDOWN - MODERN CARD STYLE
   ================================= */

.select2-dropdown {
    border: 2px solid var(--bs-primary) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
    margin-top: 4px;
    overflow: hidden;
}

/* Search Box in Dropdown */
.select2-search--dropdown {
    padding: 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.select2-search--dropdown .select2-search__field {
    border: 2px solid #e8ecef;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    outline: none;
}

/* =================================
   RESULTS LIST
   ================================= */

.select2-results {
    max-height: 300px;
}

.select2-results__options {
    padding: 4px 0;
}

.select2-results__option {
    padding: 12px 16px;
    font-size: 14px;
    color: #2c3e50;
    transition: all 0.2s ease;
    position: relative;
}

.select2-results__option:hover {
    background: rgba(13, 110, 253, 0.05);
}

.select2-results__option--highlighted[aria-selected] {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #0056b3 100%) !important;
    color: white !important;
    font-weight: 500;
}

.select2-results__option--selected {
    background: rgba(13, 110, 253, 0.1);
    position: relative;
}

.select2-results__option--selected::after {
    content: '✓';
    position: absolute;
    right: 16px;
    color: var(--bs-primary);
    font-weight: bold;
}

.select2-results__option--highlighted.select2-results__option--selected::after {
    color: white;
}

/* No Results */
.select2-results__option--selectable {
    cursor: pointer;
}

.select2-results__message {
    padding: 20px;
    text-align: center;
    color: #95a5a6;
    font-style: italic;
}

/* Loading State */
.select2-results__option.loading-results {
    text-align: center;
    color: var(--bs-primary);
}

/* =================================
   CLEAR BUTTON
   ================================= */

.select2-container--default .select2-selection--single .select2-selection__clear {
    color: #dc3545;
    font-size: 20px;
    font-weight: bold;
    margin-right: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: #c82333;
    transform: scale(1.2);
}

/* =================================
   DISABLED STATE
   ================================= */

.select2-container--default.select2-container--disabled .select2-selection--single {
    background-color: #f8f9fa;
    border-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.6;
}

/* =================================
   ANIMATIONS
   ================================= */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.select2-dropdown {
    animation: slideDown 0.2s ease;
}

/* =================================
   LEGACY MODAL SPECIFIC STYLES
   (Kept for backward compatibility)
   ================================= */

/* Modern Select & Dropdown Styling */
#expenceModal .form-select,
#expenceModal .select2-container--default .select2-selection--single {
    height: 45px !important;
    border: 1px solid #e0e6ed !important;
    border-radius: 8px !important;
    padding: 0.625rem 1rem !important;
    font-size: 14px !important;
    color: #5b5c7c !important;
    background-color: #fff !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
}

#expenceModal .form-select:focus,
#expenceModal .select2-container--default.select2-container--focus .select2-selection--single,
#expenceModal .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #c82c6a !important;
    box-shadow: 0 0 0 0.2rem rgba(200, 44, 106, 0.15) !important;
    outline: none !important;
}

#expenceModal .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 45px !important;
    padding: 0 !important;
    color: #5b5c7c !important;
}

#expenceModal .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 45px !important;
    right: 10px !important;
}

#expenceModal .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #a1a5b7 !important;
}

/* Select2 Dropdown */
.select2-dropdown {
    border: 1px solid #e0e6ed !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.select2-results__option {
    padding: 10px 15px !important;
    font-size: 14px !important;
    color: #5b5c7c !important;
}

.select2-results__option--highlighted {
    background: linear-gradient(135deg, #c82c6a 0%, #a02456 100%) !important;
    color: #fff !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #e0e6ed !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #c82c6a !important;
    outline: none !important;
}

/* Native Select Dropdown Arrow */
#expenceModal .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%235b5c7c' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 16px 12px !important;
}

/* Global Modal Styling (for all modals using select2) */
.modal .form-select,
.modal .select2-container--default .select2-selection--single {
    height: 45px !important;
    border: 1px solid #e0e6ed !important;
    border-radius: 8px !important;
    padding: 0.625rem 1rem !important;
    font-size: 14px !important;
    color: #5b5c7c !important;
    background-color: #fff !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
}

.modal .form-select:focus,
.modal .select2-container--default.select2-container--focus .select2-selection--single,
.modal .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #c82c6a !important;
    box-shadow: 0 0 0 0.2rem rgba(200, 44, 106, 0.15) !important;
    outline: none !important;
}

.modal .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 45px !important;
    padding: 0 !important;
    color: #5b5c7c !important;
}

.modal .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 45px !important;
    right: 10px !important;
}

.modal .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #a1a5b7 !important;
}

.modal .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%235b5c7c' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 16px 12px !important;
}

