// 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;

            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";
                    }
                }
            }
        }
    }

    .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: 300px;
        }

        .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;

            &>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;
                    }
                }

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

        .custom-filter {
            .fa {
                font-size: 12px;
            }
        }

        .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: 6px;
        height: 100%;
        width: 9px;
        cursor: col-resize;
        z-index: 999;

        .line {
            position: absolute;
            height: 100%;
            background: $color_mystic_approx;
            left: 1px;
            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: -6px;
            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;
        }
    }
}