

@use 'sass:map';

@use './common/var' as *;
@use './mixins/mixins' as *;
@use './mixins/var' as *;
@include b(calendar) {
  @include set-component-css-var('calendar', $calendar);
  
}
@include b(calendar) {
  background-color:var(--sg-calendar-background);

  @include e(header) {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: var(--sg-calendar-header-border);
  } 

  @include e(title) {
    color:var(--sg-calendar-title-color);
    align-self: center;
  }
  @include e(button-group) {
    .sg-button:first-child {
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }
    .sg-button:nth-child(2) {
      border-radius: 0;
      margin-left: 0;
      margin-left: -1px;
    }
    .sg-button:nth-child(3) {
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
      margin-left: -1px;
    }
  }

  @include e(body) {
    padding: 12px 20px 35px;
  }
}

@include b(calendar-table) {
  table-layout: fixed;
  width: 100%;

  thead th {
    padding: 12px 0;
    color: var(--sg-calendar-cell-color);
    font-weight: normal;
    text-align: left;
  }

  &:not(.is-range) {
    td.prev,
    td.next {
      color:var(--sg-calendar-cell-placeholder-color);
    }
  }

  td {
    border-bottom: var(--sg-calendar-border);
    border-right: var(--sg-calendar-border);
    transition: background-color 0.2s ease;
    box-sizing: border-box;

    @include when(selected) {
      color:  var(--sg-calendar-selected-color);
      background-color: var(--sg-calendar-selected-background-color);
    }

    @include when(today) {
      color: var(--sg-calendar-selected-color);
      border-top: 2px solid var(--sg-calendar-selected-color);;
    }
  }

  tr:first-child td {
    border-top: var(--sg-calendar-border);
  }

  tr td:first-child {
    border-left: var(--sg-calendar-border);
  }

  tr.sg-calendar-table__row--hide-border td {
    border-top: none;
  }

  @include b(calendar-day) {
    box-sizing: border-box;
    padding: 8px;
    height: var(--sg-calendar-cell-width);
    &:hover {
      cursor: pointer;
      background-color: var(--sg-calendar-selected-background-color);
    }
  }
}
