
.mw-tree {
    container-name: mw-tree-root;
    container-type: inline-size;
  .mw-tree-nav-skin-default {
       padding-inline: 20px;
      padding-block: 10px 20px;
  }
  * {
    vertical-align: middle;
  }
    tree-label input{
        pointer-events: none;
    }
}

.mw-tree-nav {
  li.skip-true {
    opacity: .6;
    pointer-events: none;
    cursor: no-drop;
  }

  .opened > ul {
    display: block;
  }
  tree-label{
    input{
        pointer-events: none;
    }
  }
}

.form-group > .mw-tree-nav-skin-default {
     padding-block-start: 15px;
}
 .mw-tree-context-menu-content-default,
.mw-tree-nav-skin-default .mw-tree-context-menu-content{
    position: absolute;
    background-color: var(--tblr-bg-surface);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    top: calc(100% - 2px);
    top: auto;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px;
    z-index: 12;
    transition: .3s;
    padding: 9px;
    margin-top: 9px;
    z-index: 1061;
}

.mw-tree-context-menu-content-mode-dropdown {
    &.mw-tree-context-menu-content-default{
        right: auto;
        display: none;
        &.mw-tree-context-menu-content-active{
            visibility: visible;
            opacity: 1;
            pointer-events: all;
            display: block;

        }
    }
}

.mw-tree-context-menu-content-default .mw-tree-context-menu-item  {
    font-size: 14px;
    display: block;
    position: relative;
    border: 1px solid transparent;

    cursor: pointer;
    white-space: nowrap;
    padding: 1px 10px;
    &>.mdi,
    &>[class*="icon"]{
        margin-inline-end: 7px;
    }
}

.mw-tree-context-menu-content-default .mw-tree-context-menu-item {
visibility: visible;
}

.mw-tree-context-menu-content-default .mw-tree-context-menu-item:hover {
    opacity: 1;

  background-color:var(--tblr-body-bg) ;

}


.mw-tree-nav-skin-default .mw-tree-context-menu-content-button{
        position: relative;
        opacity: 0;
        transition: .3s;
        transform: scale(.7);
        pointer-events: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 25px;
        height: 25px;
        background-color: rgba(183, 216, 255, 0.15);
        margin-inline-end: 5px;
        border-radius: 3px;
        overflow: hidden;
        margin-left: auto;
       &:after{
           position: absolute;
           content: '';
           width: 100%;
           height: 100%;
           top: 0;
           left: 0;
           transition: .3s;
           background-repeat: no-repeat;
           background-position: center;
           background-size: auto 12px;
           background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 24 24'%3E%3Cpath d='M6 12c0 1.657-1.343 3-3 3s-3-1.343-3-3 1.343-3 3-3 3 1.343 3 3zm9 0c0 1.657-1.343 3-3 3s-3-1.343-3-3 1.343-3 3-3 3 1.343 3 3zm9 0c0 1.657-1.343 3-3 3s-3-1.343-3-3 1.343-3 3-3 3 1.343 3 3z'%3E%3C/path%3E%3C/svg%3E");

       }
    &:hover{
        background-color: rgba(183, 216, 255, 0.25);
    }
}



