/*! 
 *  Multiple select dropdown with filter jQuery plugin.
 *  Copyright (C) 2020  Andrew Wagner  github.com/andreww1011
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 * 
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 * 
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
 *  USA
 */
:root {
    --fms-badge-text-color: white;
    --fms-badge-color: var(--primary)
}

.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;
    margin-right: 0.255em;
    vertical-align: middle;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
    background-image: url("../images/blue-down.svg") !important;
    background-position: calc(100% - 20px) !important;
    background-size: 13px !important;
    background-repeat: no-repeat !important;
}
 */
.filter-multi-select > .dropdown-toggle {
    background-image: url("../images/blue-down.svg") !important;
    background-position: calc(100% - 20px) !important;
    background-size: 13px !important;
    background-repeat: no-repeat !important;
}
.filter-multi-select > .dropdown-toggle:empty::before {
    margin-right: 0.255em;
}

.filter-multi-select > .viewbar {
    white-space: normal;
    height: auto;
    cursor: pointer;
    border: 1px solid #bfc6d5;
    height: 42px;
    border-radius: 5px;
    font-size: 14px;
    text-transform: capitalize;
    font-weight: 600;
}

.filter-multi-select > .viewbar > .selected-items > .item {
    margin: 0 1px;
    padding: 0px 0px 0px 10px;
    display: inline-flex;
    height: 30px;
    color: #000;
    background-color: #fff;
    border-radius: 1.1em;
    align-items: center;
    vertical-align: baseline;
    font-size: 12px;
    font-family: 'Montserrat';
    font-weight: 500;
    border: 1px solid #eee;
}

.filter-multi-select > .viewbar > .selected-items > .item > button {
    background-color: #000000;
    color: #fff;
    border: 0;
    font-weight: 500;
    cursor: pointer;
    height: 16px;
    font-size: 20px;
    width: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0px 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: 100%;
    left: 0%;
    z-index: 1000;
    display: none;
    float: left;
    max-height: 50vh;
    min-width: 10rem;
    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 #DCE3EB;
    border-radius: 0.25rem;
    width: 100%;
}

.filter-multi-select > .dropdown-menu.show {
    display: block;
    width: 100%;
    border-radius: 0;
    border: 1px solid #eee;
}

.filter-multi-select > .dropdown-menu > .filter > input {
    font-size: 0.875rem;
}

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

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

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

.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;
   color: #000;
   font-size: 14px;
   font-weight: 400;
   font-family: 'Montserrat';
   padding-left: 10px;
}

.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: 1px;
    left: -20px;
    display: block;
    width: 18px;
    height: 18px;
    pointer-events: none;
    content: "";
    background-color: #FFFFFF;
    border: #DCE3EB solid 1px;
}

.filter-multi-select .dropdown-item .custom-control-label::after {
    position: absolute;
    top: 1px;
    left: -21px;
    display: block;
    width: 18px;
    height: 18px;
    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: #000000;
    background-color: #000000;
}

.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(--fms-badge-color);
    background-color: var(--fms-badge-color);
    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");
}