@import '../index.scss';

.mods-com-tree-mgmt {
  width: 100%;
  height: 100%;

  .mods-com-tree-mgmt-search {
    display: flex;
    width: 100%;
    height: 42px;
    padding: 0 6px 0 4px;
    // background: rgba(243, 243, 243, 1);
    // border-bottom: 1px solid rgba(228, 228, 228, 1);
    background: $header-background;
    align-items: center;

    &.mods-com-tree-mgmt-search-no-add {
      .mods-com-search {
        width: 100%;
        margin-right: 0;
      }
    }
  }

  .mods-com-search {
    width: calc(100% - 41px);
    margin-right: 5px;
  }

  .mods-com-tree-mgmt-content {
    width: 100%;
    height: calc(100% - 42px);
    padding-top: 16px;
    overflow: auto;

    &.mods-com-tree-mgmt-content-no-search {
      height: 100%;
    }
  }
}

@for $i from 1 through 20 {
  .mods-com-tree-mgmt-content {
    .ant-table-small.ant-table {
      .ant-table-content .ant-table-body table {
        .ant-table-row-level-#{$i} {
          width: 100%;

          td {
            width: 100%;
            padding-left: 15px * $i;// !important;

            .ant-table-row-expand-icon {
              left: calc(24px + 15px * #{$i});// !important;
            }
          }
        }
      }
    }
  }
}

.mods-com-tree-mgmt-content {
  .ant-table-small.ant-table {
    width: 100%;
    border: 0;
    border-bottom: 0;
    border-radius: 0;

    .ant-table-content .ant-table-body table {
      width: 100%;
      padding: 0;
      border-radius: 0;

      th {
        display: none;
      }

      tr {
        width: 100%;

        &:hover {
          td {
            background: transparent;
          }
        }

        &.mods-com-tree-mgmt-item-select {
          td {
            background: rgba(230, 247, 255, 1);
          }
        }

        &.mods-com-tree-mgmt-item-heightlight {
          td {
            .mods-com-tree-mgmt-item {
              color: #f80;
            }
          }
        }

        &.mods-com-tree-mgmt-item-heightlight.mods-com-tree-mgmt-item-select {
          td {
            .mods-com-tree-mgmt-item {
              color: #f80;
            }
          }
        }

        td {
          position: relative;
          width: 100%;
          padding: 0;
          cursor: pointer;
          border: 0;

          .ant-table-row-expand-icon {
            position: absolute;
            top: 50%;
            left: 24px;
            z-index: 1;
            width: 18px;
            height: 18px;
            margin: 0;
            margin-top: -9px;
            opacity: 0;
          }

          .ant-table-row-indent {
            display: none;
          }
        }
      }
    }
  }

  .mods-com-tree-mgmt-item {
    display: flex;
    width: 100%;
    height: 30px;
    padding-left: 24px;
    font-size: 13px;
    // color: #3f3f3f;
    color: $font-color-3f3f3f;
    user-select: none;
    align-items: center;

    &.mods-com-tree-mgmt-item-one-level {
      font-weight: bold;
    }

    .mods-com-tree-mgmt-item-img {
      display: inline-block;
      width: 18px;
      height: 18px;
      margin-right: 5px;
      text-align: right;
      vertical-align: top;

      img {
        position: relative;
        height: 100%;
        object-fit: contain;
      }
    }

    > span {
      display: inline-block;
      width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      flex: 1;
    }
  }
}
