// Flatpickr overrides to use css custom properties and enable styling it

.flatpickr-calendar {
  background: var(--white) !important;
  box-shadow: none !important;
}

.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1) {
  box-shadow: -2px 0 0 var(--grey-200), 5px 0 0 var(--grey-200) !important;
}

.flatpickr-calendar.hasTime .flatpickr-time {
  border-block-start: 1px solid var(--grey-200) !important;
}

.flatpickr-calendar.arrowTop:before {
  border-block-end-color: var(--grey-200) !important;
}

.flatpickr-calendar.arrowTop:after {
  border-block-end-color: var(--white) !important;
}

.flatpickr-calendar.arrowBottom:before {
  border-block-start-color: var(--grey-200) !important;
}

.flatpickr-calendar.arrowBottom:after {
  border-block-start-color: var(--white) !important;
}

.flatpickr-months .flatpickr-month,
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  color: var(--text) !important;
  fill: var(--grey-900) !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  color: var(--grey-400) !important;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
  fill: var(--primary) !important;
}

.numInputWrapper span {
  border: 1px solid var(--grey-200) !important;
}

.numInputWrapper span:hover {
  background: var(--grey-800) !important;
}

.numInputWrapper span:active {
  background: var(--grey-800) !important;
}

.numInputWrapper span.arrowUp:after {
  border-inline-end: 4px solid var(--grey-200) !important;
}

.numInputWrapper span.arrowDown:after {
  border-block-start: 4px solid var(--grey-200) !important;
  inset-block-start: 40% !important;
}

.numInputWrapper span svg path {
  fill: var(--grey-800) !important;
}

.numInputWrapper:hover {
  background: var(--grey-100) !important;
}

.flatpickr-current-month span.cur-month:hover {
  background: var(--grey-100) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowUp:after {
  border-block-end-color: var(--grey-900) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowDown:after {
  border-block-start-color: var(--grey-900) !important;
}

.flatpickr-current-month input.cur-year[disabled],
.flatpickr-current-month input.cur-year[disabled]:hover {
  color: var(--grey-800) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
  background: var(--grey-100) !important;
}

span.flatpickr-weekday {
  color: var(--grey-600) !important;
}

.dayContainer + .dayContainer {
  box-shadow: -1px 0 0 var(--grey-200) !important;
}

.flatpickr-day {
  color: var(--grey-500) !important;
}

.flatpickr-day.inRange,
.flatpickr-day.prevMonthDay.inRange,
.flatpickr-day.nextMonthDay.inRange,
.flatpickr-day.today.inRange,
.flatpickr-day.prevMonthDay.today.inRange,
.flatpickr-day.nextMonthDay.today.inRange,
.flatpickr-day:hover,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover,
.flatpickr-day:focus,
.flatpickr-day.prevMonthDay:focus,
.flatpickr-day.nextMonthDay:focus {
  background: var(--grey-200) !important;
  border-color: var(--grey-200) !important;
}

.flatpickr-day.today {
  border-color: var(--grey-400) !important;
}

.flatpickr-day.today:hover,
.flatpickr-day.today:focus {
  border-color: var(--grey-400) !important;
  background: var(--grey-400) !important;
  color: var(--white) !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay {
  background: var(--primary) !important;
  color: var(--white) !important;
  border-color: var(--primary) !important;
}

.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)),
.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)),
.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) {
  box-shadow: -10px 0 0 var(--primary) !important;
}

.flatpickr-day.inRange {
  box-shadow: -5px 0 0 var(--grey-200), 5px 0 0 var(--grey-200) !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay,
.flatpickr-day.notAllowed,
.flatpickr-day.notAllowed.prevMonthDay,
.flatpickr-day.notAllowed.nextMonthDay {
  color: var(--grey-300) !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
  color: var(--grey-800) !important;
}

.flatpickr-day.week.selected {
  box-shadow: -5px 0 0 var(--primary), 5px 0 0 var(--primary) !important;
}

.flatpickr-weekwrapper .flatpickr-weeks {
  box-shadow: 1px 0 0 var(--grey-200) !important;
}

.flatpickr-weekwrapper span.flatpickr-day,
.flatpickr-weekwrapper span.flatpickr-day:hover {
  color: var(--grey-300) !important;
}

.flatpickr-time .numInputWrapper span.arrowUp:after {
  border-block-end-color: var(--grey-500) !important;
}

.flatpickr-time .numInputWrapper span.arrowDown:after {
  border-block-start-color: var(--grey-500) !important;
}

.flatpickr-time input {
  color: var(--grey-500) !important;
}

.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm {
  color: var(--grey-500) !important;
}

.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:focus {
  background: var(--grey-100) !important;
}
