@import '~styles/config';

.datePickers {
  display: flex;
  @media (max-width: $max-tablet) {
    flex-direction: column;
    margin-bottom: $gutter*0.5;
    height: 120px !important;
  }

  &__icon {
    display: flex;
    align-items: center;
    padding-right: 20px;

    @include colorify('fill');

    &SVG {
      width: 22px;
    }
  }

  &__date {
    @include colorify('fill');

    display: flex;
    align-items: center;
    position: relative;

    padding-right: 30px;
    padding-left: 20px;

    cursor: pointer;

    font-family: $font-heading;
    font-size: 17px;
    line-height: 20px;
    font-weight: 500;

    transition: background-color 300ms ease-in-out;

    @media (max-width: $max-tablet) {
      width: 100%;
      height: 60px;
    }

    &:hover,
    &:focus {
      background-color: $color-grey100;

      input { // stylelint-disable
        background-color: $color-grey100;
      }
    }

    input {
      @include reset-input;

      width: 100%;

      transition: background-color 300ms ease-in-out;
    }
  }

  &__label {
    margin-right: 10px;
    font-weight: 600;
  }

  &__datepicker {
    flex-grow: 1;

    input {
      background: $color-white;
    }
  }

  &__arrow {
    position: absolute;
    right: 10px;

    &.isOpen {
      transform: rotate(180deg);
    }
  }

  &__years {
    display: flex;
    align-items: center;
    order: -1;

    padding-left: 50px;

    @media (min-width: $min-tablet) {
      order: 0;
      padding: 0 10px 0 0;
    }

    @media (min-width: $min-desktop) {
      padding: 0 20px;
    }
  }

  &__year {
    @include reset-button;

    position: relative;

    padding: 10px 15px;

    font-family: $font-heading;
    font-size: 17px;
    line-height: 20px;
    font-weight: 500;
    color: $color-dark;

    cursor: pointer;

    transition: color 200ms ease-in-out;

    &:not(:first-child)::after {
      content: '';
      position: absolute;
      left: 0;
      height: 20px;
      width: 0px;

      border-left: 2px solid;

      @media (min-width: $min-tablet) {
        height: 40px;
        top: 0;
      }
    }

    @include colorifyPseudo('border-left-color');

    &:hover,
    &:focus {
      @include colorify('color');
    }

    &:first-child {
      border-left: 0;
    }
  }

  // react-datepicker custom styles
  [class$='react-datepicker-popper'] {
    z-index: 90;
    background-color: #fff;
    box-shadow: 0 3px 65px 0 rgba(32, 32, 32, 0.125);

    [class='react-datepicker'] {
      border: none;
      border-radius: 0;
    }

    [class*='__header'] {
      background: $color-ocean;
      border-radius: 0;
      border: none;
      padding-top: 15px;
    }

    [class*='__triangle'] {
      display: none;
    }

    [class*='navigation--previous'], [class*='navigation--next'] {
      top: 19px;
    }

    [class*='navigation--previous'] {
      border-right-color: $color-white;
    }

    [class*='navigation--next'] {
      border-left-color: $color-white;
    }

    [class*='__current-month'] {
      color: $color-white;
      text-transform: capitalize;
    }

    [class*='outside-month'] {
      color: $color-grey400;
    }

    [class*='day-names'] {
      background: $color-white;
      font-weight: 500;
    }

    [class*='__day--'] {
      border-radius: 50%;
    }

    [class*='day--selected'] {
      background-color: $color-ocean;
    }
  }
}