.mw-tree-nav-skin-default {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  overflow: auto;

    .tree-item-active-false > .mw-tree-item-content-root .mw-tree-item-title{
        opacity: .7;
        text-decoration: line-through;
    }

    .form-check{
        margin-block: 3px 0;
    }

  ul {
    display: none;
  }
  .mw-tree-item-content {
    cursor: pointer;

  }
  .mw-tree-item-title {
    flex: 1;
    padding-inline: 4px 0;

    display: inline-block;
    border: 1px solid transparent;
    transition: all .3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;


    font-size: 14px;
    color: var(--tblr-body-color);
  }
  tree-label {
    width: 20px;
    & + .mw-tree-item-title {
      max-width: -webkit-calc(100% - 25px);
      max-width: calc(100% - 25px);
    }
  }
  & > li {
      margin: 6px 0;
  }
  li {
      position: relative;
    * {
      vertical-align: middle;
    }

    &.selected > .mw-tree-item-content-root .mw-tree-item-title {
      color: #0e80e5;
      font-weight: bold;
      &:before {
        color: #0e80e5;
        font-weight: normal;
      }
    }
    &.context-menu-active > .mw-tree-item-content-root,
    &.selected > .mw-tree-item-content-root,
    .mw-tree-item-content-root:hover  {
      background: var(--tblr-dropdown-link-hover-bg);

    }
    list-style: none;
    li {
      padding-inline-start: 23px;
      margin-inline-start: 5px;
    }
    ul,
    li {
      position: relative;
    }

      &.selected > .mw-tree-toggler{
          background-color: white;
      }

    ul li:after {
      position: absolute;
      top: 0;
      left: 7px;
      bottom: 0;
      width: 1px;
      content: '';
      background: #ccc
    }

    ul li:last-child:after {
      bottom: auto;
      height: 19px;
    }

    ul li:before {
      position: absolute;
      top: 18px;
      left: 8px;
      width: 15px;
      height: 1px;
      content: '';
      background: #ccc
    }
  }
  .mw-tree-toggler {
    display: inline-block;
    width: 25px;
    color: #bcbfc2;
    font-weight: bold;
    border: none;
    cursor: pointer;
    outline: none;
    text-align: center;
    padding: 0;
    line-height: 31px;
    font-size: 9px;
    font-family: "Material Design Icons";
    float: left;

  }


    .mw-tree-context-menu-item {
        svg {
            width: 20px;
            margin-inline-end: 5px;
        }
    }







    .context-menu-active > .mw-tree-item-content-root,
    .mw-tree-item-content-root:hover{
        .mw-tree-context-menu-content-button{
            opacity: 1;
            pointer-events: all;
            transform: scale(1);
        }
    }
    li.selected{
        & > .mw-tree-item-content-root {
            .mw-tree-context-menu-content-button{
                opacity: 1;
                pointer-events: all;
                transform: scale(1);

            }
        }
    }
     li  .mw-tree-item-content-root {
        .mw-tree-toggler{
            margin-inline: -25px -23px;
            display: flex;

            width: 25px;
            height: 25px;
            color: #bcbfc2;

            border: none;
            cursor: pointer;
            outline: none;
            text-align: center;
            align-items: center;
            justify-content: center;
            padding: 0 !important;
            font-size: 19px;
            font-family: "Material Design Icons";
            position: absolute;
            left: 0;
            top: 0;

            transition: .3s;
            &:before{
                content: "\F0142";
                color: var(--tblr-body-color);
            }

        }
    }
    & > li li .mw-tree-item-content-root {
        .mw-tree-toggler{

            margin-inline: -40px -39px;
            margin-block: 2px 0;
        }
    }
  .mw-tree-toggler svg {
    content: '';
    width: 20px;
    height: 20px;
    transition: .3s;
    position: relative;
    display: inline-block;
    transform: rotate(0deg);
  }

    .opened > .mw-tree-item-content-root .mw-tree-toggler   {
      transform: rotate(90deg);
  }


    .context-menu-active > .mw-tree-item-content-root .mw-tree-context-menu-content-button{

        &:after{
            transform: rotate(-90deg);
        }
    }
    .context-menu-active > .mw-tree-item-content-root .mw-tree-context-menu-content{
        visibility: visible;
        opacity: 1;
        pointer-events: all;
    }


    .mw-tree-item-content-root{
        display: block;
    }

  .mw-tree-item-content {
    color: var(--tblr-body-color);
    padding: 0;
    display: inline-flex;
    align-items: center;
    position: relative;
    outline: none;
    background-repeat: no-repeat;
    line-height: 27px;
    width: 100%;
  }

    .mw-tree-toggler +   .mw-tree-item-content {
        width: unquote("-webkit-calc(100% - 1px)");
        width: unquote("calc(100% - 1px)");
    }

  .has-children > .mw-tree-item-content {
    width: unquote("-webkit-calc(100% - 35px)");
    width: unquote("calc(100% - 35px)");
  }

  .mw-tree-context-menu {
    display: inline-flex;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
      align-items: center;
      justify-content: center;
  }
    .mw-tree-item-content:hover {
        .mw-tree-context-menu {
            background-color: transparent;
        }
    }
    html[dir="rtl"] .mw-tree-nav-skin-default .mw-tree-context-menu {
        right: auto;
        left: 0;
    }
  .mw-tree-item-title [class*='mai-'],
  .mw-tree-item-title [class*='mw-icon-'],
  .mw-tree-aditional-item-icon,
  .mw-tree-item-title:before {
    color: #bcbfc2;
    font-size: 19px;
    display: inline-block;
    position: relative;
    top: 3px;
    margin-inline-end: 3px;
      vertical-align: top;



  }
    .selected > .mw-tree-item-content-root .mw-tree-item-title:before {
        color: #0e80e5;
    }

  .mw-tree-item-title:before {
      font-family: "Material Design Icons";
      width: 20px;
      height: 20px;
      background-size: contain;
      background-position: center center;
      background-repeat: no-repeat;
  }

  .mw-tree-item-title svg{
    width: 20px;
    margin-inline-end: 5px;
  }







  .mw-tree-item-hidden {
    display: none;
  }
}



