@use '@/styles/variables' as *;
@use '@/styles/mixins' as *;

.tableWrapper {
  width: 100%;
  overflow-x: auto;
  @include custom-scrollbar;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: $font-size-sm;

  &__head {
    background-color: $background-color;
  }

  &__th {
    padding: $spacing-md $spacing-base;
    text-align: left;
    font-weight: $font-weight-medium;
    color: $text-secondary;
    white-space: nowrap;
    border-bottom: 1px solid $border-color;

    &--left {
      text-align: left;
    }

    &--center {
      text-align: center;
    }

    &--right {
      text-align: right;
    }
  }

  &__body {
    background-color: $card-background;
  }

  &__tr {
    @include transition-fast;

    &:hover {
      background-color: rgba($primary-color, 0.02);
    }

    &--selected {
      background-color: rgba($primary-color, 0.05);

      &:hover {
        background-color: rgba($primary-color, 0.08);
      }
    }

    &--clickable {
      cursor: pointer;
    }
  }

  &__td {
    padding: $spacing-md $spacing-base;
    color: $text-primary;
    border-bottom: 1px solid $border-color;
    vertical-align: middle;

    &--left {
      text-align: left;
    }

    &--center {
      text-align: center;
    }

    &--right {
      text-align: right;
    }
  }

  &__checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: $primary-color;
  }

  &__loading,
  &__empty {
    text-align: center;
    padding: $spacing-xxxl $spacing-base;
    color: $text-secondary;
  }

  &__loading {
    @include flex-center;
  }
}
