$accent__color: #746bfd;

$text__base__color: #484c55;
$text__light__color: #acb2c1;
$text__invalid__color: #e8ebf4;
$text__disabled__color: red;

$line__border__color: #dcdcdc;

$button__bg__color: #d6dae5;
$button__txt__color: #9da6b8;
$button__bg__hover__color: #746bfd;
$button__txt__hover__color: #fff;

$breakpoint__s: 320px;
$breakpoint__m: 480px;
$breakpoint__l: 768px;

@mixin mq_s {
  @media (min-width: $breakpoint__s) {
    @content;
  }
}

@mixin mq_m {
  @media (min-width: $breakpoint__m) {
    @content;
  }
}

@mixin mq_l {
  @media (min-width: $breakpoint__l) {
    @content;
  }
}


.datepicker {
  box-sizing: border-box;
  overflow: hidden;
  position: absolute;
  width: 260px;
  z-index: 1;

  @include mq_s {
    width: 300px;
  }

  @include mq_m {
    width: 460px;
  }

  @include mq_l {
    width: 560px;
  }

  table th {
    padding: 0;
  }
}

.datepicker__inner {
  overflow: hidden;
}

.datepicker__months {
  @include mq_m {
    overflow: hidden;
  }
}

.datepicker__month {
  border-collapse: collapse;
  text-align: center;
  width: 100%;

  @include mq_m {
    width: 200px;
  }

  @include mq_l {
    width: 240px;
  }
}

.datepicker__month--month1 {
  @include mq_m {
    float: left;
  }
}

.datepicker__month--month2 {
  display: none;

  @include mq_m {
    display: table;
    float: right;
  }
}

.datepicker__month-day--valid {
  cursor: pointer;
}

.datepicker__month-day--lastMonth,
.datepicker__month-day--nextMonth {
  visibility: hidden;
}

.datepicker__month-button {
  cursor: pointer;
}

.datepicker__month-button--disabled {
  @include mq_m {
    visibility: hidden;
  }
}

.datepicker__info--feedback {
  display: none;
}

.datepicker__info--error,
.datepicker__info--help {
  display: block;
}

.datepicker__close-button {
  cursor: pointer;
}

.datepicker__tooltip {
  position: absolute;
}

/* =============================================================
 * THEME
 * ============================================================*/

.datepicker {
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 8px 8px 40px 5px rgba(0,0,0,.08);
  color: $text__base__color;
  font-family: 'Helvetica', 'Helvetica Neue', 'Arial', sans-serif;
  font-size: 14px;
  line-height: 14px;
}

.datepicker__inner {
  padding: 20px;
}

.datepicker__month {
  font-size: 12px;
}

.datepicker__months {
  @include mq_m {
    position: relative;

    &:before {
      background: $line__border__color;
      bottom: 0;
      content: '';
      display: block;
      left: 50%;
      position: absolute;
      top: 0;
      width: 1px;
    }
  }
}

.datepicker__month-caption {
  border-bottom: 1px solid $line__border__color;
  height: 2.5em;
  vertical-align: middle;
}

.datepicker__month-name {
  text-transform: uppercase;
}

.datepicker__week-days {
  height: 2em;
  vertical-align: middle;
}

.datepicker__week-name {
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
}

.datepicker__month-day {
  //@include transition;
  color: $text__light__color;
  padding: 9px 7px;
}

.datepicker__month-day--no-check-in {
  position: relative;

  &:after {
    background-color: rgba(red, .1);
    bottom: 0;
    content: '';
    display: block;
    left: 0;
    position: absolute;
    right: 50%;
    top: 0;
    z-index: -1;
  }
}

.datepicker__month-day--no-check-out {
  position: relative;

  &:after {
    background-color: rgba(red, .1);
    bottom: 0;
    content: '';
    display: block;
    left: 50%;
    position: absolute;
    right: 0;
    top: 0;
    z-index: -1;
  }
}

.datepicker__month-day--invalid {
  color: $text__invalid__color;
}

.datepicker__month-day--disabled {
  color: $text__invalid__color;
  position: relative;

  &:after {
    content: '\00d7';
    left: 50%;
    position: absolute;
    color: red;
    font-size: 16px;
    top: 50%;
    transform: translate(-50%,-50%);
  }
}

.datepicker__month-day--day-of-week-disabled {
  background-color: rgba($text__invalid__color, .5);
}

.datepicker__month-day--checkout-enabled {}

.datepicker__month-day--selected {
  background-color: rgba($accent__color,.2);
  color: #fff;

  &:after {
    display: none;
  }
}

.datepicker__month-day--hovering {
  background-color: rgba($accent__color,.3);
  color: #fff;
}

.datepicker__month-day--today {
  background-color: $text__base__color;
  color: #fff;
}

.datepicker__month-day--first-day-selected,
.datepicker__month-day--last-day-selected {
  background-color: $accent__color;
  color: #fff;
}

.datepicker__month-day--last-day-selected:after {
  content: none;
}

.datepicker__month-button {
  //@include transition;
  background-color: $button__bg__color;
  border-radius: 4px;
  color: $button__txt__color;
  display: inline-block;
  padding: 5px 10px;

  &:hover {
    background-color: $button__bg__hover__color;
    color: $button__txt__hover__color;
  }
}

.datepicker__topbar {
  margin-bottom: 20px;
  position: relative;
}

.datepicker__info-text {
  font-size: 13px;
}

.datepicker__info--selected {
  font-size: 11px;
  text-transform: uppercase;
}

.datepicker__info--selected-label {
  color: $text__light__color;
}

.datepicker__info-text--selected-days {
  font-size: 11px;
  font-style: normal;
}

.datepicker__info--error {
  color: red;
  font-size: 13px;
  font-style: italic;
}

.datepicker__info--help {
  color: $text__light__color;
  font-style: italic;
}

.datepicker__close-button {
  //@include transition;
  background-color: $button__bg__hover__color;
  border-radius: 4px;
  border: none;
  box-shadow: none;
  font-size: 10px;
  color: $button__txt__hover__color;
  margin-top: 20px;
  padding: 7px 13px;
  text-decoration: none;
  text-shadow: none;
  text-transform: uppercase;

  &:hover {
    background-color: $text__base__color;
    color: #fff;
  }

  @include mq_l {
    margin-top: 0;
    position: absolute;
    right: 0;
    top: 0;
  }
}

.datepicker__tooltip {
  background-color: #ffe684;
  border-radius: 2px;
  font-size: 11px;
  margin-top: -5px;
  padding: 5px 10px;

  &:after {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #ffe684;
    bottom: -4px;
    content: '';
    left: 50%;
    margin-left: -4px;
    position: absolute;
  }
}
