/* Date Picker - uses color variables from style.css */

/* Date Picker Input Styling */
.datepicker-input {
  cursor: pointer !important;
  user-select: none;
  width: 100%;
  padding: .8rem 1.2rem;
  border: .1rem solid var(--color-border);
  border-radius: .4rem;
  background: var(--color-bg);
  color: inherit;
  font-size: inherit;
  font-family: var(--font-stack);
  transition: all 0.2s;
}

.datepicker-input:hover {
  border-color: var(--color-text-muted);
  background: var(--color-hover);
}

.datepicker-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 .3rem light-dark(rgba(68, 185, 185, 0.1), rgba(214, 122, 36, 0.1));
}

/* Date Picker Popup */
.datepicker-popup {
  background: var(--color-bg);
  border: .1rem solid var(--color-border);
  border-radius: .8rem;
  box-shadow: 0 .4rem 2rem rgba(0, 0, 0, 0.15);
  padding: 1.6rem;
  z-index: 1000;
  min-width: 28rem;
  font-size: 1.4rem;
}

/* Date Picker Header */
.datepicker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.datepicker-month {
  font-weight: var(--font-weight-bold);
  font-size: 1.6rem;
}

.datepicker-prev,
.datepicker-next {
  background: var(--color-hover);
  border: none;
  border-radius: .4rem;
  width: 3.2rem;
  height: 3.2rem;
  cursor: pointer;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  color: inherit;
  font-family: var(--font-stack);
  line-height: 1;
}

.datepicker-prev:hover,
.datepicker-next:hover {
  background: var(--color-border);
}

.datepicker-prev:active,
.datepicker-next:active {
  transform: scale(0.95);
}

/* Weekday Headers */
.datepicker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .4rem;
  margin-bottom: .8rem;
  font-weight: var(--font-weight-bold);
  font-size: 1.2rem;
  text-align: center;
  color: var(--color-text-muted);
}

.datepicker-weekdays > div {
  padding: .4rem;
}

/* Calendar Days Grid */
.datepicker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .4rem;
}

.datepicker-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: .4rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.4rem;
  min-height: 3.6rem;
}

.datepicker-day:not(.empty):hover {
  background: var(--color-hover);
  transform: scale(1.05);
}

.datepicker-day.empty {
  cursor: default;
  pointer-events: none;
}

.datepicker-day.today {
  background: var(--color-primary);
  color: light-dark(#fff, #000);
  font-weight: var(--font-weight-bold);
}

.datepicker-day.today:hover {
  background: var(--color-primary);
  opacity: 0.9;
}

.datepicker-day:not(.empty):not(.today):active {
  background: var(--color-border);
  transform: scale(0.95);
}

/* Selected day highlight */
.datepicker-day.selected {
  background: light-dark(#dbeafe, #1e3a5f);
  font-weight: var(--font-weight-bold);
}

.datepicker-day.selected:hover {
  background: light-dark(#bfdbfe, #2a4a7f);
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .datepicker-popup {
    min-width: 26rem;
    padding: 1.2rem;
  }
  
  .datepicker-day {
    font-size: 1.3rem;
    min-height: 3.2rem;
  }
  
  .datepicker-prev,
  .datepicker-next {
    width: 2.8rem;
    height: 2.8rem;
    font-size: 1.8rem;
  }
}
