@import "../_colors";

$active-border-color: #428bca;
$error-color: #c13018;

body .p-multiselect {
    background: $default-color;
    border: 1px solid $default-primary-color;
    border-color: $default-primary-color !important;
    border-radius: 4px;
    min-height: 35px;
    min-width: 300px;
    width: 100%;
    display: inline-flex;
    .p-multiselect-dropdown {
        background: $default-color;
        border-left: 1px solid $default-primary-color;
        border-radius: 0 4px 4px 0;
        transition: background-color 200ms ease-out;
        width: 35px;
    }

    &.p-focus {
        border: 1px solid $active-border-color;
        border-color: $active-border-color !important;

        .p-multiselect-dropdown {
            border-left: 1px solid $active-border-color;
        }
    }

    .p-multiselect-label {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 0 26px 0 12px;
        height: 100%;
        align-items: center;
        white-space: normal !important;
    }

    &.p-multiselect-display-chip {
        .p-multiselect-label {
            flex-direction: row;
            gap: 8px;
            padding: 8px;
        }
    }

    .p-multiselect-filter {
        border-radius: 3px;
        border: 1px solid #c1c1cc;
        background: #fff;
    }

    .p-multiselect-chip {
        border-radius: 4px;
        border: 1px solid #888b99;
        background: #eeebf2;
        display: flex;
        min-height: 20px;
        padding: 0px 8px;
        justify-content: center;
        align-items: center;
        gap: 8px;

        &:hover {
            background-color: #e5eaea !important;
            cursor: pointer;
        }
    }

    .p-multiselect-clear-icon {
        padding-right: 8px;
    }

    &.p-disabled {
        border-color: #dedce5;
        opacity: 0.5;
    }

    &.ng-dirty.ng-invalid:not(.p-disabled) {
        border: 1px solid $error-color;
        border-color: $error-color !important;

        .p-multiselect-dropdown {
            border-left: 1px solid $error-color;
        }
    }
}

body .p-multiselect-overlay {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0px 4px 5px 0px #00000033;
    margin: 2px 0;
    padding: 4px 0;
    width: 100%;

    .p-checkbox.p-checkbox-checked {
        background-color: #428bca;
        border-radius: 3px;

        .p-checkbox-icon {
            color: white;
        }

        .p-checkbox-box {
            border: none !important;
        }
    }

    .p-multiselect-header {
        display: flex;
        gap: 12px;
        padding: 6px 12px;

        .p-multiselect-filter-icon {
            position: relative;
            bottom: 0.5em;
            right: 23px;
        }
    }

    .p-multiselect-list {
        .p-multiselect-option-group {
            min-height: 21px;
            font-weight: 700;
            color: #212533;
            padding: 7px 10px;
            font-size: 14px;
            background-color: #fff;
        }

        .p-multiselect-empty-message {
            padding: 0 12px;
        }

        .p-multiselect-option {
            display: flex;
            gap: 12px;
            padding: 12px;

            .p-checkbox {
                margin: 0;
            }

            &:hover {
                background-color: #eeebf2;
            }

            span {
                white-space: normal !important;
            }
        }
    }
}
