@use "../../../ui/styles/_variables" as *;
@use "uswds-core" as *;

.errorText {
  color: color("error");
  font-size: 0.875rem;
  margin-top: 0.25rem;
  position: relative;
  width: 100%;
}

.bgErrorLighter {
  background-color: color("error-lighter");
}

.borderError {
  border: 2px solid color("error-dark");
}

.textInputContainer {
  position: relative;
  display: inline-block;

  :hover {
    cursor: pointer;
  }

  input {
    border-radius: 0.25rem;
    border: 1px solid $border-dark;
  }
}

.calendarIcon {
  position: absolute;
  left: 0.625rem;
  top: 55%;
  transform: translateY(-50%);
  pointer-events: none;
  align-items: center;
  justify-content: center;
  color: $accent-primary;
}

.dateRangeInput {
  padding-left: 2.5rem;
}

.dateRangeInput::placeholder {
  color: black;
}

.datePickerContainer {
  position: relative;
  display: inline-block;
}

.customDateRangeWrapper :global(.usa-form-group) {
  margin-top: 0.25rem;
}

.customDateRangeWrapper :global(.usa-date-range-picker__range-start) {
  padding-bottom: 1rem;
}

.datePickerModal {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  background: white;
  border: 1px solid $border;
  border-radius: 0.25rem;
  box-shadow: 0 4px 6px $drop-shadow;
  padding: 0.5rem;
  width: max-content; // without this, the calendar looks somewhat squished
  margin-top: 0.5rem;
}

.clearButtonContainer {
  display: flex;
  justify-content: flex-start;
  margin-top: 0.5rem;
}

.clearButton {
  background: none;
  border: none;
  color: $accent-primary;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0;
}

.filterPopover {
  position: absolute;
  top: 100%;
  z-index: 10;
  background: white;
  border: 1px solid $border;
  border-radius: 0.25rem;
  box-shadow: 0 4px 6px $drop-shadow;
  padding: 0.5rem;
  margin-top: 0.5rem;
  width: 15rem;
}

.popoverLeft {
  right: 0;
}

.popoverRight {
  left: 0;
}

.applyButton {
  width: 100%;
  margin-top: 0.75rem;
}

.radioGroup {
  border: none;
  margin: 0;
  padding: 0;
}

.legend {
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.datePicker {
  width: 10rem;
}

.datePicker__narrow {
  width: 7.5rem;
}

.datePicker__wide {
  width: 12.5rem;
}
