@import '~ant-design-vue/es/style/themes/default.less';

.t-attach-footer-table-scroll {
  margin-top: 2px;

  .ant-table-fixed-footer {
    th {
      height: 39px;
    }
  }
}
.body-x-space {
  height: 1px;
  margin-top: -1px;
}
.fake-header {
  position: sticky;
  height: 0;
  font-size: 0;
  border: 0;
  top: 0;

  & * {
    height: 0 !important;
  }
}
.body-y-space {
  width: 0px;
  float: left;
}

.ant-table-column-fixed-sticky-left {
  &.ant-table-fixed-columns-in-body > * {
    visibility: visible !important;
  }

  display: table-cell;
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  border-right: 0;
}
.ant-table-column-fixed-sticky-right {
  &.ant-table-fixed-columns-in-body > * {
    visibility: visible !important;
  }
  display: table-cell;
  position: sticky;
  right: 0;
  z-index: 3;
  background: #fff;
  border-left: 1px solid #e8e8e8;
}

@table-header-icon-color: #bfbfbf;
@table-header-sort-active-bg: darken(@table-header-bg, 3%);
@table-header-filter-active-bg: darken(@table-header-sort-active-bg, 5%);
.ant-checkbox-disabled .ant-checkbox-inner {
  background-color: #f5f5f5 !important;
}

