/*
 * Copyright 2020 IBM Corporation
 *
 * 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 '~carbon-components/scss/components/structured-list/_structured-list.scss';

[kui-theme-style] {
  .sidecar-visible {
    .bx--structured-list.kui--radio-table {
      width: 100%;

      .bx--structured-list-td,
      .bx--structured-list-th {
        &[data-is-name] {
          width: 100%;
          max-width: 0;
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
        }

        &.hide-with-sidecar {
          display: none;
        }
      }
    }
  }
}

[kui-theme-style] .bx--structured-list.kui--table-like {
  font-family: var(--font-sans-serif);
  color: var(--color-text-01);

  &.kui--radio-table {
    margin-bottom: 0;
    width: auto;
  }

  .bx--structured-list-row {
    border-bottom-color: var(--color-base03);
  }

  .bx--structured-list-th,
  .bx--structured-list-td {
    color: inherit;
    font-size: inherit;
  }

  .bx--structured-list-td {
    &.sub-text {
      color: var(--color-text-02);
    }
  }

  .bx--structured-list-row:hover .bx--structured-list-td {
    border-top-color: var(--color-base05);
  }

  &.kui--radio-table .bx--structured-list-td {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;

    /* only for RadioTable? */
    white-space: normal;
    word-break: break-all;
  }

  &.bx--structured-list--selection
    .bx--structured-list-row:hover:not(.bx--structured-list-row--header-row):not(.bx--structured-list-row--selected) {
    background-color: var(--color-ui-03);
    border-color: var(--color-table-border1);

    &,
    .bx--structured-list-td:not(.sub-text) {
      color: var(--color-text-01);
    }
  }

  .bx--structured-list-input:checked + .bx--structured-list-td .bx--structured-list-svg {
    fill: currentColor;
  }
}
