@import "constants/index.scss";
$GRID_WIDTH: 32px;
$GRID_HEIGHT: 28px;

:global {
  .date-picker-tooltip {
    max-width: unset !important;
  }
}

.datePicker {
  position: relative;
  display: inline-flex;
  padding: 12px;
  border-right: 1px solid #eee;
  background-color: #f4f4f4;

  &NavigationIcon {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px !important;
    height: 32px !important;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(#000, 0.08);
    border: 1px solid #ddd;
    cursor: pointer;
    transition: 0.2s ease-out;
    transform: rotate(90deg);
    padding: 6px;
    box-sizing: border-box;

    &:hover {
      transform: translateY(-5%) rotate(90deg);
      box-shadow: 0 2px 9px rgba(#000, 0.08);
    }

    &.right {
      left: auto;
      right: 8px;
      transform: rotate(-90deg);
      &:hover {
        transform: translateY(-5%) rotate(-90deg);
      }
    }
  }
}

.calendar {
  @mixin center {
    display: flex;
    align-items: center;
  }

  @mixin box {
    width: $GRID_WIDTH;
    min-width: $GRID_WIDTH;
    max-width: $GRID_WIDTH;
    height: $GRID_HEIGHT;
    min-height: $GRID_HEIGHT;
    box-sizing: border-box;
  }

  color: #333;
  max-width: $GRID_WIDTH * 7;
  border: 1px solid #eee;
  margin-right: 8px;
  background-color: #fff;

  &:last-of-type {
    margin-right: 0;
  }

  &Header {
    @include center;
    justify-content: center;
    padding: 8px;
    font-size: 14px;
  }

  &Labels {
    @include center;
    padding: 8px;
    border-bottom: 1px solid #eee;
  }

  &Label {
    @include center;
    @include box;
    height: auto;
    min-height: 0;
    font-size: 12px;
    color: #999;
  }

  &Grid {
    &Row {
      @include center;
      &:last-child {
        border-bottom: none;
        .rangePickerCalendarGridItem {
          border-bottom: none;
        }
      }
      &Item {
        @include box;
        @include center;
        justify-content: center;
        padding: 8px;
        border-right: 1px solid #eee;
        border-bottom: 1px solid #eee;
        cursor: pointer;
        &.disabled {
          pointer-events: none;
        }
        &.disabled > * {
          opacity: 0.1;
        }
        &.invisible {
          pointer-events: none;
        }
        &.invisible > * {
          opacity: 0.05;
        }
        &:last-child {
          border-right: none;
        }
        &:hover {
          background-color: #f5f5f5;
        }

        &.selected {
          background-color: rgba($primary-color, 0.3);
          border-color: $primary-color;
          border-bottom: 1px solid $primary-color;
          border-left-style: solid;
          border-right-style: solid;
          border-left-width: 0;
          border-right-width: 0;
        }
      }
      &ItemText {
        font-size: 12px;
      }
    }
  }
}

@keyframes show-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
