@import '../../../global/theme.less';
@import '../../../global/mixin.less';

.container {
  display: flex;
  flex-direction: column;
}

// chart里面legend里的table
.tableContainer {
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  .scrollbar(@t-scrollbar-thumb-color, 10px, @t-dashboard-block-bg);
  &:hover {
    .scrollbar(@t-scrollbar-thumb-color, 10px, @t-dashboard-block-bg, 0px);
  }
}
.table {
  display: flex;
  flex-flow: column nowrap;
  font-size: 12px;
  line-height: 1.2;
  width: fit-content;
  min-width: 100%;
  height: 100%;
}

.tableResizer {
  position: absolute;
  width: 56px;
  height: 18px;
  z-index: 1000;
  right: 0;
  margin-top: -24px;

  .icon {
    display: none;
  }

  &:hover {
    .icon {
      display: inline-block;
      cursor: pointer;
      font-size: 12px;
      color: @icon-color-2;
      transform: scaleY(0.7);
    }
  }

  :global {
    .react-resizable-handle {
      cursor: ew-resize !important;
      right: 6px !important;

      &::after {
        content: '';
        position: absolute;
        right: 3px;
        bottom: 3px;
        width: 5px;
        height: 5px;
        border-right: 2px solid rgba(0, 0, 0, 0.4);
        border-bottom: 2px solid rgba(0, 0, 0, 0.4);
      }
    }
  }
}

.tr {
  width: 100%;
  display: flex;
  flex-flow: row nowrap;
}

.td {
  padding: 14px 8px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0px;
  white-space: nowrap;
  justify-content: center;

  :global {
    .react-resizable {
      height: 100%;
    }
    .react-resizable-handle {
      cursor: col-resize;
      width: 10px;
      height: 100%;
      opacity: 0;
    }
  }
}

.thContainer {
  :global {
    .react-resizable {
      height: 100%;
    }
    .react-resizable-handle {
      cursor: col-resize;
      right: 2px !important;
      height: 62%;
      top: 50%;
      transform: translateY(-50%);
      padding: 2px;
      width: 11px;
      opacity: 0;
      transition: opacity 0.2s ease-in-out;
      background-image: url('./images/resize-col.svg');
      background-repeat: no-repeat;
      background-size: 100% 100%;
      background-color: @icon-color;
    }
  }

  &:hover {
    :global {
      .react-resizable-handle {
        opacity: 0.3;
      }
    }
  }
}

.thContainer,
.tdContainer {
  display: flex;
  align-items: center;
  &:last-child {
    flex: 1;

    > .td {
      min-width: 100%;
    }
  }
}

.title {
  display: flex;
  align-items: center;
  color: @second-primary-color;
  font-weight: 500;
  position: relative;
}

.small {
  line-height: 1.3;

  .tr .td {
    padding: 4px !important;
    padding-top: 0px !important;
    padding-bottom: 0px !important;
  }
}

.large {
  line-height: 3;
  font-size: 14px;

  .tr .td {
    padding: 8px !important;
    padding-top: 0px !important;
    padding-bottom: 0px !important;
  }
}

.middle {
  .tr .td {
    line-height: 1 !important;
  }
}

.columnFixed {
  position: sticky;
  z-index: 100;
}

.columnFixedRightLast {
  &::after {
    position: absolute;
    top: 0;
    left: 0px;
    bottom: -1px;
    width: 30px;
    box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
    -moz-box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
    -webkit-box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: box-shadow 0.3s, -webkit-box-shadow 0.3s;
    content: '';
  }
}

.columnFixedLeftLast {
  &::after {
    position: absolute;
    top: 0;
    right: 0px;
    bottom: -1px;
    width: 30px;
    box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, 0.15);
    -moz-box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, 0.15);
    -webkit-box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    -webkit-transform: translateX(100%);
    transition: box-shadow 0.3s, -webkit-box-shadow 0.3s;
    content: '';
  }
}

.tableBody {
  overflow-y: auto;
  flex: 1;
  .scrollbar(@t-scrollbar-thumb-color, 10px, @t-dashboard-block-bg);
  &:hover {
    .scrollbar(@t-scrollbar-thumb-color, 10px, @t-dashboard-block-bg, 0px);
  }
}
