$table-border: 1px solid $tf-light-gray;
$table-border-interior: 1px solid $tf-extra-light-gray-1;

.table {
  width: 100%;
  border-bottom: $table-border;

  th,
  td {
    vertical-align: top;
  }

  tbody tr:last-child {
    border-bottom: 0;
  }

  .is-empty {
    td {
      padding: {
        top: 50px;
        bottom: 50px;
      }
      font-weight: 600;
      color: $tf-medium-gray;
      text-align: center;
    }
  }
}

.table-parent {
  table-layout: fixed;

  &.empty-table {
    border-bottom: $table-border;
  }

  thead tr {
    background: $tf-extra-light-gray-2;
  }

  > tbody {
    > tr {
      &:not(.row-parent) {
        border-top: $table-border;
      }

      &:hover:not(.row-parent):not(.is-empty) {
        background: $tf-light-blue;
      }

      &.row-parent {
        border-bottom: 0;
        display: none;

        /* stylelint-disable max-nesting-depth  */
        &.is-expanded {
          display: table-row;
        }

        /* stylelint-disable-next-line selector-max-compound-selectors */
        > td {
          padding: 0;
        }
        /* stylelint-enable max-nesting-depth  */
      }
    }
  }

  th,
  td {
    padding: 15px 20px;
    font-size: 14px;
    line-height: 21px;

    &:first-child {
      border-left: $table-border;
    }

    &:last-of-type {
      border-right: $table-border;
    }

    &.cell-child-table {
      border-top: 0;
    }
  }

  th {
    border-top: $table-border;
    border-bottom: $table-border;
    text-align: left;
    font-size: 16px;
    font-weight: 700;
  }
}

.table-child {
  border: {
    left: 10px solid $tf-extra-light-gray-1;
    bottom: $table-border-interior;
  }

  td,
  th,
  td:last-of-type,
  th:last-of-type {
    border-right: 0;
  }

  thead {
    tr {
      box-shadow: inset 0 -1px 0 0 $tf-extra-light-gray-1, inset 1px 0 0 0 $tf-extra-light-gray-1, inset -1px 0 0 0 $tf-extra-light-gray-1, inset 0 2px 1px 0 rgba($tf-extra-light-gray-1, .5);
      background: $tf-extra-light-gray-2;
    }

    th {
      padding: 11px 20px;
      border-top: 0;
      font-size: 14px;
    }
  }

  tbody {
    tr {
      &:last-child {
        border-bottom: 0;
      }

      &:hover {
        background: $tf-light-blue;
      }
    }

    td {
      border-top: 0;
    }
  }
}
