/*
https://css-tricks.com/switch-font-color-for-different-backgrounds-with-css/
Facundo Corradini
*/
:root {
    --fms-badge-text-color: white;
    --fms-badge-color: var(--primary)
}

/* .filter-multi-select *, .filter-multi-select *::before, .filter-multi-select *::after {
    box-sizing: border-box;
} */

.filter-multi-select.dropup, .filter-multi-select.dropdown {
    position: relative;
}

.filter-multi-select .dropdown-toggle::after {
    all: unset;
}

.filter-multi-select .dropdown-toggle:empty::after {
    all: unset;
}

.filter-multi-select > .dropdown-toggle::before {
    display: inline-block;
    content: "";
    position: absolute;
    background-image: url(../images/select-arrow.svg);
    background-repeat: no-repeat;
    background-size: 12px;
    width: 12px;
    height: 7px;
    right: 15px;
    top: 0;
    bottom: 0;
    margin: auto;
}

.filter-multi-select > .dropdown-toggle:empty::before {
    margin-right: 0.255em;
}

.filter-multi-select > .viewbar {
    white-space: normal;
    font-size: 15px;
    height: auto;
    cursor: pointer;
    border: none;
    min-height: 45px;
    padding: 0.375rem 30px 0.375rem 15px;
    line-height: 28px;
    font-family: var(--regular);
    position: relative;

}

.filter-multi-select > .viewbar > .selected-items > .item {
    margin: .2rem .25rem .05rem 0;
    padding: 0px 0px 0px .6em;
    display: inline-flex;
    line-height: 1.875em;
    color: var(--white);
    font-size: 13px;
    background-color: var(--orange);
    border-radius: 1.1em;
    align-items: center;
    vertical-align: baseline;
}

.filter-multi-select > .viewbar > .selected-items > .item > button {
    background-color: transparent;
    color: var(--fms-badge-text-color);
    border: 0;
    font-weight: 900;
    cursor: pointer;
    padding-left: 5px;
    padding-right: 8px;
}

.filter-multi-select > .viewbar > .selected-items > .item > button:hover {
    filter: contrast(50%);
}

.filter-multi-select > .viewbar > .selected-items > .item.disabled {
    display: inline-flex;
    padding: 0px .5em 0px .5em;
    filter: grayscale(80%) brightness(150%);
}

.filter-multi-select > .viewbar > .selected-items > .item.disabled > button {
    display: none;
}

.filter-multi-select > .dropdown-menu {
    position: absolute;
    top: -215px;
    left: 0%;
    right: 0;
    /* top: auto;
    left: auto; */
    z-index: 1000;
    display: none;
    float: left;
    max-height: 210px;
    max-width: 100%;
    overflow-y: auto;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 0.875rem;
    text-align: left;
    list-style: none;
    background-color: #FFFFFF;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.25rem;
    width: auto;
    scrollbar-width: thin;

}

.formInputRowPosBot .dropdown-menu {
    top: 50px;
}

.formInputRowPosTop .dropdown-menu {
    top: -215px;
}

.filter-multi-select > .dropdown-menu.show {
    display: block;
}

.filter-multi-select > .dropdown-menu > .filter > input {
    font-size: 15px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    height: 40px;
    padding-left: 15px;
}

.filter-multi-select > .dropdown-menu > .filter > button {
    position: absolute;
    border: 0;
    background-color: transparent;
    font-weight: 900;
    color: #ccc;
    right: 2rem;
    top: 1.1rem;
}

.filter-multi-select > .dropdown-menu > .filter > button:hover {
    color: #aaa;
}

.filter-multi-select .dropdown-item {
    display: block;
    width: 100%;
    padding: 0.25rem 1rem;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
}

.filter-multi-select .items.dropdown-item {
    padding-left: 1.5rem;
}

.filter-multi-select .dropdown-item.disabled, .filter-multi-select .dropdown-item:disabled {
    color: #6c757d;
    pointer-events: none;
    background-color: transparent;
}