html[dir="rtl"]{
    /*.mw-tree-nav-skin-default{
        direction: ltr;
    }
    .mw-tree-item-title{
        direction: rtl;
    }*/

      .mw-tree-nav-skin-default .mw-tree-toggler{
        float: right;
    }
     .mw-tree-nav-skin-default li ul li:before{
        left: auto;
        right: 8px;
    }
      .mw-tree-nav-skin-default li ul li:after{
        right:8px;
        left: auto;
    }


    .mw-tree-nav-skin-default .mw-tree-context-menu {

        left: 0;
        right: auto;
    }

    .mw-tree-nav-skin-default > li > .mw-tree-item-content-root .mw-tree-toggler{
        /*margin-inline-start: -14px;*/
        margin-top: 2px;
    }

    .mw-tree-nav-skin-default > li li .mw-tree-item-content-root .mw-tree-toggler{
        margin-inline-start: -40px;
        margin-top: 2px;
    }

    .mw-tree-nav-skin-default .mw-tree-toggler:after{
        transform: rotate(270deg);
    }

}

@mixin treeMobile {
    .mw-tree-nav-skin-default{
        & > li > .mw-tree-item-content-root .mw-tree-toggler {
            margin-inline: -15px -23px;
        }
        & > li li .mw-tree-item-content-root .mw-tree-toggler {
            margin-inline: -15px -39px;
        }
        li li{
            padding-inline-start: 8px;
            margin-inline-start: 5px;
        }
        li:before,
        li:after{
            display: none;
        }
        .mw-ui-check input + span{
            width: 12px;
            height: 12px;
            margin-inline-start: 7px;
        }
    }

}

@supports (container-name: mw-tree-root) {
    @container mw-tree-root (max-width: 300px) {
        @include treeMobile;
    }
}
@supports not (container-name: mw-tree-root) {
    @media (max-width: 1200px) {
        @include treeMobile;
    }
}


.mw-tree-nav-skin-category-manager{
    margin: 0;
    padding: 0;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    .form-check{
        cursor: pointer;
        input{
            pointer-events: none;
        }
    }
    .mw-tree-item-content{
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        &.item-selectable-true{
            padding-inline-start: 25px !important;
            .mw-ui-check{
                margin-inline: -55px 25px;
            }

            cursor: auto;

        }

    }
    .mw-tree-context-menu-item{
        font-size: 0;
        cursor: pointer;
        display: inline-flex;

        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        border-radius: 3px;
        &:hover{
            background: #7474743a;
        }
    }


    .tree-item-active-false > .mw-tree-item-content-root .mw-tree-item-content:before,
    .tree-item-active-false > .mw-tree-item-content-root .mw-tree-item-title{
        opacity: .5;
        text-decoration: line-through;
    }

    span.mw-tree-context-menu{
        margin-inline-start: auto !important;
        .mw-tree-context-menu-content-button{
            display: none;
        }
        .mw-tree-context-menu-content > * + *{
            margin-inline-start: 10px;
        }
    }
    ul,li{
        margin: 0;
        padding: 0;
        font-size: 14px;
        ul{
            margin-inline-start: 40px;
        }
    }
    ul{
        display: none;
    }
    .ui-sortable > li.ui-sortable-helper{
        cursor: grabbing;
    }
    .ui-sortable > li{
        cursor: grab;
    }
    li.mw-tree-item-hidden{
        display: none;
    }
    li.opened{
        & > ul{
            display: block;
        }
        & > .mw-tree-item-content-root{
            .mw-tree-toggler{
                transform: translateY(-50%) rotate(90deg);
            }
        }
    }
    li{
        list-style: none;
    }
    li[data-type="category"] {
        & > .mw-tree-item-content-root {
            .mw-tree-item-content{
                background: var(--tblr-bg-surface);
                padding: 0.5rem 1rem;

                overflow: hidden;
                border-radius: 10px;
                margin-bottom: 0.5rem;
                &:hover{
                    background: var(--tblr-bg-surface);
                    border-color: #eeeff1;

                    box-shadow: -1px 1px 1px 0 rgba(0, 0, 0, .11);
                }
            }
        }


    }
    li[data-type="page"] {
        padding-top: 10px;
        & > .mw-tree-item-content-root {
            .mw-tree-item-content{
                padding: 15px 25px 10px 25px;
                background-color: #fff;

                border-bottom: 0;
                position: relative;
                overflow: hidden;
                background-color: var(--tblr-bg-surface);
                margin-bottom: 10px;
            }
        }
    }


    .mw-tree-item-content-root{
        position: relative;
        padding-left: 24px;
        display: block;

        .mw-tree-toggler{
            display: flex;

            width: 25px;
            height: 25px;
            color: #bcbfc2;

            border: none;
            cursor: pointer;
            outline: none;
            text-align: center;
            align-items: center;
            justify-content: center;
            padding: 0 !important;
            font-size: 19px;
            font-family: "Material Design Icons";
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            transition: .3s;
            &:before{
                content: "\F0142";
                color: var(--tblr-body-color);
            }
        }
    }
}


.mw-tree-item-content {
    .form-check {
        margin-bottom: 0;
    }
}

.mw-tree-item-title {
    color: var(--tblr-body-color);
}


