@use '../abstracts' as *;

/* Organism - Date picker */

.o-date-picker-wrapper{
  display: flex;

  .m-time-picker-wrapper {
    position: relative;
    flex: 1 1 20%;
    min-width: 0;
    overflow-y: clip;
  }
}

.o-date-picker{
  display: flex;
  flex-direction: column;
  flex: 1 1 80%;
  min-width: 0;
  height: 100%;

  &__header{
    display: flex;
    justify-content: space-between;
    margin: 10px 5px;

    & > div {
      display: flex;
      align-items: center;
    }

    &__dropdown{
      border: none;
      font-family: Ubuntu, sans-serif;
      font-size: 14px;
      font-weight: 500;
      line-height: 21px;
      &:last-of-type{
        margin-left: 5px;
      }
    }

    .a-arrow {
      &--left {
        transform: rotate(90deg);
      }

      &--right {
        transform: rotate(-90deg);
      }
    }

  }


  &__days-grid{
    flex: 1 1 80%;
  }

  &__weekdays,
  &__days-grid{
    display: grid;
    grid-template-columns: repeat(7, 1fr);
  }

  &__weekdays{
    @extend %list-unstyled;

    &__item {
      display: flex;
      justify-content: center;
      padding: 5px;

      span {
        color: #718096;
      }
    }
  }


  &__days-grid__item{
    display: flex;
    justify-content: center;
    align-items: center;
    place-self: center;
    aspect-ratio: 1;
    width: 100%;
    border: 1px solid transparent;
    cursor: pointer;

    &.round {
      &.-selected {
        border-radius: 50%;
      }

      &.-start {
        border-radius: 50% 0 0 50%;
      }

      &.-end {
        border-radius: 0 50% 50% 0;
      }
    }

    .a-time {
      font-size: 14px;
      line-height: 21px;
      font-weight: 400;
    }

    //classes used to push the first day of the month into the correct column of the grid
    &:first-child {
      &.start-1 {
        grid-column: 1;
      }

      &.start-2 {
        grid-column: 2;
      }

      &.start-3 {
        grid-column: 3;
      }

      &.start-4 {
        grid-column: 4;
      }

      &.start-5 {
        grid-column: 5;
      }

      &.start-6 {
        grid-column: 6;
      }

      &.start-7 {
        grid-column: 7;
      }
    }
  }
}


