/**
 *
 * @ai-apps/angular v2.152.0 | _data-table.scss
 *
 * Copyright 2014, 2023 IBM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


@import '../../vendor/carbon-components/scss/components/data-table/data-table';

.table-header-label {
  &-start {
    .#{$prefix}--table-header-label {
      text-align: start;
    }
  }

  &-center {
    .#{$prefix}--table-header-label {
      text-align: center;
    }
  }

  &-end {
    .#{$prefix}--table-header-label {
      text-align: end;
    }
  }
}

.table-header-label-start .table-header-label-start,
.table-header-label-center .table-header-label-center,
.table-header-label-end .table-header-label-end {
  .#{$prefix}--table-header-label {
    width: 100%;
  }
}

td.data-table {
  &-start {
    text-align: start;
  }

  &-center {
    text-align: center;
  }

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

html[dir='rtl'] {
  .#{$prefix}--table-sort__icon-unsorted,
  .#{$prefix}--table-sort__icon {
    margin-right: $spacing-03;
    margin-left: 0;
  }

  td.data-table {
    &-start {
      text-align: start;
      padding-right: $spacing-04;
    }

    &-center {
      text-align: center;
    }

    &-end {
      text-align: end;
      padding-left: $spacing-05;
    }
  }
}

.#{$prefix}--data-table {
  .table-header-sortable:not(.#{$prefix}--table-sort) {
    padding: 0;
  }
  .#{$prefix}--table-sort {
    padding-left: $spacing-04;
    padding-right: $spacing-04;

    .#{$prefix}--table-header-label {
      padding-left: 0;
      padding-right: 0;
    }
  }

  // override padding on chexkbox cells, so that it aligns with cell content in tables with xl size prop
  &.#{$prefix}--data-table--xl {
    .#{$prefix}--checkbox-table-cell {
      padding-top: $spacing-05;
    }
  }

  &.#{$prefix}--data-table--xs,
  &.#{$prefix}--data-table--sm,
  &.#{$prefix}--data-table--md {
    .#{$prefix}--checkbox-table-cell {
      padding-top: $spacing-01;
      padding-bottom: $spacing-01;
    }
  }

  .#{$prefix}--checkbox-table-cell {
    padding-bottom: $spacing-03;
    padding-top: $spacing-03;
    width: 2.5rem;

    /* Added to undo carbon component. this needs to be removed when we redo this table */
    &::after {
      background-color: transparent !important;
    }
  }
}

.#{$prefix}--toolbar-search-container-active .#{$prefix}--search .#{$prefix}--search-input {
  padding-right: $spacing-09;
}

// Fixes bug when modal is opened, then closed. The toolbar moves to the top
section.#{$prefix}--table-toolbar {
  overflow: unset;
}

.#{$prefix}--data-table th {
  position: relative;
}

.#{$prefix}--expandable-row .#{$prefix}--table-expand {
  z-index: 2;
}

.#{$prefix}--expandable-row .#{$prefix}--checkbox-table-cell {
  z-index: 1;
}

tr.#{$prefix}--parent-row.#{$prefix}--data-table--selected td,
tr.#{$prefix}--parent-row.#{$prefix}--data-table--selected:not(.#{$prefix}--expandable-row):hover
  td,
tr.#{$prefix}--parent-row.#{$prefix}--data-table--selected.#{$prefix}--expandable-row td,
tr.#{$prefix}--parent-row.#{$prefix}--data-table--selected.#{$prefix}--expandable-row
  td:first-of-type {
  border-bottom-color: $active-ui;
  box-shadow: none;
}
