/* CF7 Date & Time Addon Styles */

.cf7-datetime-date,
.cf7-datetime-time,
.cf7-datetime-datetime {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  background-color: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.cf7-datetime-date:hover,
.cf7-datetime-time:hover,
.cf7-datetime-datetime:hover {
  border-color: #999;
}

.cf7-datetime-date:focus,
.cf7-datetime-time:focus,
.cf7-datetime-datetime:focus {
  outline: none;
  border-color: #0073aa;
  box-shadow: 0 0 0 1px #0073aa;
}

.wpcf7-not-valid.cf7-datetime-date,
.wpcf7-not-valid.cf7-datetime-time,
.wpcf7-not-valid.cf7-datetime-datetime {
  border-color: #dc3232;
}

/* Flatpickr customization */
.flatpickr-calendar {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue",
    sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid #ddd;
}

/* Updated year dropdown to match Flatpickr's month dropdown styling and ensure inline display */
.flatpickr-current-month {
  display: flex !important;
  align-items: center;
  gap: 4px;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  flex-shrink: 0;
}

.cf7-year-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 3.5px 20px 3.5px 7px;
  border: none;
  border-radius: 0;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23393939' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 9px;
  font-size: inherit;
  font-weight: 300;
  color: rgba(0, 0, 0, 0.9);
  cursor: pointer;
  outline: none;
  margin: 0;
  height: auto;
  line-height: inherit;
  vertical-align: baseline;
  flex-shrink: 0;
  min-width: 70px;
}

.cf7-year-select:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.cf7-year-select:focus {
  background-color: rgba(0, 0, 0, 0.05);
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: #0073aa;
  border-color: #0073aa;
}

.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:focus {
  background: #f0f0f0;
}

/* Responsive styles */
@media (max-width: 768px) {
  .cf7-datetime-date,
  .cf7-datetime-time,
  .cf7-datetime-datetime {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Hidden fields for 24hr format */
.cf7-datetime-time-24hr,
.cf7-datetime-datetime-24hr {
  display: none;
}
