.ui-calendar {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: min-content;
  &.ui-range-picker {
    min-height: 265px;
  }
  &.ui-range-picker,
  &.ui-date-picker {
    > .ui-calendar__selector {
      min-height: 265px;
    }
  }

  &.ui-date-picker {
    > .ui-calendar__selector {
      padding: 5px;
    }
  }

  &__selector {
    display: inline-block;
    overflow: hidden;
    height: fit-content;
    vertical-align: top;
    user-select: none;
    &.week {
      .ui-calendar__page {
        width: 258px;
      }
    }
    > .container-calendar {
      padding: 10px;
    }
  }

  &__header {
    align-items: center;
    display: grid;
    grid-gap: 5px;
    grid-template-areas: "title prev next";
    grid-template-columns: 1fr auto auto;
    text-align: left;
  }

  &__presets {
    display: grid;
    height: 100%;
    align-items: center;
    align-content: stretch;
    overflow-y: auto;
    border-right: 1px solid;
    min-height: 265px;
    > ul {
      margin: 0;
      display: grid;
      height: 100%;
    }
  }

  &__preset {
    display: flex;
    height: 100%;
    width: 100%;
    min-height: 2rem;
    min-width: 12rem;
    align-items: center;
    font-size: 0.8em;
    padding: 0 0.5em;
    border-bottom: 1px solid;
    cursor: pointer;
    padding: 0 10px;

    &[data-active="true"] {
      pointer-events: none;
      border-right: 4px solid;
    }

    &:last-child {
      border-bottom: none;
    }
  }

  &__title {
    font-weight: $font-weight-medium;
    grid-area: title;
    padding: 0.25em;
  }

  &__tool {
    border: 1px dotted transparent;
    font-size: 1.5em;
    line-height: 1;
    border-radius: 5px;

    &.first {
      grid-area: first;
    }

    &.last {
      grid-area: last;
    }

    &.prev {
      grid-area: prev;
    }

    &.next {
      grid-area: next;
    }

    &[data-disabled="true"] {
      pointer-events: none;
    }

    > .ui-icon {
      font-size: 18px;
      padding: 3px;
    }
  }

  &__clock {
    padding-inline: 25px;
    display: grid;
    grid-template-columns: 30px 10px 30px;
    text-align: center;
    font-size: $ui-datepicker-fontsize;
    height: 164px;
    grid-template-rows: 100%;
    position: relative;
    grid-column-gap: 5px;

    > div {
      display: flex;
      flex-direction: column;
      height: 100%;
      align-items: center;
    }

    &__separator {
      > span {
        font-weight: bold;
        display: inline-block;
        vertical-align: middle;
        border-color: transparent;
        position: absolute;
        top: 50%;
        margin-top: -0.5 * $ui-datepicker-fontsize;
      }
    }

    &__hour,
    &__minute {
      justify-self: stretch;
      overflow: hidden;
      display: grid;

      > span {
        margin: 2px;
        padding-top: 4px;
        padding-bottom: 4px;
        border-block: 2px solid transparent;
      }
      .currentMinute,
      .currentHour {
        font-weight: bold;
      }
    }
  }

  &__page {
    width: 222px;

    &__column {
      display: grid;
      grid-auto-flow: column;
      grid-gap: 2px;
      grid-template-rows: repeat(7, 0.5fr);
      margin: 2px 0;
      text-align: center;
      justify-items: center;

      &.week {
        border-right: 1px solid currentColor;
        margin-right: 5px;
        padding-right: 5px;
      }
    }

    &__row {
      display: grid;
      grid-auto-flow: row;
      grid-gap: 2px;
      grid-template-columns: repeat(7, 0.5fr);
      margin: 2px 0;
      text-align: center;
      justify-items: center;
    }

    &[data-page="days"] {
      display: flex;
    }

    &[data-page="months"],
    &[data-page="years"] {
      display: grid;
    }

    &[data-page="months"] &__row,
    &[data-page="years"] &__row {
      display: grid;
      grid-gap: 0.5em;
      grid-template-columns: repeat(3, 1fr);
      line-height: 2em;
      margin: 0.8em 2px;
    }

    &__cell {
      cursor: pointer;
      padding: 0.25em;
      position: relative;
      border-radius: 4px;
      display: flex;
      align-items: center;
      justify-content: center;

      &.date {
        height: 30px;
        width: 30px;
        border-radius: 30px;
      }

      &.week {
        height: 30px;
        width: 30px;
      }

      &.month,
      &.year {
        width: 100%;
      }

      &.date-today {
        font-weight: $font-weight-medium;

        &::before {
          @include position(absolute, 0px null null 0px);

          border: {
            color: currentColor transparent transparent currentColor;
            style: solid;
            width: 3px;
          }

          content: "";
          height: 6px;
          width: 6px;
        }
      }

      &.disabled {
        pointer-events: none;
      }
    }
  }
}
