/**
 * Copyright Aquera Inc 2023
 *
 * This source code is licensed under the BSD-3-Clause license found in the
 * LICENSE file in the root directory of this source tree.
 */

import { css } from 'lit';
import { resizableTableStyles } from '../internal/resizable-table-styles';

/**
 * TableBody CSS
 */
export const styles = css`
  :host {
    box-sizing: border-box;
    --nile-table-background--odd: var(--nile-colors-base-white , var(--ng-colors-bg-primary));
    --nile-table-background--even: var(--nile-colors-base-white , var(--ng-colors-bg-primary));
    -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
    -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));
    text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));
  }

  .base {
    background-color: var(--nile-colors-white-base , var(--ng-colors-bg-primary));
    border: 1px solid var(--nile-table-row-border-color , var(--ng-colors-border-secondary));
    border-radius: var(--nile-radius-md , var(--ng-radius-xl));
    overflow: hidden;
    box-shadow: var(--nile-box-shadow-3 , var(--ng-shadow-xs));
  }

  .table__header {
    display: flex;
    box-sizing: border-box;
  }

  .nile__table__body {
    display: table;
    border-collapse: collapse;
    width: 100%;
  }

  slot::slotted(nile-table-row:nth-child(odd)) {
    border-bottom: 1px solid var(--nile-colors-neutral-400 , var(--ng-colors-border-secondary));
    background: var(--nile-table-background--odd);
  }

  slot::slotted(nile-table-row:nth-child(even)) {
    background: var(--nile-table-background--even);
  }

  slot::slotted(nile-table-row:last-child) {
    border-bottom: 0px;
  }

  ${resizableTableStyles}
`;

export default [styles];
