// This file changes the existing datepicker styling such that it is conform the style
// of Baserow.

.datepicker-context {
  white-space: normal;
}

.vdp-datepicker.datepicker .vdp-datepicker__calendar {
  border: none;
  width: 312px;
  padding: 16px;
  box-sizing: border-box;

  &.vdp-datepicker__calendar--small {
    width: 280px;
    padding: 0;
  }

  .month,
  .year {
    width: calc(33.333% - 4px);
  }

  @include rounded($rounded-md);

  .cell {
    padding: 0;
    margin: 2px;
  }

  header {
    @include flex-align-items();

    line-height: 25px;
    justify-content: space-around;
  }

  .prev {
    @extend .iconoir-nav-arrow-left;
    @extend %icon;

    &::before {
      position: relative;
    }
  }

  .next {
    @extend .iconoir-nav-arrow-right;
    @extend %icon;
  }

  .prev,
  .next {
    font-size: 0;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;

    &::before {
      font-size: 16px;
      color: $palette-neutral-700;
    }

    &:hover {
      border-radius: 100% !important;

      &::before {
        color: $palette-neutral-900;
      }
    }

    &::after {
      display: none;
    }
  }

  .prev:not(.disabled):hover,
  .next:not(.disabled):hover,
  .up:not(.disabled):hover {
    background-color: $color-neutral-100;

    @include rounded($rounded);
  }

  .cell.day,
  .cell.day-header {
    width: 36px;
    height: 36px;
    line-height: 36px;
  }

  .cell.day-header {
    font-size: 12px;
    font-weight: 500;
  }

  .cell.day.today {
    font-size: 14px;
    font-weight: 600;
  }

  /* stylelint-disable */
  .cell:not(.blank):not(.disabled).day {
    &.selected,
    &:hover {
      border-radius: 100%;
    }
  }

  .cell:not(.blank):not(.disabled).day,
  .cell:not(.blank):not(.disabled).month,
  .cell:not(.blank):not(.disabled).year {
    @include rounded($rounded);

    &:hover {
      border-color: transparent;
      background-color: $color-neutral-100;
    }

    &.selected {
      border-color: transparent;
      background-color: $color-primary-500;
      font-weight: 500;
      color: $white;
    }
  }
  /* stylelint-enable */

  .day-header {
    color: $color-neutral-500;
  }

  .context-datepicker & {
    border: none;
  }

  .month__year_btn,
  .day__month_btn {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
  }
}
