@use '../core/style/spacing' as *;

$uxg-table-cell-icon-margin: $uxg-spacing-2;
$uxg-table-cell-margin: $uxg-spacing-3;
$uxg-table-row-height: 44px;

.mat-mdc-table {
  tr {
    th,
    td {
      white-space: nowrap;
    }
  }

  thead {
    tr {
      height: $uxg-table-row-height;

      th {
        padding-left: $uxg-table-cell-margin;
        padding-right: $uxg-table-cell-margin;

        & > div {
          display: flex;
        }
      }
    }
  }

  tbody {
    tr {
      height: $uxg-table-row-height;

      td {
        padding-left: $uxg-table-cell-margin;
        padding-right: $uxg-table-cell-margin;

        .mat-icon {
          margin-right: $uxg-table-cell-icon-margin;
          overflow: visible;
        }
      }
    }
  }

  tfoot {
    tr {
      height: $uxg-table-row-height;

      td {
        padding-left: $uxg-table-cell-margin;
        padding-right: $uxg-table-cell-margin;

        div {
          display: flex;

          .mat-icon {
            margin-right: $uxg-table-cell-icon-margin;
          }
        }
      }
    }
  }

  td.mat-mdc-cell:first-of-type,
  td.mat-mdc-footer-cell:first-of-type,
  th.mat-mdc-header-cell:first-of-type {
    padding-left: $uxg-spacing-3;
  }

  td.mat-mdc-cell:last-of-type,
  td.mat-mdc-footer-cell:last-of-type,
  th.mat-mdc-header-cell:last-of-type {
    padding-right: $uxg-spacing-3;
  }
}
