@import '../global.scss';

:root {
  --ag-checkbox-checked-color: #{$primary-5};
}

.tea-datagrid {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}

.tea-grid-pagination {
  border-top: 1px solid $border-color-split;
  padding: 8px;
  text-align: right;
}

.tea-grid {
  background: #fff;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  // .ag-body-container,
  // .ag-center-cols-container {
  //   min-width: 100%;
  // }
  // .ag-body {
  //   overflow: auto;
  // }
  .tea-body-grid {
    flex: 1 1 auto;
  }
  .tea-footer-grid {
    flex: 0 0 auto;
    .ag-cell {
      font-weight: 700;
    }
  }
  .ag-header {
    background: rgba($color: $text-color, $alpha: 0.08);
    color: #555;
  }
  * {
    &::-webkit-scrollbar {
      width: 6px;
      height: 6px;
    }
    &::-webkit-scrollbar-track {
      background: rgba($color: #000000, $alpha: 0);
    }
    &::-webkit-scrollbar-thumb {
      background: rgba(25, 31, 37, 0.4);
      border-radius: 0;
      &:hover {
        background: rgba(25, 31, 37, 0.72);
      }
    }
  }
  .ag-header-group-cell:not(.ag-column-resizing) + .ag-header-group-cell:hover,
  .ag-header-group-cell:not(.ag-column-resizing)
    + .ag-header-group-cell.ag-column-resizing,
  .ag-header-cell:not(.ag-column-resizing) + .ag-header-cell:hover,
  .ag-header-cell:not(.ag-column-resizing) + .ag-header-cell.ag-column-resizing,
  .ag-header-group-cell:first-of-type:hover,
  .ag-header-group-cell:first-of-type.ag-column-resizing,
  .ag-header-cell:first-of-type:hover,
  .ag-header-cell:first-of-type.ag-column-resizing {
    background: $primary-3;
  }
  .ag-header-cell.ag-header-cell-moving,
  .ag-header-group-cell.ag-header-cell-moving {
    background-color: $primary-3;
  }
  .ag-row-hover {
    background-color: $primary-1;
  }

  .ag-ltr .ag-has-focus .ag-cell-focus:not(.ag-cell-range-selected),
  .ag-ltr .ag-has-focus .ag-cell-focus.ag-cell-range-single-cell,
  .ag-ltr .ag-cell-focus.ag-cell-range-single-cell.ag-cell-range-handle,
  .ag-rtl .ag-has-focus .ag-cell-focus:not(.ag-cell-range-selected),
  .ag-rtl .ag-has-focus .ag-cell-focus.ag-cell-range-single-cell,
  .ag-rtl .ag-cell-focus.ag-cell-range-single-cell.ag-cell-range-handle {
    border: 1px solid rgba(0, 0, 0, 0);
    outline: initial;
    &.ag-cell-last-left-pinned {
      border-right: 1px solid $border-color-split;
    }
    &.ag-cell-first-right-pinned {
      border-left: 1px solid rgba($color: $text-color, $alpha: 0.12);
    }
  }
  .ag-icon {
    color: rgba(25, 31, 37, 0.4);
  }
  .ag-row-selected {
    background: rgba($color: $primary-5, $alpha: 0.28);
  }
  .ag-icon-checkbox-checked {
    color: $primary-10;
  }
  .ag-center-cols-viewport {
    &::-webkit-scrollbar {
      display: none;
    }
  }
  .ag-body-viewport .ag-center-cols-container {
    min-width: 100%;
  }
}
