/* Custom styles for the enhanced date picker */

.date-picker-container {
  position: relative;
  width: 100%;
}

.date-picker-input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius);
  font-size: var(--font-size-base);
  transition: border var(--transition-speed), box-shadow var(--transition-speed);
  background-color: var(--input-background);
  font-family: var(--font-family-body);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  height: 2.7rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 35px;
}

.date-picker-input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* Flatpickr customizations */
.flatpickr-calendar {
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-family: var(--font-family-body);
}

.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-color);
  border-color: var(--primary-color);
}

.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-color);
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;
  background-position: right 10px center;
  padding: 0 30px 0 10px;
  border-radius: var(--border-radius);
  font-size: var(--font-size-base);
}

/* Custom year selector */
.year-selector {
  position: absolute;
  right: 10px;
  top: 12px;
}

.year-dropdown {
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  border: none;
  color: inherit;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  padding: 0 15px 0 5px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 12px;
}

/* Mobile optimizations */
@media (max-width: 480px) {
  .flatpickr-calendar {
    width: 100%;
    max-width: 300px;
  }
  
  .flatpickr-days {
    width: 100%;
  }
  
  .dayContainer {
    width: 100%;
    min-width: auto;
    max-width: none;
  }
  
  .flatpickr-day {
    max-width: none;
    line-height: 40px;
    height: 40px;
  }
}
