@import '../index.less';
@btri-tree: ~'@{ant-prefix}-btri-tree';
@btri-tree-dropdown: ~'@{ant-prefix}-btri-tree-dropdown';
@tree-prefix-cls: ~'@{ant-prefix}-tree';
@select-tree-prefix-cls: ~'@{ant-prefix}-select-tree';

.@{btri-tree} {
  &.@{tree-prefix-cls} {
    .@{btri-tree}-title-wrapper.is-leaf {
      position: absolute;
      left: -6px;
      width: calc(100% + 3px);
    }

    .@{ant-prefix}-tree-switcher {
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;
      width: 16px;
    }

    .@{ant-prefix}-tree-treenode {
      width: 100%;
      border-radius: 4px;
      padding: 0px;
      margin-bottom: 4px;
      height: 32px;
      align-items: center;

      &:not(.@{ant-prefix}-tree-treenode-selected):not(.@{ant-prefix}-tree-treenode-checkbox-checked):hover {
        background-color: var(--gray-blue-2);

        .@{ant-prefix}-tree-switcher {
          background-color: var(--gray-blue-2);
        }
      }

      &.@{ant-prefix}-tree-treenode-selected {
        background-color: var(--primary-1);
        color: var(--primary-6);

        .@{ant-prefix}-tree-switcher {
          background-color: var(--primary-1);
        }
      }

      .@{ant-prefix}-tree-node-content-wrapper {
        background-color: transparent;
        min-height: 32px;
        line-height: 32px;
        width: 1%;
        flex-grow: 1;
      }

      .@{ant-prefix}-tree-checkbox {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 32px;
        margin: 0;

        &.@{ant-prefix}-tree-checkbox-checked::after {
          border: none;
        }
      }

      .@{ant-prefix}-tree-checkbox-indeterminate {
        .@{ant-prefix}-tree-checkbox-inner {
          background-color: var(--primary-6);
          border-color: var(--primary-6);

          &::after {
            background-color: var(--white);
            height: 2px;
          }
        }
      }
    }
  }
}

.@{btri-tree}-title-box {
  display: flex;
  justify-content: space-between;

  .@{btri-tree}-title-content {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    .i-icon {
      margin-right: 4px;
      top: 1px;
    }
  }

  .@{btri-tree}-title-icon-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    font-size: 16px;

    .@{ant-prefix}-btri-icon-box {
      cursor: pointer;

      &:hover {
        color: var(--primary-6);
      }
    }
  }

  .@{ant-prefix}-btri-input-box {
    margin-left: -8px;
    padding-left: 7px;
  }
}

.@{ant-prefix}-tree
  .@{ant-prefix}-tree-treenode-draggable.@{ant-prefix}-tree-treenode
  .@{ant-prefix}-tree-draggable-icon {
  width: 16px;
}
