//
// Copyright IBM Corp. 2019, 2021
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

//
// Selection check box
//

:host(#{$prefix}-table-header-row) .#{$prefix}--table-column-checkbox {
  position: relative;
  background-color: $ui-03;
  width: rem(44px); // 16px padding left + 8px padding right + 20px checkbox width
  transition: background-color $duration--fast-01 motion(entrance, productive);
}

:host(#{$prefix}-table-row) .#{$prefix}--table-column-checkbox {
  .#{$prefix}--checkbox-label {
    padding-left: $spacing-05;
  }
}

:host(#{$prefix}-table-header-row) .#{$prefix}--table-column-checkbox:hover {
  // Highlight "select all" columns like sorting column
  background-color: $data-table-column-hover;
}

:host(#{$prefix}-table-row[size='tall']) .#{$prefix}--table-column-checkbox {
  padding-top: rem(12px);
}

//
// Selected rows
//

:host(#{$prefix}-table-row[selected]) {
  ::slotted(#{$prefix}-table-cell),
  .#{$prefix}--table-column-checkbox {
    color: $text-01;
    background-color: $ui-03;
    border-top: 1px solid $ui-03;
    border-bottom: 1px solid $active-ui; //bottom border acts as separator from other rows
  }
}

:host(#{$prefix}-table-row[selected]:hover) {
  ::slotted(#{$prefix}-table-cell),
  .#{$prefix}--table-column-checkbox {
    background-color: $data-table-column-hover;
    border-top-color: $data-table-column-hover;
    border-bottom-color: $data-table-column-hover;
  }
}
