// -----------------------------------------------------------------------------
// This file contains all styles related to the table component.
// -----------------------------------------------------------------------------
// @import "./variables.scss";

.#{$namespace}table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  text-align: left;
  font-size: $table-font-size;

  thead {
    background: $table-thead-background;
    border-bottom: $table-td-border-bottom;
  }

  tr {
    border-bottom: $table-td-border-bottom;
    &:before {
      content: ' ';
      width: $table-tr-before-width;
      height: $table-tr-before-height;
      display: table-cell;
    }
    &:after {
      content: ' ';
      width: $table-tr-after-width;
      height: $table-tr-after-height;
      display: table-cell;
    }
  }

  tbody {
    background: $table-tbody-background;
    tr {
      &.#{$namespace}active {
        background: $table-tr-active-background;
      }
    }
  }

  &.#{$namespace}table-hover {
    tbody {
      tr {
        &:hover {
          background: $table-tr-hover-background;
        }
      }
    }
  }

  // Tables with horizontal scrollbar
  &.#{$namespace}table-scroll {
    display: block;
    overflow-x: auto;
    padding-bottom: 15px;
    white-space: nowrap;
  }

  th, td {
    padding: $table-tr-padding;
    height: $table-tr-height;
    &:first-of-type {
      padding-left: $table-tr-first-child-padding-left;
    }
  }
  th {
    color: $table-th-color;
    text-align: left;
  }
  td {
    // border-bottom: $table-td-border-bottom;
  }

  .#{$namespace}table-item-select-base {
    display: inline-block;
    position: relative;
    width: 14px;
    height: 14px;
    transform: all .2s ease;
    vertical-align: -0.15em;
    cursor: pointer;
  }
  .#{$namespace}table-item-selected {
    background-color: $table-item-selected-background;
  }
  .#{$namespace}table-item-selected::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 8px;
    margin-top: -5px;
    margin-left: -3px;
    content: '';
    transform: rotate(45deg);
    border: $table-item-selected-after-border;
    border-top-width: 0;
    border-left-width: 0;
    background-clip: padding-box;
  }
  .#{$namespace}table-item-select {
    border: $table-item-select-border;
  }
  .#{$namespace}table-item-select-indeterminate {
    background-color: $table-item-select-indeterminate-background;
  }
  .#{$namespace}table-item-select-indeterminate::after {
    position: absolute;
    top: 50%;
    left: 3px;
    content: '';
    width: 8px;
    margin-top: -1px;
    border-bottom: $table-item-select-indeterminate-border-bottom;
    background-clip: padding-box;
  }

  .#{$namespace}table-body-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 250px;
    color: $table-empty-color;
    .#{$namespace}table-body-empty-text {
      margin-top: 10px;
    }
  }
}
