.kuiDatePicker {
  background-color: transparent;
  border-collapse: collapse;
  border-spacing: 0;
  line-height: $globalLineHeight;
}

.kuiDatePickerNavigationCell {
  padding: 0;
}

.kuiDatePickerNavigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: $localDatePickerBottomSpacing;
}

/**
 * 1. Override inherited styles.
 */
.kuiDatePickerNavigationButton {
  appearance: none;
  background-color: transparent;
  border: none;
  font-size: $globalSubTextFontSize;
  color: $localNavButtonTextColor;
  padding: $localDatePickerButtonPadding;
  border-radius: $globalBorderRadius;

  &:hover,
  &:active {
    cursor: pointer;
    color: $localNavButtonTextColor-isHover;
    background-color: $localDatePickerButtonHoverBackgroundColor;
  }

  &:focus {
    @include focus($globalFocusColor, $localDropdownBackgroundColor);

    color: $localNavButtonTextColor; /* 1 */
  }

  @include darkTheme {
    color: $localNavButtonTextColor--darkTheme;

    &:hover,
    &:active {
      color: $localNavButtonTextColor-isHover--darkTheme;
      background-color: $localDatePickerButtonHoverBackgroundColor--darkTheme;
    }

    &:focus {
      @include focus($globalFocusColor, $localDropdownBackgroundColor--darkTheme);

      color: $localNavButtonTextColor--darkTheme; /* 1 */
    }
  }
}

.kuiDatePickerHeaderCell {
  padding: $localDatePickerHeaderCellPadding;
  color: $localNavTextColor;
  font-size: $globalSubTextFontSize;
  font-weight: bold;
  text-align: center;
  line-height: 1.2;

  @include darkTheme {
    color: $globalTextColor--darkTheme;
  }
}

.kuiDatePickerRowCell {
  padding: 0;
  text-align: center;

  /**
   * This state class exists to support weird angular-bootstrap datepicker functionality,
   * in which you can't select a day on the "From" calendar if it falls after the selected day in
   * the "To" calendar (and vice versa, you can't select a "To" day if it is before the "From" day).
   */
  &.kuiDatePickerRowCell-isBlocked {
    cursor: not-allowed;

    .kuiDatePickerRowCellContent {
      pointer-events: none;
    }
  }
}

/**
 * 1. Override inherited styles.
 */
.kuiDatePickerRowCellContent {
  appearance: none;
  background-color: transparent;
  width: 100%;
  border: 1px solid transparent;
  color: $localNavTextColor;
  font-size: $globalSubTextFontSize;
  padding: $localDatePickerCellPadding;
  border-radius: $globalBorderRadius;
  line-height: $localDatePickerCellLineHeight;

  &:focus {
    @include focus($globalFocusColor, $localDropdownBackgroundColor);

    color: $localNavTextColor; /* 1 */
  }

  &:disabled {
    pointer-events: none;
    opacity: 0.5;
  }

  &.kuiDatePickerRowCellContent-isOtherMonth {
    visibility: hidden;
    pointer-events: none;
  }

  &.kuiDatePickerRowCellContent-isCurrent {
    color: $globalLinkColor;
  }

  &.kuiDatePickerRowCellContent-isSelected {
    background-color: $localDatePickerCellSelectedBackgroundColor;
    color: $localDatePickerCellSelectedTextColor;
  }

  &:hover,
  &:active {
    cursor: pointer;
    color: $localNavButtonTextColor-isHover;
    background-color: $localDatePickerButtonHoverBackgroundColor;
  }

  @include darkTheme {
    color: $globalTextColor--darkTheme;

    &:focus {
      @include focus($globalFocusColor, $localDropdownBackgroundColor--darkTheme);
    }

    &.kuiDatePickerRowCellContent-isCurrent {
      color: $globalLinkColor--darkTheme;
    }

    &.kuiDatePickerRowCellContent-isSelected {
      color: $localDatePickerCellSelectedTextColor--darkTheme;
    }

    &:hover,
    &:active {
      color: $localNavButtonTextColor-isHover--darkTheme;
      background-color: $localDatePickerButtonHoverBackgroundColor--darkTheme;
    }
  }
}
