@import "xconsole";
$prefix: 'teamix-pro-table';
$fullscreenPadding: 24px;

.#{$prefix} {
  background: var(--table-row-bg, #ffffff);
  position: relative;
  &-footer {
    padding: 8px 0;
    width: 100%;
  }
  &-footer-fixed {
    position: fixed;
    z-index: 3;
    bottom: 0;
    border-top: 1px solid var(--color-line1-2);
    box-shadow: var(--shadow-1-up);
    background: var(--color-fill1-1);
  }
  &-footer-has-rowSelection, &-footer-has-action {
    display: flex;
    align-items: center;
    padding: 8px 0;
    right: 0;
    width: 100%;
  }
  &-footer-left-wrapper {
    display: flex;
    flex-shrink: 0;
    align-items: center;
  }
  &-footer-right-wrapper {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    & > span {
      display: flex;
      justify-content: flex-end;
      width: 100%;
    }
  }
  &-footer-action {
    margin-left: 16px;
  }
  &-footer-checkbox-medium {
    margin-left: var(--table-cell-padding-left, 16px);
  }
  &-footer-checkbox-small {
    margin-left: var(--table-size-s-cell-padding-left, 8px);
  }
  &-selected-msg {
    color: var(--color-fill1-6);
    margin-left: 16px;
  }
  &-fullscreen {
    padding: $fullscreenPadding $fullscreenPadding 0 $fullscreenPadding;

    // 去除全屏锁列之后右侧滚动条阴影
    .next-table-stickylock.next-table-scrolling-to-right {
      &::after {
        box-shadow: unset;
      }
    }

    .teamix-pro-table-footer {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      padding: 10px $fullscreenPadding 8px $fullscreenPadding;
      box-shadow: var(--shadow-1-up);
      background-color: var(--table-row-bg, #ffffff);
      margin: 0;
      z-index: 5;
    }

    .next-table-body {
      transition: all 0.1s;
    }
  }
  &-shadow-container {
    overflow: hidden;
    position: absolute;
    right: 0;
    left: 0;
    top: 0;
    visibility: hidden;
    pointer-events: none;
  }
  &-shadow-container-columns {
    display: flex;
    >* {
      flex-shrink: 0;
    }
  }
  &-action-column-shadow-container {
    overflow: hidden;
    position: absolute;
    right: 0;
    left: 0;
    top: 0;
    visibility: hidden;
    pointer-events: none;
    display: flex;
  }

  // sort icon
  .next-table-sort.next-table-header-icon {
    line-height: 16px;
    margin-left: 6px;
    .teamix-icon {
      position: absolute;
      width: 12px;
    }
    & .current .teamix-icon {
      color: var(--table-sort-color-current, #0064c8);
    }
  }
  .next-table-empty {
    padding: 0;
  }
  .next-table-wrap-empty {
    .next-table-body tr td{
      border-bottom: 0;
    }
  }
}

// .teamix-pro-table-fullscreen {
//   .teamix-pro-table-container {
//     height: calc(100vh - 74px);
//     overflow: hidden;
//     overflow-y: auto;
//   }
// }


.teamix-pro-table-footer-suction {
  margin-bottom: 50px;
  .teamix-pro-table-footer {
    position: fixed;
    bottom: 0;
    padding: 10px $fullscreenPadding 8px $fullscreenPadding;
    box-shadow: var(--shadow-1-up);
    background-color: var(--table-row-bg, #ffffff);
    border-top: 1px solid var(--color-line1-1);
    margin: 0;
    z-index: 2;
  }
}

.next-table-empty {
  --table-empty-padding: 48px;
}

// 后面在基础组件里面覆盖
.next-table.next-table td .next-table-cell-wrapper {
  text-overflow: unset;
}

.mb8 {
  margin-bottom: 8px;
}

.next-table {
  .next-form-preview {
    line-height: unset;
  }
  &-row {
    .teamix-pro-field.teamix-pro-field-text .next-form-preview {
      color: var(--table-row-color);
    }
  }
  &-row.hovered {
    .teamix-pro-field.teamix-pro-field-text .next-form-preview {
      color: var(--table-row-hover-color);
    }
  }
}

// 排序icon hover 颜色跟随主题
.next-table-sort.next-table-header-icon {
  a:hover {
    color: var(--color-brand1-5);
  }
}
.teamix-pro-tree-table {
  .next-table-cell.first {
    .next-table-cell-wrapper {
      display: flex;
      align-items: center;
    }
  }
}
