/**
 * @license
 * Copyright Endlessjs. All Rights Reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 */

@mixin el-calendar-theme() {

  el-base-calendar {
    el-card {
      overflow: hidden;
    }

    &.medium el-card {
      width: el-theme(calendar-width);

      el-card-body {
        height: el-theme(calendar-body-height);
      }
    }

    &.large el-card {
      width: el-theme(calendar-large-width);

      el-card-body {
        height: el-theme(calendar-large-body-height);
      }
    }

    &.has-week-number.medium el-card {
      width: calc(#{el-theme(calendar-width)} + #{el-theme(calendar-day-cell-width)} + 1px);
    }

    &.has-week-number.large el-card {
      width: calc(#{el-theme(calendar-large-width)} + #{el-theme(calendar-day-cell-width)} + 1px);
    }

    el-card {
      border: none;
      margin: 0;
    }

    el-card-body {
      padding: 0;

      & > el-calendar-pageable-navigation, & > el-calendar-navigation {
        padding: 1rem 0;
      }
    }
  }

  el-calendar-day-picker .range-cell {
    flex: 1;
    margin: 1px 0;

    .day-cell {
      margin: 0;
    }

    &.in-range {
      background: el-theme(calendar-cell-in-range-background-color);

      &:not(.today, :hover) {
        border-radius: 0;
      }
    }

    &.start, &.end {
      @extend .selected;
      background: el-theme(calendar-cell-in-range-background-color);
    }

    &.start {
      border-top-left-radius: el-theme(calendar-border-radius);
      border-bottom-left-radius: el-theme(calendar-border-radius);

      .day-cell {
        margin-left: 0;
      }
    }

    &.end {
      border-top-right-radius: el-theme(calendar-border-radius);
      border-bottom-right-radius: el-theme(calendar-border-radius);

      .day-cell {
        margin-right: 0;
      }
    }

    &:first-of-type {
      border-top-left-radius: el-theme(calendar-border-radius);
      border-bottom-left-radius: el-theme(calendar-border-radius);
    }

    &:last-of-type {
      border-top-right-radius: el-theme(calendar-border-radius);
      border-bottom-right-radius: el-theme(calendar-border-radius);
    }
  }
}
