@import "../../../shared/variables";

.date-picker {
  width: 320px;
  position: relative;

  * {
    box-sizing: border-box;
  }

  &__container {
    border: 1px solid transparent;
    border-radius: 2px;
    box-sizing: border-box;
    max-height: 0;
    overflow: hidden;
    transition: all 0.15s ease;
    background: $white;
    border-radius: 0 2px 2px 2px;
    height: auto;
    max-height: 420px;
    z-index: 100;
  }
}

.toggle-buttons {
  padding: 10px 16px;

  &__button {
    background: $white;
    border: 1px solid $lightGray;
    color: $black1;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.2;
    padding: 8px;
    width: 50%;

    &:focus {
      outline: 0;
    }

    &:hover {
      border: 1px solid $lightGray;
      background-color: #eee;
      color: $black1;
    }

    &__selected {
      background-color: $darkGray;
      color: $white;

      &:hover {
        background-color: $darkGray;
        border: 1px solid $lightGray;
        color: $white;
      }
    }
  }
}

.range-inputs {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;

  &__container {
    border-radius: 1px;
    flex: 1;
    align-items: center;
    position: relative;
    height: 32px;
    line-height: 32px;
    border: 1px solid $darkGray;
    width: 0;
    padding: 5px 30px 5px 8px;
    overflow: hidden;
  }

  &__container--active {
    border: 1px solid $xDarkGray;
    background: $lightGray;

    .range-inputs__input {
      background: $lightGray;
      outline: 0;
    }

    .range-inputs__button-clear {
      background: $lightGray;
      border-color: $lightGray;
    }
  }

  &__input {
    border: 0;
    cursor: text;
    display: block;
    font-family: inherit;
    font-size: 14px;
    height: 20px;
    line-height: 1.2;
    padding: 0;
    text-align: left;
    width: 100%;

    &--selected {
      background: $lightGray;
    }
  }

  &__button-clear {
    background: white;
    border: 1px solid white;
    border-radius: 0;
    color: black;
    cursor: pointer;
    height: 30px;
    margin-left: 8px;
    padding: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: 30px;

    &:hover {
      background: $darkGray;
      border: 1px solid $darkGray;
      color: white;
    }

    &:focus {
      outline: 0;
    }

    &::before {
      content: "\00D7";
      display: block;
      font-size: 16px;
      height: 16px;
      line-height: 14px;
    }
  }
}

.calendar {
  &__container {
    padding: 8px;
    font-size: 14px;
  }
  &__day-heading {
    cursor: default;
    display: inline-block;
    padding: 8px 0;
    font-weight: 600;
    text-align: center;
    width: 42px;
    text-decoration: underline dotted;
    color: $darkGray;
  }

  &__days {
    border-top: 1px solid $lightGray;
    border-right: 1px solid $lightGray;
  }

  &__day-wrap {
    display: inline-block;
    border-left: 1px solid $lightGray;
    border-bottom: 1px solid $lightGray;
  }

  &__day {
    cursor: pointer;
    display: inline-block;
    padding: 8px 0;
    text-align: center;
    width: 42px;

    &:hover {
      background-color: #ccc;
    }

    &--not-current {
      color: #999;
    }
  }

  &__day--is-between-range {
    background-color: #eee;
  }

  &__day--start,
  &__day--end {
    background-color: #888;

    &:hover {
      background-color: #888;
    }
  }
}

.arrow {
  cursor: pointer;
  font-size: 14px;
  text-align: center;

  &::before {
    font-family: "fontawesome";
  }
}

.month-navigation {
  align-items: center;
  display: flex;
  padding: 12px 16px;

  &__previous {
    composes: arrow;

    &::before {
      content: "\f053";
    }
  }

  &__next {
    composes: arrow;

    &::before {
      content: "\f054";
    }
  }

  &__current-month-year {
    cursor: default;
    flex-grow: 1;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
  }
}
