/**
 * Custom overrides to fix specific issues
 */

/* DataTables export button overrides - fixed text color */
.dt-button,
.dt-button:hover,
.dt-button:focus,
.dt-button:active,
.buttons-excel,
.buttons-excel:hover,
.buttons-excel:focus,
.buttons-excel:active {
    background-color: white !important;
    color: #2563eb !important;
    border-color: #2563eb !important;
    border-width: 1px !important;
    border-style: solid !important;
}

.dt-button span,
.buttons-excel span {
    color: #2563eb !important;
}

/* Target by full selector path */
#DataTables_Table_0_wrapper div.dt-buttons a.dt-button {
    background-color: white !important;
    color: #2563eb !important;
    border-color: #2563eb !important;
}

#DataTables_Table_0_wrapper div.dt-buttons a.dt-button span {
    color: #2563eb !important;
}

/* Target specific inline styles */
span[style*="color: black"] {
    color: #2563eb !important;
}

/* Select2 items need better contrast */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: white !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: white !important;
}

/* Native arrows ignore padding. Reserve text space and position one shared chevron. */
select.form-control:not([multiple]):not([size]):not(.select2-hidden-accessible),
select.form-control[size="0"]:not([multiple]):not(.select2-hidden-accessible),
select.form-control[size="1"]:not([multiple]):not(.select2-hidden-accessible),
.dataTables_length select:not([multiple]):not([size]) {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%2364758b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
}

/* Let the operating system draw a visible indicator in high-contrast mode. */
@media (forced-colors: active) {
    select.form-control:not([multiple]):not([size]):not(.select2-hidden-accessible),
    select.form-control[size="0"]:not([multiple]):not(.select2-hidden-accessible),
    select.form-control[size="1"]:not([multiple]):not(.select2-hidden-accessible),
    .dataTables_length select:not([multiple]):not([size]) {
        -webkit-appearance: auto;
        -moz-appearance: auto;
        appearance: auto;
        background-image: none;
    }
}
