/**
 * @file
 * WHO Track Datepicker styles.
 */

/* Style the datepicker fields */
#edit-field-date-value-min,
#edit-field-date-value-max {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>');
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 30px;
}

/* CSS approach to change the labels */
/* Hide the original Min label and replace with From */
label[for="edit-field-date-value-min"],
.form-item-field-date-value-min label {
  font-size: 0 !important;
}

label[for="edit-field-date-value-min"]::before,
.form-item-field-date-value-min label::before {
  content: 'From';
  font-size: 14px;
}

/* Hide the original Max label and replace with To */
label[for="edit-field-date-value-max"],
.form-item-field-date-value-max label {
  font-size: 0 !important;
}

label[for="edit-field-date-value-max"]::before,
.form-item-field-date-value-max label::before {
  content: 'To';
  font-size: 14px;
}

/* Additional selectors for BEF datepicker labels */
.bef-exposed-form .form-item-field-date-value-min label,
.bef-exposed-form .form-item-field-date-value-max label {
  font-size: 0 !important;
}

.bef-exposed-form .form-item-field-date-value-min label::before {
  content: 'From';
  font-size: 14px;
}

.bef-exposed-form .form-item-field-date-value-max label::before {
  content: 'To';
  font-size: 14px;
}

/* Style the jQuery UI Datepicker */
.ui-datepicker {
  padding: 0.2em 0.2em 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ui-datepicker .ui-datepicker-header {
  padding: 0.2em 0;
  background-color: #f8f9fa;
  border-bottom: 1px solid #ddd;
}

.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
  top: 5px;
}

.ui-datepicker table {
  margin: 0.2em 0 0;
  font-size: 0.9em;
}

.ui-datepicker th {
  padding: 0.7em 0.3em;
  text-align: center;
  font-weight: bold;
  border: 0;
}

.ui-datepicker td {
  border: 0;
  padding: 1px;
}

.ui-datepicker td span,
.ui-datepicker td a {
  display: block;
  padding: 0.2em;
  text-align: center;
  text-decoration: none;
}

.ui-datepicker .ui-datepicker-buttonpane {
  background-image: none;
  margin: 0.7em 0 0 0;
  padding: 0 0.2em;
  border-top: 1px solid #ddd;
}
