/**
 * Input type datetime
 */
:where(:scope),
:host {
  --pico-icon-date: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' 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");
  --pico-icon-time: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
}

input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]):is(
    [type="date"],
    [type="datetime-local"],
    [type="month"],
    [type="time"],
    [type="week"]
  ) {
  --pico-icon-position: 0.75rem;
  --pico-icon-width: 1rem;
  padding-right: calc(var(--pico-icon-width) + var(--pico-icon-position));
  background-image: var(--pico-icon-date);
  background-position: center right var(--pico-icon-position);
  background-size: var(--pico-icon-width) auto;
  background-repeat: no-repeat;
  min-width: 0;
}
input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"])[type="time"] {
  background-image: var(--pico-icon-time);
}

[type="date"]::-webkit-calendar-picker-indicator,
[type="datetime-local"]::-webkit-calendar-picker-indicator,
[type="month"]::-webkit-calendar-picker-indicator,
[type="time"]::-webkit-calendar-picker-indicator,
[type="week"]::-webkit-calendar-picker-indicator {
  width: var(--pico-icon-width);
  margin-right: calc(var(--pico-icon-width) * -1);
  margin-left: var(--pico-icon-position);
  opacity: 0;
}

@-moz-document url-prefix() {
  [type="date"],
  [type="datetime-local"],
  [type="month"],
  [type="time"],
  [type="week"] {
    padding-right: var(--pico-form-element-spacing-horizontal) !important;
    background-image: none !important;
  }
}
[dir="rtl"]
  :is([type="date"], [type="datetime-local"], [type="month"], [type="time"], [type="week"]) {
  text-align: end;
}
