@import '../../style/themes/index';

@yee-tree-prefix-cls: ~'@{yee-prefix}-tree';

.@{yee-tree-prefix-cls} {
  &.@{yee-tree-prefix-cls}-directory {
    position: relative;

    // Stretch selector width
    > li,
    .@{yee-tree-prefix-cls}-child-tree > li {
      span {
        &.@{yee-tree-prefix-cls}-switcher {
          position: relative;
          z-index: 1;

          &.@{yee-tree-prefix-cls}-switcher-noop {
            pointer-events: none;
          }
        }

        &.@{yee-tree-prefix-cls}-checkbox {
          position: relative;
          z-index: 1;
        }

        &.@{yee-tree-prefix-cls}-node-content-wrapper {
          border-radius: 0;
          user-select: none;

          &:hover {
            background: transparent;

            &::before {
              background: @yee-item-hover-bg;
            }
          }

          &.@{yee-tree-prefix-cls}-node-selected {
            color: @yee-tree-directory-selected-color;
            background: transparent;
          }

          &::before {
            position: absolute;
            right: 0;
            left: 0;
            height: @yee-tree-title-height;
            transition: all 0.3s;
            content: '';
          }

          > span {
            position: relative;
            z-index: 1;
          }
        }
      }

      &.@{yee-tree-prefix-cls}-treenode-selected {
        > span {
          &.@{yee-tree-prefix-cls}-switcher {
            color: @yee-tree-directory-selected-color;
          }

          &.@{yee-tree-prefix-cls}-checkbox {
            .@{yee-tree-prefix-cls}-checkbox-inner {
              border-color: @yee-primary-color;
            }

            &.@{yee-tree-prefix-cls}-checkbox-checked {
              &::after {
                border-color: @yee-checkbox-check-color;
              }

              .@{yee-tree-prefix-cls}-checkbox-inner {
                background: @yee-checkbox-check-color;

                &::after {
                  border-color: @yee-primary-color;
                }
              }
            }
          }

          &.@{yee-tree-prefix-cls}-node-content-wrapper {
            &::before {
              background: @yee-tree-directory-selected-bg;
            }
          }
        }
      }
    }
  }
}