.t-table {

  .t-col-count{
    padding: 10px 0;
  }
  .ant-table-header.ant-table-hide-scrollbar{
    border-right: 1px solid #e8e8e8;
  }


  .ant-table-bordered.ant-table-empty .ant-table-placeholder{
    border-left: 0;
    border-right: 0;
    border-bottom: 0;

  }

 .ant-table-bordered {

    .ant-table-scroll {
      border-left: 1px solid #e8e8e8;
      border-right: 1px solid #e8e8e8;
      border-bottom: 1px solid #e8e8e8;
      .ant-table-thead > tr > th:last-child,.ant-table-tbody > tr > td:last-child  {
        border-right:0
        }

    }
    .ant-table-header > table,
    .ant-table-body > table,
    .ant-table-fixed-left table,
    .ant-table-fixed-right table {
      border-left: 0;
      border-right: 0;

    }
  }
  .ant-table-thead > tr > th.ant-table-selection-column, .ant-table-tbody > tr > td.ant-table-selection-column {
    padding: 10px 0;
  }
  .ant-table-placeholder {
    display: flex;
    justify-content: center;
    display: flex;
    align-items: center;
  }
  .new-wrapper {
    position: relative;
    margin-top: -1px;
  }
  tr.dragged-row {
    opacity: 0.5;
    transition: all 300ms;
  }

  tr.drag-over {
    background-color: #f2f2f2;
    // transition:all 300ms;
  }
  .drag-area {
    width: 50px;
    text-align: center;
  }

  .ant-table-row-hover {
    .row-drag .row-drag-icon {
      display: block;
    }
    .row-drag .row-drag-count {
      display: none;
    }
  }
  .row-drag {
    position: relative;
    &:hover {
      &::before {
        display: block;
        transform: scale(1.2, 1.3);
      }
    }
    &::before {
      content: '';
      position: absolute;
      width: 100%;
      height: 100%;
      border-radius: 2px;
      background-color: rgba(0, 0, 0, 0.05);
      display: none;
    }

    .row-drag-count {
      color: #c2c2c2;
      // display: none;
    }
    .row-drag-icon {
      transform: rotate(45deg);
      color: #7d8188;
      // cursor: grabbing;
      cursor: grab;
      position: relative;
      display: none;
    }
  }
  .ant-table-placeholder + .ant-table-footer {
    display: none;
  }
  //自定义滚动条
  &.t-custom-scrollbar {
    .ant-table-body-outer {
      margin-bottom: 0 !important;
    }
    .ant-table-scroll {
      ::-webkit-scrollbar {
        background-color: transparent;
      }
      ::-webkit-scrollbar-thumb {
        background-color: transparent;
      }
    }
    .ant-table-fixed-left,
    .ant-table-body-inner {
      ::-webkit-scrollbar {
        display: none;
      }
      ::-webkit-scrollbar-thumb {
        background-color: transparent;
      }
    }
  }
  .custom-scrollbar {
    position: relative;
    overflow: hidden;
  }

  .content {
    overflow-y: scroll;
    position: relative;
    scrollbar-width: none;
  }
  .content::-webkit-scrollbar {
    display: none;
  }
  .content::-webkit-scrollbar-thumb {
    background-color: transparent;
  }

  .scrollbar {
    cursor: pointer;
    z-index: 3;
    position: absolute;
    background-color: transparent;
    transform: translate3d(0, 0, 0);
    transition: all 120ms ease-out;
    &:hover,
    &:active {
      background-color: rgba(0, 0, 0, 0.15);
      .thumb {
        transition: all 120ms ease-out;
        background-color: rgba(0, 0, 0, 0.3);
      }
      &.scrollbar-vertical {
        width: 10px;
      }
      &.scrollbar-horizontal {
        height: 10px;
      }
    }
  }
  // .ant-table-thead > tr:hover:not(.ant-table-row-hover):not(.ant-table-expanded-row):not(.ant-table-row-selected) > td,
  // .ant-table-tbody > tr:hover:not(.ant-table-row-hover):not(.ant-table-expanded-row):not(.ant-table-row-selected) > td {
  //   background-color: transparent;
  // }

  .scrollbar-vertical {
    top: 2px;
    right: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    .thumb {
      right: 0;
      top: 0;
      width: inherit;
    }
  }
  .scrollbar-horizontal {
    height: 6px;
    left: 0;
    right: 0;
    bottom: 0;

    .thumb {
      top: 0;
      bottom: 0;
      height: inherit;
    }
  }

  .thumb {
    position: absolute;

    border-radius: 5px;
    background-color: #ccc;
    transform: translate3d(0, 0, 0);
    &:hover,
    &:active {
      background-color: rgba(0, 0, 0, 0.3);
    }
  }
}
.t-table {
  .t-table-drag-line {
    &.row-edge {
      width: 100%;
      height: 1px;
      left: 0;
      right: 0;
      background-color: @primary-color;
      border: 0;
      z-index: 3;
    }
    width: 1px;
    position: absolute;
    // transform: none !important;
    //height: 100% !important;
    border-left: 1px dashed @primary-color;
    bottom: 0;
    top: 0;
    left: 0;
    cursor: col-resize;
    touch-action: none;
    z-index: 10;
  }
  .ant-table-fixed-left,
  .ant-table-fixed-right {
    z-index: 2;
  }
  .ant-table-body {
    td,
    th {
      // min-height: 39px;
      // height: 39px;
      content-visibility: auto;
      contain-intrinsic-size: 200px;
    }
    tr{
      content-visibility: auto;
      contain-intrinsic-size: 200px;

    }
  }
  &.t-table-expand {
    & > .ant-spin-nested-loading > .ant-spin-container > .ant-table > .ant-table-content {
      & > .ant-table-fixed-right {
        height: 100%;
        & .ant-table-body-outer {
          height: 100%;
          & .ant-table-body-inner table {
            height: 100%;
          }
        }
      }
    }
  }

  tr.ant-table-row-selected td,
  tr:hover.ant-table-row-selected > td,
  tr:hover.ant-table-row-selected > td {
  }
  tr.active > td {
    background-color: #fff4ea !important;
  }

  tr.active:hover > td {
    background: #ffe6c6 !important;
  }
  colgroup > col.ant-table-selection-col {
    width: 32px;
  }

  &.p-radio {
    th[key='selection-column'] {
      .ant-checkbox {
        display: none;
      }
    }
  }
  .td-primary-color {
    color: white;
    background-color: @primary-color !important;
  }

  .td-success-color {
    color: white;

    background-color: @success-color !important;
  }
  .td-warning-color {
    color: white;
    background-color: @warning-color !important;
  }

  .td-error-color {
    color: white;

    background-color: @error-color !important;
  }
  .ant-table-column-has-actions {
    position: relative;
  }
  .ant-table-row-hover {
    .ant-table-column-has-actions {
      &:hover {
        .handle-color {
          display: block;
        }
      }
    }
  }
  .handle-color {
    cursor: pointer;
    //  display: none;
    //  position: absolute;
    //  top: 0;
    //  bottom: 0;
    //  left: 0;
    //  right: 0;
    //  padding: 10px 8px;
    //  width: 4px;
    // height: 100%;
    // background-color:@primary-color;
    // &::before{

    // }
  }

  &-footing {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    .ant-statistic-content-suffix {
      color: rgba(0, 0, 0, 0.45);
    }
    &-head {
      font-size: 14px;
      flex: 1;
      color: rgba(0, 0, 0, 0.45);
    }
    &-item {
      padding: 0 8px;
      position: relative;
      &:not(:last-child) {
        &::before {
          position: absolute;
          content: '';
          right: 0;
          top: 16px;
          bottom: 5px;
          border-right: 1px solid rgba(0, 0, 0, 0.15);
        }
      }
      .ant-statistic-title {
        margin-right: 10px;
      }
    }
  }
  .baseline {
    display: flex;
    align-items: baseline;
  }
  .ant-table {
    // tbody {
    //   background: #ffff;
    // }
    th,
    td {
      white-space: nowrap;
    }
  }

  .columns-fixed,
  .columns-move {
    .anticon {
      margin-right: 0;
    }
  }
  .ant-table-thead > tr > th .ant-table-column-sorter .ant-table-column-sorter-inner-full {
    margin-top: -0.4em;
  }
  .ant-table-expand-icon-th,
  .ant-table-row-expand-icon-cell {
    width: 30px;
    min-width: 30px;
  }

  .ant-table-thead > tr > th[key='_row_count'],
  .ant-table-column-has-filters {
    .anticon {
      > svg {
        position: absolute;
        top: 50%;
        left: 50%;
        margin-top: -5px;
        margin-left: -6px;
      }
    }
    .anticon-layout {
      position: absolute;
      top: 0;
      right: 0;
      left: 0;
      height: 100%;
      color: @table-header-icon-color;
      font-size: 14px;
      text-align: center;
      cursor: pointer;
      transition: all 0.3s;
    }

    &:hover {
      .anticon-layout,
      .anticon-layout-icon {
        &:hover {
          color: @text-color-secondary;
          background: @table-header-filter-active-bg;
        }
        &:active {
          color: @text-color;
        }
      }
    }
  }
  col {
    transition: all 0.2s, transform 0.2s;
  }
  .ant-table-bordered {
    .vdr {
      border-left: 0;
      opacity: 0 !important;
    }
  }
  .vdr {
    border: 0;
    border-left: 1px dashed #e8e8e8;
  }

  .t-table-drag-line {
    &.row-edge {
      width: 100%;
      height: 1px;
      left: 0;
      right: 0;
      background-color: @primary-color;
      border: 0;
      z-index: 3;
    }
    width: 1px;
    position: absolute;
    // transform: none !important;
    //height: 100% !important;
    border-left: 1px dashed @primary-color;
    bottom: 0;
    top: 0;
    left: 0;
    cursor: col-resize;
    touch-action: none;
    z-index: 10;
  }
  .resize-table-th {
    position: relative;
    .table-draggable-handle {
      position: absolute;
      transform: none !important;
      height: 100% !important;
      bottom: 0;
      top: 0;
      right: 0;
      left: auto !important;
      cursor: col-resize;
      touch-action: none;
    }
  }
  .ant-menu {
    max-height: 390px;
  }
  .confirm,
  .clear {
    position: relative;
  }
  .ant-menu-item.ant-dropdown-menu-item {
    margin: 0 !important;
    padding: 4px 8px;
    height: auto;
    line-height: 22px;
  }

  .ant-dropdown-menu-item.flex-item {
    display: flex;
    .ant-checkbox-wrapper {
      flex: 1;
    }
    &.hover {
      .show {
        opacity: 1;
      }
      transition: all 0.3s;
    }
    &.hover {
      opacity: 1;
    }
    .show {
      opacity: 0;
      transition: all 0.3s;
    }
    .columns-move {
      flex: 0;
      width: 76px;
      padding-left: 10px;
    }
    .columns-fixed {
    }
  }

  .p-columns-fixed.left,
  .p-columns-fixed.right {
    i {
      transform: rotate(-45deg);
    }
  }
}
.ant-popover.p-columns-fixed,
.ant-popover.handle-color {
  .ant-badge {
    cursor: pointer;
  }
  .ant-badge-status-dot {
    width: 12px;
    height: 12px;
  }
  .anticon-stop.ant-scroll-number-custom-component {
    position: relative;
    transform: none;
  }
  .ant-badge-status-text {
    margin-left: 6px;
  }
  .ant-popover-inner-content {
    padding: 4px;
  }
  .separator {
    color: rgba(@text-color, 0.2);
  }
  .fixed-btn {
    & ~ .fixed-btn {
      margin-left: 5px;
    }
    width: 20px;
    height: 20px;
    border-radius: 50%;
  }
  .p-active {
    color: #fff;
    background-color: @primary-color;
    border-color: transparent;
  }
}

