/*!
 * Copyright 2023 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
 *
 * Licensed 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.
 */
// Treeview
.k-treeview {
    padding: 0;
    border-width: 0;
    background: none;
    box-sizing: border-box;
    outline: 0;
    font-family: @kendo-treeview-font-family;
    font-size: @kendo-treeview-font-size;
    line-height: @kendo-treeview-line-height;
    display: block;
    cursor: default;
    overflow: auto;
    white-space: nowrap;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: @rgba-transparent;

    .k-icon {
        .border-radius( @kendo-treeview-item-border-radius );
    }
}


// Treeview filter
.k-treeview-filter {
    padding: @spacing[1];
    box-sizing: border-box;
    display: block;
    position: relative;
    flex: none;
}


// Treeview group
.k-treeview-group {
    margin: 0;
    padding: 0;
    list-style: none;
    position: relative;
    outline: 0;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: @rgba-transparent;

    &.ng-animating {
        overflow: hidden;
    }
}


// Treeview wrappers
.k-treeview-top,
.k-treeview-mid,
.k-treeview-bot {
    display: flex;
    flex-direction: row;
    align-items: center;
    align-content: center;
}


// Treeview item
.k-treeview-item {
    outline-style: none;
    margin: 0;
    padding: 0 0 0 @kendo-treeview-indent;
    border-width: 0;
    display: block;
}


// Treeview toggle
.k-treeview-toggle {
    flex: none;
    display: inline-flex;
    flex-flow: row nowrap;
    align-items: center;
    cursor: pointer;
    margin-left: -@kendo-treeview-indent;
}
.k-treeview-toggle:empty {
    display: none;
}


// Loading icon
.k-treeview-loading {
    margin-right: @icon-spacing;
}


// Checkbox
.k-treeview .k-checkbox-wrap,
.k-treeview .k-checkbox-wrapper {
    margin-left: @icon-spacing;
    margin-right: @icon-spacing;
    align-self: center;
}


// Treeview leaf
.k-treeview-leaf {
    .border-radius( @kendo-treeview-item-border-radius );
    padding: @kendo-treeview-item-padding-y @kendo-treeview-item-padding-x;
    border: @kendo-treeview-item-border-width solid transparent;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    align-content: center;
    vertical-align: middle;
    position: relative;

    .k-icon,
    .k-image,
    .k-sprite {
        margin-right: @icon-spacing;
    }

    &.k-focus {
        z-index: 1;
    }
}


// Treeview load more button
.k-treeview .k-treeview-load-more-button {
    cursor: pointer;

    &:hover,
    &.k-hover,
    &:focus,
    &.k-focus {
        text-decoration: underline;
    }
}


// RTL
.k-rtl .k-treeview,
.k-treeview[dir="rtl"] {

    // Treeview item
    .k-treeview-item {
        padding-left: 0;
        padding-right: @kendo-treeview-indent;
    }

    // Treeview toggle
    .k-treeview-toggle {
        margin-left: 0;
        margin-right: -@kendo-treeview-indent;
    }

    // Loading
    .k-treeview-loading {
        margin-right: 0;
        margin-left: @icon-spacing;
    }

    // Treeview leaf
    .k-treeview-leaf,
    .k-in {
        .k-icon,
        .k-image,
        .k-sprite {
            margin-right: 0;
            margin-left: @icon-spacing;
        }
    }
}
