@import '../../style/variables.less';

.pro-tree-select-drop-down-container {
  .@{ant-prefix}-select-tree-checkbox {
    margin-top: 0;
  }
}

.pro-tree-modal-container .@{ant-prefix}-modal-content .@{ant-prefix}-modal-body {
  max-height: 498px !important;
}

.pro-tree-modal {
  .pro-enum-input-addonAfter {
    display: flex;
    align-items: center;
    padding: 0px 8px;
    background-color: var(--zaui-base-bg, #ffffff);
    border: 1px solid #d9d9d9;
    border-left: none;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    cursor: pointer;
    transition: none;
    position: relative;
    .close-icon {
      position: absolute;
      left: -20px;
      background: #bfbfbf;
      border-radius: 50%;
      width: 12px;
      height: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-size: 8px;
      cursor: pointer;
      z-index: 5;
      &:hover {
        background: #666;
      }
    }
  }

  .@{ant-prefix}-space-compact {
    // 最后一个子元素为 input 时，右上、右下圆角 8px（与左侧 select 组成紧凑形态时右侧圆角）
    > input:last-child,
    > .@{ant-prefix}-input:last-child {
      border-top-right-radius: 6px !important;
      border-bottom-right-radius: 6px !important;
    }
  }

  .pro-enum-input-addonAfter:not(.trigger-no-hover):not(.pro-enum-input-addonAfter-not-allowed):hover {
    z-index: 2;
    border-color: var(--zaui-brand-hover, #3387ff);
    color: var(--zaui-brand-hover, #3387ff);
    box-shadow: -1px 0 0 0 var(--zaui-brand-hover, #3387ff);

    .pro-tree-modal-view-svg-active {
      color: var(--zaui-brand-hover, #3387ff);
    }
  }
  &-placeholder {
    color: #939499;
  }

  .@{ant-prefix}-input-disabled {
    border-radius: 0 !important;
  }

  .@{ant-prefix}-input-group-wrapper:hover {
    .pro-tree-modal-view-svg {
      color: var(--zaui-brand);
    }
  }
  .pro-tree-modal-view-svg {
    color: inherit;
    div {
      display: flex;
    }
  }

  .pro-tree-modal-view-svg-active {
    color: var(--zaui-brand, #006aff);
  }

  .pro-tree-modal-view-svg-not-allowed {
    cursor: not-allowed;
    div,
    svg {
      cursor: not-allowed;
    }
  }

  .pro-enum-input-addonAfter-not-allowed {
    cursor: not-allowed;
  }

  &-content {
    display: flex;
    flex-direction: row;
    height: 482px;
    margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
    .checked-container {
      .@{ant-prefix}-btn {
        &:active {
          background: transparent;
        }
      }
    }

    .@{ant-prefix}-tree-checkbox {
      align-self: flex-start;
      margin-top: 2px;
    }

    .@{ant-prefix}-tree-switcher {
      width: 20px;
      line-height: 20px;
    }

    .@{ant-prefix}-tree-treenode {
      width: 100%;
      padding: 0;
      padding-bottom: var(--zaui-font-size-sm, 12px);
      color: var(--zaui-text);
      font-size: var(--zaui-font-size, 14px);
      line-height: 20px;
    }

    .@{ant-prefix}-tree-node-content-wrapper {
      min-height: 20px;
      line-height: 20px;
    }

    .@{ant-prefix}-tree-node-content-wrapper {
      width: 100%;
    }
  }

  &-box {
    display: flex;
    flex-direction: column;
    width: 456px;
    height: 100%;
    color: var(--zaui-text);
    font-size: var(--zaui-font-size, 14px);
    line-height: 20px;
    border: 1px solid #e6e6e6;
    border-radius: var(--zaui-border-radius, 8px);

    &:first-child {
      margin-right: var(--zaui-space-size-md, 16px);
    }

    .pro-tree-modal-search-svg > div {
      display: flex;
    }

    /* 修改滚动条样式 */
    ::-webkit-scrollbar {
      width: 0;
      height: 0;
    }
    .pro-tree-modal-tree-warp {
      ::-webkit-scrollbar {
        width: 16px;
        height: auto;
      }
    }
  }

  &-cascader-box {
    width: 592px;
  }

  &-cascader-box-view {
    width: 320px;
  }

  &-search {
    width: auto;
    margin: var(--zaui-space-size-sm, 8px) var(--zaui-space-size-md, 16px) 0;
  }

  &-cascader-flex {
    display: flex;
    flex-direction: row;
    height: 100%;
    overflow: hidden;
  }

  &-cascader-warp {
    display: flex;
    flex-direction: column;
    width: 350px;
    margin-left: var(--zaui-space-size-md, 16px);
    overflow: auto;

    &:first-child {
      width: 192px;
      margin-left: 0;
      border-right: 1px solid #e6e6e6;
    }
  }

  &-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    padding: 0 var(--zaui-space-size-md, 16px);
    background: #fafafa;

    &:first-child {
      color: #616161;
      border-radius: 6px 0 0 6px;
    }

    .@{ant-prefix}-btn-link {
      padding: 0;
    }
  }

  &-tree-warp {
    flex: 1;
    margin: 0 var(--zaui-space-size-md, 16px);
    padding-top: 16px;
    overflow-y: auto;
  }

  &-checkbox-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
    line-height: 20px;
    cursor: pointer;

    &-look {
      color: #333;
    }

    &-drag {
      display: flex;
    }
  }

  &-cascader-content {
    margin-bottom: 0;
    padding: 6px;
  }

  &-check-cascader-content {
    color: var(--zaui-brand);
    background: rgba(0, 106, 255, 0.1);
  }

  &-isView {
    display: flex;
    align-items: center;

    .pro-tree-modal-view-svg {
      margin-left: var(--zaui-space-size-sm, 8px);
    }
  }

  &-tree-content {
    margin-bottom: 0;
  }

  &-search-value {
    color: var(--zaui-brand);
  }

  &-checkbox-close {
    padding-left: var(--zaui-space-size-sm, 8px);
    color: #c5c7cd;
    font-size: var(--zaui-font-size-sm, 12px);
  }

  &-tree-node {
    display: flex;
    flex-direction: row;

    &:last-child {
      flex: 1;
    }
  }

  &-tree-node-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    margin-right: var(--zaui-space-size-sm, 8px);
    padding: 0 var(--zaui-space-size-xs);
    font-weight: 400;
    line-height: 24px;
    white-space: nowrap;
    border-radius: var(--zaui-border-radius-card);

    span {
      font-size: var(--zaui-font-size-sm, 12px);
      line-height: 20px;
      text-align: center;
      transform: scale(0.83, 0.83);
    }
  }
}

.pro-tree-modal-no-checks {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #939599;
  font-weight: 400;
  font-size: var(--zaui-font-size, 14px);
}

.pro-transfer-right {
  .@{ant-prefix}-checkbox {
    align-items: flex-start;
  }
  .checked-item.checked-item-0.disabled {
    .disabled-icon {
      margin: 4px 0 0 2px;
    }
  }
  .checked-item {
    margin: var(--zaui-space-size-sm, 8px) 0;

    &.disabled.dragable {
      .@{ant-prefix}-tag {
        justify-content: flex-start;
        .singleLine {
          margin-left: 8px;
        }
      }
    }
    &.dragable {
      .ant-tag {
        & > span:first-child {
          padding: 8px 0;
          cursor: move;
        }
      }
    }

    &:first-child {
      margin-top: 0;
    }

    .@{ant-prefix}-tag {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      height: 32px;
      padding: 2px var(--zaui-space-size-sm, 8px);
      color: var(--zaui-text, #343434);
      font-size: var(--zaui-font-size, 14px);
      background: #f2f2f2;
      border: none;
      border-radius: var(--zaui-border-radius, 8px);

      .pro-tooltip {
        flex: 1;
        max-width: calc(100% - 42px);
      }

      .disabled-icon {
        height: 20px;
        margin-right: var(--zaui-space-size-xs, 4px);
        margin-left: 6px;
        margin-top: 2px;
      }

      .anticon-close {
        margin: 0;
        color: #999;
        font-size: var(--zaui-font-size-sm, 12px);
      }
    }

    &.dragable {
      .anticon-close {
        position: relative;
        left: -4px;
      }
    }

    &.disabled {
      cursor: not-allowed;

      .pro-tooltip,
      .anticon {
        cursor: not-allowed;
      }

      .anticon {
        pointer-events: none;
      }
    }

    .drag-icon {
      font-size: 18px;
      color: #949599;
    }
  }
}