.filter-multi-select .dropdown-item:hover, .filter-multi-select .dropdown-item:focus {
    background-color: inherit;
}

.filter-multi-select .dropdown-item.active, .filter-multi-select .dropdown-item:active {
    color: inherit;
}

.filter-multi-select .dropdown-item .custom-control-input {
    position: absolute;
    z-index: -1;
    opacity: 0;
}

.filter-multi-select .dropdown-item .custom-control-label {
    position: relative;
    margin-bottom: 0;
    vertical-align: top;
    display: inline-block;
    font-family: var(--medium);
    font-size: 14px;
}

.filter-multi-select .dropdown-item .custom-control-label::before {
    border-radius: 0.25rem;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    position: absolute;
    top: 0.15625rem;
    left: -1.5rem;
    display: block;
    width: 1rem;
    height: 1rem;
    pointer-events: none;
    content: "";
    background-color: #FFFFFF;
    border: #adb5bd solid 1px
}

.filter-multi-select .dropdown-item .custom-control-label::after {
    position: absolute;
    top: 0.15625rem;
    left: -1.5rem;
    display: block;
    width: 1rem;
    height: 1rem;
    content: "";
    background: no-repeat 50% / 50% 50%;
}

.filter-multi-select .dropdown-item .custom-checkbox:checked ~ .custom-control-label::before,
.filter-multi-select .dropdown-item .custom-checkbox:indeterminate ~ .custom-control-label::before {
    border-color: var(--orange);
    background-color: var(--orange);
}

.filter-multi-select .dropdown-item .custom-checkbox:checked:disabled ~ .custom-control-label::before,
.filter-multi-select .dropdown-item .custom-checkbox:indeterminate:disabled ~ .custom-control-label::before {
    border-color: var(--orange);
    background-color: var(--orange);
    filter: grayscale(80%) brightness(150%);
}

.filter-multi-select .dropdown-item .custom-checkbox:checked ~ .custom-control-label::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23FFFFFF' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e");
}

.filter-multi-select .dropdown-item .custom-checkbox:indeterminate ~ .custom-control-label::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3e%3cpath stroke='%23FFFFFF' d='M0 2h4'/%3e%3c/svg%3e");
}

span.placeholder {
    background-color: transparent;
    cursor: pointer;
    color: var(--darkGrey);
    opacity: 1;
}

.selected-items {
    display: flex;
    flex-wrap: wrap;
}

.direction-rtl .filter-multi-select > .viewbar {
    padding: 0.375rem 15px 0.375rem 30px;
}

.direction-rtl .filter-multi-select > .dropdown-toggle::before {
    right: auto;
    left: 15px;
}

.direction-rtl .filter-multi-select > .dropdown-menu > .filter > button {
    right: auto;
    left: 2rem;
}

.direction-rtl .filter-multi-select .dropdown-item {
    text-align: right;
}

.direction-rtl .filter-multi-select .items.dropdown-item {
    padding-right: 1.5rem;
    padding-left: 1rem;

}

.direction-rtl .filter-multi-select .dropdown-item .custom-control-label::before {
    left: auto;
    right: -1.5rem;
}

.direction-rtl .filter-multi-select .dropdown-item .custom-control-label::after {
    left: auto;
    right: -1.5rem;
}

.direction-rtl .filter-multi-select > .viewbar > .selected-items > .item {
    padding: 0px .6em 0px 0;
}

.direction-rtl .filter-multi-select > .viewbar > .selected-items > .item > button {
    padding-right: 5px;
    padding-left: 8px;
}

.form-group .form-control.viewbar {
    padding-left: 15px;
    padding-right: 20px;
    padding: 4px 20px 8px 15px;
}

/* @media (max-width: 640px) {
    .filter-multi-select > .dropdown-menu {
        top: 205px;
    }
}
@media (max-width: 450px) {
    .filter-multi-select > .dropdown-menu {
        top: 245px;
    }
} */
