@use 'mixins/mixins' as *;
@use 'mixins/var' as *;
@use 'common/var' as *;

@include b(calendar) {
  // @include set-component-css-var('calendar', $calendar);

  @include e(header) {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  @include e(title) {
    color: getCssVar('color-neutral-9');
  }

  // @include e(body) {
  // }

  .#{$namespace}-button-group {
    background-color: getCssVar('color-neutral-2');
  }
}

@include b(calendar-table) {
  display: table;
  table-layout: fixed;
  width: 100%;
  margin: 0;

  thead th {
    padding: 16px 0 12px;
    color: getCssVar('color-neutral-9');
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    border: none;
  }

  &:not(.is-range) {
    td.prev,
    td.next {
      color: getCssVar('color-neutral-6');
    }
  }

  td {
    padding: 0;
    border-bottom: getCssVar('border');
    border-right: getCssVar('border');
    vertical-align: top;
    transition: background-color getCssVar('transition-duration', 'fast') ease;

    @include when(selected) {
      font-weight: 600;
      background-color: getCssVar('color-primary-1');
      color: getCssVar('color-primary-3');
    }

    @include when(today) {
      font-weight: 600;
    }
  }

  tr:first-child td {
    border-top: getCssVar('border');
  }

  tr td:first-child {
    border-left: getCssVar('border');
  }

  tr.#{$namespace}-calendar-table__row--hide-border td {
    border-top: none;
  }

  @include b(calendar-day) {
    box-sizing: border-box;
    padding: 8px;
    height: 80px;

    &:hover {
      cursor: pointer;
      background-color: getCssVar('color-primary-1');
      color: getCssVar('color-primary-3');
    }
  }
}
