/*  SelectOneMenu */

div.ui-selectonemenu {

    div.ui-selectonemenu-trigger {
        border-color: #ffffff;
        overflow: hidden;
        box-shadow: none;
        border: none;

        &.ui-state-hover, &.ui-state-focus {
            background: none;
        }

        span.ui-icon-triangle-1-s {
            background-image: none;
            display: inline;
            position: relative;

            &:before {
                font-family: 'Glyphicons Halflings';
                color: @admin-text-color;
                position: relative;
                font-size: @glyphicon-icon-size;
                padding: 0 7px;
                font-weight: bold;
                left: 3px;
                overflow: hidden;
                content: "\e259" !important;

                @media (max-width: @screen-xs) {
                    font-size: @glyphicon-icon-size + 1;
                }
            }
        }

        .icon-ripple.ui-icon-triangle-1-s {
            margin-left: 3px;
        }

    }

}

@-moz-document url-prefix() {
    div.ui-selectonemenu {
        div.ui-selectonemenu-trigger span.ui-icon-triangle-1-s:before {
            left: 3px;
        }
    }
}

//ie11
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    body div.ui-selectonemenu div.ui-selectonemenu-trigger span.ui-icon-triangle-1-s {
        padding-top: 1px;
    }
}


div.ui-selectcheckboxmenu-trigger span.ui-icon-triangle-1-s {
    background-image: none;
    display: inline;
    position: relative;

    &:before {
        font-family: 'Glyphicons Halflings';
        color: @admin-text-color;
        position: relative;
        font-size: @glyphicon-icon-size;
        padding: 0 10px;
        font-weight: bold;
        top: -2px;
        left: 2px;
        overflow: hidden;
        content: "\e259" !important;
        @media (max-width: @screen-xs) {
            font-size: @glyphicon-icon-size + 1;
        }
    }
}


div.ui-selectonemenu, div.ui-fluid div.ui-selectonemenu, div.ui-selectcheckboxmenu, div.ui-fluid div.ui-selectcheckboxmenu {
    height: 34px;
    display: block;
    overflow: hidden;
    border-color: @select-border-color;
    .border-left-radius(@default-border-radius);
    min-width: 150px; /* primefaces adds min-width: 328px; when on ui-state-exception */

    .ui-selectonemenu-trigger {
        width: @select-trigger-width;
        height: @select-trigger-height;
        padding: 3px 6px;
        .border-left-radius(0px);

        &.ui-state-hover, &.ui-state-focus {
            background: transparent;
            .box-shadow(none);
        }
    }

    .ui-selectonemenu-label {
        padding-left: 6px;
    }
}


/* listbox */

ul.ui-selectlistbox-list, ul.ui-multiselectlistbox-list {
    li {
        &.ui-selectlistbox-item, &.ui-multiselectlistbox-item {
            position: relative;
            overflow: hidden;
            padding: 3px 6px;

            &.ui-state-highlight {
                border-radius: @default-border-radius;
            }
        }
        &.ui-listbox-outline {
            outline:none;
        }
    }
}

li:not(.ui-state-highlight) {
    &.ui-selectlistbox-item, &.ui-selectonemenu-item, &.ui-multiselectlistbox-item {
        &.ui-state-hover, .ui-state-focus, &:hover, &:focus {
            background: @hover-color;
        }
    }
}

/* box-menu */


div.ui-selectcheckboxmenu {
    overflow: hidden;

    &.ui-state-focus .ui-selectcheckboxmenu-label, &.ui-selectcheckboxmenu-label.ui-state-hover {
        background-color: #ffffff;
    }
}


.ui-selectcheckboxmenu-header .ui-selectcheckboxmenu-close {
    .box-shadow(none);
    padding: 1px !important;

    span.ui-icon-circle-close {
        background-image: none !important;
        display: inline !important;
        text-indent: initial;
        overflow: visible;

        &:before {
            font-family: FontAwesome;
            color: @admin-text-color;
            position: relative;
            font-size: @font-awesome-icon-size;
            top: -5px;
            left: 5px;
            overflow: hidden;
            content: "\f00d" !important;
        }

        &.icon-ripple {
            left: -3px;
        }
    }

}

body .ui-selectcheckboxmenu-panel div.ui-chkbox span.ui-chkbox-icon:before {
    top: 1px;
}

li.ui-selectcheckboxmenu-item div.ui-chkbox-box {
    position: relative;
    margin-top: -15px;
}

body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-list-item .ui-chkbox {
    margin-top: -7px;
}

div.ui-selectcheckboxmenu .ui-selectcheckboxmenu-trigger {
    border-color: transparent;
    width: @select-trigger-width;
    height: @select-trigger-height;
    .box-shadow(none);

    &.ui-state-hover, &.ui-state-focus {
        background: transparent;
    }

    .ui-icon {
        margin-top: 6px;
        margin-left: 3px;

        &.icon-ripple {
            left: 6px;
        }
    }
}

.ui-selectcheckboxmenu-label-container .ui-selectcheckboxmenu-label {
    min-width: 100px;
}

div.ui-selectcheckboxmenu-header {
    border: 0;
    border-bottom: 1px solid @checkboxmenu-border-color;

    .ui-chkbox span.ui-icon {
        float: none;
    }
}

