/**=====================
     Tree CSS Start
==========================**/
.theme-tree-box {
    .tree-main-ul {
        margin-top: 25px;
        max-height: calc(80vh - 52px);
        overflow: auto;

        li {
            color: $content-color;
            position: relative;

            [dir="rtl"] & {
                padding-left: 0;
                padding-right: 15px;
            }

            .tree-options {
                display: flex;
                align-items: center;
                gap: 5px;
                opacity: 0;
                visibility: hidden;
                transform: scale(0.8);
                transition: all 0.5s ease;

                @media (max-width: 991px) {
                    opacity: 1;
                    visibility: visible;
                    transform: scale(1);
                }

                a {
                    color: #707070;

                    &:hover {
                        color: rgba($primary-color, 1);
                    }
                }
            }

            &:after {
                opacity: 0;
                visibility: hidden;
                @include pos;
                background-image: url("../../images/32px.png");
                background-position: -68px -4px;
                width: 24px;
                height: 24px;
                line-height: 24px;
                top: 0;
                left: -7px;

                [dir="rtl"] & {
                    left: unset;
                    transform: scaleX(-1);
                    right: -7px;
                }
            }

            >div {
                display: flex;
                flex-wrap: wrap;
                width: 100%;
                gap: 8px;
                align-items: center;
                font-size: 16px;
                border: 1px solid #eee;
                background-color: #f8f8f8;
                padding: 8px;

                body.dark-only & {
                    border-color: #404040;
                    background-color: #0b141d;
                }

                &:hover {
                    .tree-options {
                        opacity: 1;
                        visibility: visible;
                        transform: scale(1);
                    }
                }
            }

            ul {
                padding-left: 14px;
                padding-block: 10px 5px;
                position: relative;

                [dir="rtl"] & {
                    padding-left: 0;
                    padding-right: 9px;
                }

                &:after {
                    @include pos;
                    top: 0;
                    visibility: hidden;
                    opacity: 0;
                    left: 2px;
                    background-image: url("../../images/32px.png");
                    width: 24px;
                    height: calc(100% - 2px);
                    background-position: -292px -4px;
                    background-repeat: repeat-y;

                    [dir="rtl"] & {
                        left: unset;
                        right: 2px;
                    }
                }

                &.child-tree-list {
                    display: grid;
                    gap: 8px;

                    .cursor-pointer {
                        >div {
                            >.tree-icon {
                                background-image: none;
                                @include flex_common;

                                &::before {
                                    content: "\f38f";
                                    @include font;
                                }
                            }
                        }
                    }
                }
            }

            +li {
                margin-top: 10px;
            }

            &.inside-ul {
                &:after {
                    background-position: -132px -4px;
                }
            }
        }

        >li {
            >div {
                border: unset;
                background-color: transparent;
                padding: 0 0 8px;

                body.dark-only & {
                    background-color: transparent;
                }

                >i {
                    margin-left: unset !important;
                }
            }

            &:after {
                @include pos;
                background-image: url("../../images/32px.png");
                background-position: -132px -4px;
            }

            >.menu-level {
                >li {
                    >div {
                        >.tree-icon {
                            background-image: none;
                            @include flex_common;

                            &::before {
                                content: "\f38f";
                                @include font;
                            }
                        }
                    }

                    >ul {
                        >li {
                            >div {
                                >.tree-icon {
                                    background-image: none;
                                    @include flex_common;

                                    &::before {
                                        content: "\f38f";
                                        @include font;
                                    }
                                }
                            }

                            >ul {
                                >li {
                                    >div {
                                        >.tree-icon {
                                            background-image: none;
                                            @include flex_common;

                                            &::before {
                                                content: "\f38f";
                                                @include font;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        .tree-icon {
            margin-left: auto;
            background-image: url("../../images/32px.png");
            width: 24px;
            height: 24px;
            line-height: 24px;
            background-repeat: no-repeat;
            display: inline-block;

            &.folder-icon {
                background-position: -260px -4px;
            }

            &.file-icon {
                background-position: -100px -70px;
            }
        }


    }

    span {
        &.active {
            color: $primary-color;
            font-weight: bold;
        }
    }
}

.cdk-drag-preview-container {
    .cdk-drag {
        >div {
            display: flex;
            flex-wrap: wrap;
            width: 100%;
            gap: 8px;
            align-items: center;
            font-size: 16px;
            border: 1px solid rgb(238, 238, 238);
            background-color: rgb(248, 248, 248);
            padding: 8px;
            margin: 5px;
        }
    }
}

.cdk-drag-preview {
    height: auto !important;
    display: inline-block;

    &::marker {
        display: none;
    }

    >div {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        gap: 8px;
        align-items: center;
        font-size: 16px;
        border: 1px solid rgb(238, 238, 238);
        background-color: rgb(248, 248, 248);
        padding: 8px;
        margin: 5px;
    }

    .cdk-drop-list {
        padding-left: 14px;
        padding-block: 10px 5px;
        position: relative;

        >li {
            +li {
                margin-top: 10px;
            }

            >div {
                display: flex;
                flex-wrap: wrap;
                width: 100%;
                gap: 8px;
                align-items: center;
                font-size: 16px;
                border: 1px solid #eee;
                background-color: #f8f8f8;
                padding: 8px;
            }
        }
    }
}

.cdk-drag-preview-container {
    li {
        display: block;
    }
}

.category-tree-box {
    .theme-tree-box {
        .tree-main-ul {
            li {
                ul {
                    display: grid;
                    gap: 5px;

                    &.child-tree-list {
                        .cursor-pointer {
                            >div {
                                >.tree-icon {
                                    display: none;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}