// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at

//     http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

.filter-tree-box {
    padding-left: 2px;

    .panel {
        border: none;
        box-shadow: none;

        &.panel-default>.panel-heading {
            border-color: $color_mystic_approx;
            border-width: 2px;
            min-width: 222px;

            button {
                height: inherit;
            }
        }

        .menu-items {
            height: 30px;
        }

        &.expand_collapse_panel-icon {
            .panel-heading {
                i.ec-icon:before {
                    content: "\f054";
                }

                &[aria-expanded="true"] {
                    i.ec-icon:before {
                        content: "\f078";
                    }
                }
            }
        }

        .dropdown-toggle {
            width: 15px;
        }
    }

    // .remove-drop-down {
    //     .drop-down-menu-view {
    //         display: inline-block;
    //     }

    //     .show-in-drop-down {
    //         display: none;
    //     }
    // }

    // .add-drop-down {
    //     .drop-down-menu-view {
    //         display: none;
    //     }

    //     .show-in-drop-down {
    //         display: block;
    //     }
    // }

    .filter-tree-content {
        overflow: auto;
        height: calc(100vh - 188px);

        .panel-collapse {
            padding-top: 7px;
        }

        .jstree-anchor {
            line-height: 26px;
            height: 26px;
            font-size: 16px;
            // max-width: 96%;
            width: calc(100% - 50px);
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .jstree-default .jstree-node {
            position: relative;
            max-width: 100%;
        }

        .tag-tree>li.parent-node>div:hover {
            background-color: $color_havelock_blue_approx;
            color: #fff !important;
        }

        .jstree-with-action {
            .jstree-default {
                .tools {
                    display: none;
                    position: absolute;
                    text-align: center;
                    cursor: pointer;
                    right: 0;
                    top: 0;
                    color: $white;
                    background: $color_havelock_blue_approx;

                    i {
                        width: 30px;
                    }
                }

                li[aria-selected="true"] {
                    &>.jstree-wholerow {
                        width: calc(100% - 30px);
                    }

                    &>.tools {
                        display: inline-block;
                        top: 0px;
                    }
                }
            }
        }

        .jstree-default {
            .jstree-search {
                font-style: unset;
                color: inherit;
                font-weight: 700;
            }

            .jstree-anchor {
                line-height: 26px;
                height: 26px;
                font-size: 16px;

                &.jstree-clicked {
                    color: $white;

                    i {
                        -webkit-text-stroke-color: $white;
                    }
                }
            }

            &>.jstree-no-dots .jstree-open>.jstree-ocl {
                transform: rotate(45deg);
            }

            .jstree-wholerow-clicked {
                background: $color_havelock_blue_approx;
                color: $white;
            }
        }

        .panel-heading {
            cursor: pointer;
        }

        .basicSaveSearch {
            .clearfix {
                .btn {
                    display: none;
                }
            }
        }

        .fa.fa-tag {
            color: transparent;
            -webkit-text-stroke-width: 1px;
            -webkit-text-stroke-color: #686868;
        }

        .tree-menu {
            padding: 5px;
            cursor: pointer;
            color: #686868;
        }

        .dropdown-menu {
            min-width: 182px;
            left: -155px;

            &>li {
                padding: 3px 15px;

                &:focus,
                &:hover {
                    background-color: $color_havelock_blue_approx;
                    color: #fff !important;

                    a {
                        background-color: $color_havelock_blue_approx;
                        color: #fff !important;
                    }

                    span {
                        color: #fff !important;
                    }

                    .clear-icon {
                        color: $color_ironside_gray_approx !important;
                    }

                    .wildcard-btn {
                        color: $color_jungle_green_approx !important;
                    }
                }

                .wildcard-btn {
                    margin: 0px;
                    color: $color_jungle_green_approx !important;
                }

                .wildcard-btn:hover {
                    margin: 0px;
                    color: $white !important;
                }

                input {
                    color: $color_ironside_gray_approx !important;
                    width: 130px;
                    display: inline-block;
                }

                input:hover {
                    background-color: #fff;
                }


                .clear-icon {
                    color: $color_ironside_gray_approx !important;
                }

                a {
                    display: inline-block;
                    padding: 0px 3px;
                }

                span {
                    color: #686868;
                    margin-left: 10px;
                }
            }

            .clear-icon {
                color: $color_ironside_gray_approx !important;
                position: absolute;
                z-index: 3;
                top: 29%;
                right: 48px;
            }

            .has-feedback input {
                padding: 6px 25px 6px 6px;

            }

            .has-feedback input:focus {
                border-color: $color_havelock_blue_approx !important;

            }

            .wildcard-search:hover {
                background-color: $white;
            }
        }

        .hide-icon {
            display: none;
        }

        .custom-filter {
            .fa-circle-thin:after {
                font-family: Source Sans Pro, sans-serif;
                position: absolute;
                left: 0px;
                margin-left: 9px;
                font-size: 11px;
                font-weight: bold;
            }

            .advance-tree:after {
                content: "A";
            }

            .basic-tree:after {
                content: "B";
            }
        }

        .switch-button {
            transform: rotate(180deg);
        }

        .group-tree-deactivate {
            color: $action_gray;
        }
    }
}

.sidebar-content {
    &:hover {
        .slider-bar button {
            display: block;
            opacity: 1;
        }
    }
}

.slide-in {
    #sidebar-wrapper {
        width: 40px;
        background: $white;

        .sidebar-content {
            .search-browse-box {
                border-left: none;

                &>div {
                    visibility: hidden;
                }

                .slider-bar {
                    visibility: visible;

                    button {
                        display: block;
                        opacity: 1;

                        i:before {
                            content: "\f0c9";
                        }
                    }
                }
            }
        }
    }

    #page-wrapper {
        width: calc(100% - 45px);
        margin-left: 45px;
    }
}

.search-browse-box {
    overflow: hidden;
    padding: 0;
    border-left: 1px solid $color_mystic_approx;

    .slider-bar {
        position: absolute;
        right: 0px;
        height: 100%;
        width: 13px;
        cursor: col-resize;
        z-index: 999;
        background: $white;

        .line {
            position: absolute;
            height: 100%;
            background: $color_mystic_approx;
            left: -2px;
            width: 2px;
        }

        &:hover {
            .line {
                background-color: $color_havelock_blue_approx;
            }

            button {
                display: block;

                &:hover {
                    background-color: $color_havelock_blue_approx;
                    color: $white;
                }
            }
        }

        button {
            background-color: $white;
            position: absolute;
            color: $color_havelock_blue_approx;
            right: 0px;
            border-radius: 16px;
            display: none;
            top: 9px;
            border-color: $color_havelock_blue_approx;
            background: white;
            padding: 2px 7px;
            opacity: 0;
            transition: 0.3s linear;
            border: 2px solid $color_havelock_blue_approx;
        }
    }
}

span.tree-tooltip {
    position: fixed;
    display: none;
    top: calc(346px - 39px);
    left: 138px;
    z-index: 1004;
    background: #f9f9f9;
    color: #2c2c2c;
    padding: 5px;
    height: 36px;
    box-shadow: 0px 0px 3px 0px #8080806b;
    border: 1px solid #80808057;
    border-radius: 9px;

    &.show {
        display: block;
    }
}

.glossary-dropdown {
    left: -190px !important;

    span a {
        padding: 0px !important;

        span {
            margin-left: 0px !important;
        }
    }
}