div.ui-fluid div.ui-selectcheckboxmenu-multiple, body div.ui-selectcheckboxmenu-multiple {
    display: inline-table;
    overflow: visible;
    border-collapse: initial;
}

body .ui-selectcheckboxmenu-multiple {
    .ui-selectcheckboxmenu-trigger .ui-icon {
        top: 5px;
    }

    .ui-selectcheckboxmenu-token-label {
        background: @light-blue;
        color: #fff;
        height: 28px;
        white-space: normal;
        float: left;
        border-radius: @default-border-radius;
    }

    li.ui-selectcheckboxmenu-token {
        white-space: normal;
    }

    span.ui-selectcheckboxmenu-token-icon.ui-icon-close {
        background-image: none !important;
        display: inline;
        position: relative;
        margin-left: -15px;
        top: 2px;

        &:before {
            font-family: FontAwesome;
            color: #fff;
            display: inline !important;
            position: relative;
            font-size: @font-awesome-icon-size;
            margin-left: 5px;
            top: -5px;
            left: -1px;
            overflow: hidden;
            content: "\f00d" !important;
        }

        &:hover:before {
            color: @hover-icon-color;
        }
    }

    /* box colors */

    &.box-default {
        .ui-selectcheckboxmenu-token-label {
            background: @gray-lte;
        }
    }

    &.box-danger {
        .ui-selectcheckboxmenu-token-label {
            background: @red;
        }
    }

    &.box-fatal {
        .ui-selectcheckboxmenu-token-label {
            background: @dark-red;
        }
    }

    &.box-warning {
        .ui-selectcheckboxmenu-token-label {
            background: @yellow;
        }
    }

    &.box-success {
        .ui-selectcheckboxmenu-token-label {
            background: @green;
        }
    }

    &.box-info {
        .ui-selectcheckboxmenu-token-label {
            background: @aqua;
        }
    }

    &.no-color {
        .ui-selectcheckboxmenu-token-label {
            background: #d2d6de;
        }
    }
}

body .ui-selectcheckboxmenu-header .ui-selectcheckboxmenu-filter-container {

    span.ui-icon-search {
        background-image: none !important;
        display: inline;
        text-indent: initial;
        top: 7px;
        right: 2%;
        width: 20px;

        &:before {
            font-family: FontAwesome;
            color: @admin-text-color;
            display: inline !important;
            position: relative;
            font-size: @font-awesome-icon-size;
            margin-left: 5px;
            top: -3px;
            overflow: hidden;
            content: "\f002" !important;
        }
    }
}

/* checkboxmenu interactions */

ul.ui-selectcheckboxmenu-multiple-container {
    border: none !important;
}

body div.ui-selectcheckboxmenu, div.ui-fluid div.ui-selectcheckboxmenu {

    &.ui-state-focus {
        -moz-box-shadow: 0 0 5px @box-shadow-color;
        -webkit-box-shadow: 0 0 5px @box-shadow-color;
        box-shadow: 0 0 5px @box-shadow-color;
        border-color: lighten(@box-shadow-color, 30%);
    }

    &.ui-state-error {
        border: 1px solid @box-shadow-color-error;
    }

    &.ui-state-error.ui-state-focus {
        -moz-box-shadow: 0 0 5px @box-shadow-color-error;
        -webkit-box-shadow: 0 0 5px @box-shadow-color-error;
        box-shadow: 0 0 5px @box-shadow-color-error;
        border: 1px solid @box-shadow-color-error;
    }

    .ui-selectcheckboxmenu-trigger.ui-state-error.ui-state-focus {
        border: none;
        box-shadow: none;
    }
}

body div.ui-selectcheckboxmenu, div.ui-fluid div.ui-selectcheckboxmenu {
    &.ui-state-error, &.ui-state-error.ui-state-focus {
        border: 1px solid @box-shadow-color-error;
        color: @error-color;
    }
}

body .ui-selectcheckboxmenu .ui-selectcheckboxmenu-label {
    padding-top: 6px;
}


//manyMenu

div.ui-selectmanymenu {

    .ui-selectlistbox-filter-container {
        margin-bottom: .4em;
    }
    .ui-selectlistbox-item.ui-state-highlight {

        div.ui-chkbox-box, div.ui-chkbox-box.ui-state-active {
            vertical-align: sub;
            margin-left: 1px;
            border: none;
            background: #fff;
            color: #333;

            .ui-chkbox-icon.ui-icon-check:before {
                color: #333;
            }
        }
    }

    .ui-selectlistbox-filter-container {

        input.ui-selectlistbox-filter {
            width: 100%;
        }

        .ui-icon-search {
            background-image: none !important;
            display: inline;
            text-indent: initial;
            top: 7px;
            right: 0;
            width: 20px;

            &:before {
                font-family: FontAwesome;
                color: @admin-text-color;
                display: inline !important;
                position: relative;
                font-size: @font-awesome-icon-size;
                margin-left: 5px;
                top: -3px;
                overflow: hidden;
                content: "\f002" !important;
            }

        }
    }

    .ui-selectlistbox-listcontainer {
        tr.ui-selectlistbox-item, tr.ui-selectlistbox-item.ui-state-highlight {
            .ui-chkbox-box {
                margin-left: 3px;
            }
        }
    }
}