.t-attach-footer{
  .ant-table-footer {
    &::before {
      top: 0px;
    }
    border: 0 !important;
    position: relative;
    padding: 0;
  }
  .t-attach-footer-table {
    border-bottom: 1px solid #e8e8e8;
    ::-webkit-scrollbar {
      display: none;
    }
    ::-webkit-scrollbar-thumb {
      background-color: transparent;
    }
    .ant-table-body-outer {
      .ant-table-fixed {
        border-bottom: 0;
      }
      .ant-table-tbody > tr > td {
        border-top: 1px solid #e8e8e8;
      }
    }
    .ant-table-tbody > tr > td {
      border-bottom: 0;
    }
    .ant-table-tbody > tr.ant-table-row-hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td {
      background: transparent !important;
    }
    .ant-table-fixed-left > .ant-table-body-outer {
      width: 32px;
    }

    &:before {
      content: '';
      height: 1px;
      background-color: #e8e8e8;
      position: absolute;
      z-index: 2;
      width: 100%;
      top: 0;
    }

    .ant-table-tbody {
      background: #fafafa;
      // background:#e8e8e8;
    }
    .ant-table-body {
      overflow-x: hidden !important;
    }
    .ant-table-tbody > tr > td:not(.ant-table-column-has-filters) {
      font-weight: bold;
      // color: @primary-color
    }
    .ant-table-column-has-filters {
      padding: 0;
    }
  }
}
