/* Calendar Container */
.calendar {
  border: 1px solid var(--primary-color-6);
  border-radius: 8px;
  background-color: var(--primary-color-2);
  box-shadow: 0 2px 10px rgb(0 0 0 / 10%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

/* Calendar Navigation */
.calendar-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.75rem 0.25rem;
}

.calendar-nav-title {
  color: var(--secondary-color-4);
  font-size: 16px;
  font-weight: 600;
}

.calendar-nav-prev,
.calendar-nav-next {
  display: flex;
  width: 1.75rem;
  height: 1.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--primary-color-6);
  border-radius: 0.5rem;
  background-color: var(--light, transparent)
    var(--dark, var(--primary-color-3));
  color: var(--secondary-color-5);
  cursor: pointer;
  font-size: 1rem;
}

.calendar-nav-prev:hover,
.calendar-nav-next:hover {
  border-color: var(--primary-color-7);
  background-color: var(--primary-color-4);
  color: var(--secondary-color-4);
}

.calendar-nav-prev:focus-visible,
.calendar-nav-next:focus-visible {
  box-shadow: 0 0 0 2px var(--focused-border-color);
}

/* Calendar Grid */
.calendar-grid {
  width: 100%;
  padding: 0.5rem;
}

.calendar-grid-header {
  display: flex;
  flex-direction: row;
  margin-bottom: 8px;
}

.calendar-grid-day-header {
  width: 2rem;
  color: var(--secondary-color-5);
  font-size: 12px;
  font-weight: 300;
  text-align: center;
}

.calendar-grid-body {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 0.25rem;
}

.calendar-grid-cell {
  width: 2rem;
  border: none;
  border-radius: 0.5rem;
  aspect-ratio: 1;
  background: none;
  color: var(--secondary-color-4);
  cursor: pointer;
  font-size: 14px;
}

.calendar-grid-cell[data-month="current"]:not([data-disabled="true"]):hover {
  background-color: var(--primary-color-4);
}

.calendar-grid-cell[data-month="current"]:focus-visible {
  outline: 2px solid var(--focused-border-color);
  outline-offset: 2px;
}

.calendar-grid-cell[data-month="last"],
.calendar-grid-cell[data-month="next"],
.calendar-grid-cell[data-disabled="true"] {
  color: var(--secondary-color-5);
  cursor: not-allowed;
}

.calendar-grid-cell[data-month="current"][data-selected="true"] {
  background-color: var(--secondary-color-2);
  color: var(--primary-color);
}

.calendar-grid-cell[data-month="current"][data-selected="true"]:hover {
  background-color: var(--light, var(--secondary-color-2))
    var(--dark, var(--primary-color-5));
  color: var(--light, var(--primary-color))
    var(--dark, var(--secondary-color-1));
  font-weight: var(--light, 550) var(--dark, inherit);
}

.calendar-grid-cell[data-month="current"][data-today="true"]:not(
    [data-selected="true"]
  ) {
  background-color: var(--primary-color-5);
}

.calendar-grid-weeknum {
  border-radius: 0.5rem;
  background-color: var(--primary-color);
  color: var(--secondary-color-5);
  font-size: 12px;
}

/* Calendar with week numbers */
.calendar-grid-week {
  display: flex;
  width: 100%;
  flex-direction: row;
}

/* Calendar states */
.calendar[data-disabled="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.calendar-next-month-icon,
.calendar-previous-month-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.calendar-month-select-container, .calendar-year-select-container {
  position: relative;
}

.calendar-month-select-container:has(:focus-visible), .calendar-year-select-container:has(:focus-visible) {
  outline: 2px solid var(--focused-border-color);
  border-radius: 0.5rem;
}


.calendar-month-select, .calendar-year-select {
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  position: absolute;
  padding: .25rem;
}

.calendar-month-select-value, .calendar-year-select-value {
  border: none;
  background-color: transparent;
  color: var(--secondary-color-4);
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .25rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.select-expand-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--secondary-color-4);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}