@use 'src/styles/abstracts' as *;

.CalendarHeatmap__map {
  display: grid;
  grid-template-columns: 1em 1fr;
  grid-template-rows: 20px 1fr;
}

.CalendarHeatmap__map__axis {
  color: var(--grey-light);

  &.CalendarHeatmap__map__axis--x {
    font-size: 12px;
    font-weight: $font-500;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }

  &.CalendarHeatmap__map__axis--y {
    font-size: 9px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    position: sticky;
    left: 0;
    background-color: $white;
  }
}

.CalendarHeatmap__map__grid {
  display: grid;
  grid-auto-flow: column;
  user-select: none;
}

.CalendarHeatmap__cell__wrapper {
  width: 100%;
  height: 100%;

  .Tooltip__container {
    width: 100%;
    height: 100%;
  }
}

.CalendarHeatmap__cell {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border-radius: 3px;
  transition: box-shadow 50ms ease;
  cursor: pointer;

  &.CalendarHeatmap__cell--dummy {
    opacity: 0;
    pointer-events: none;
    user-select: none;
    cursor: auto;
  }

  &.CalendarHeatmap__cell--scale-0 {
    background: $pico-10;
    cursor: default;
  }

  &.CalendarHeatmap__cell--scale-1 {
    background: #abcaf6;
  }

  &.CalendarHeatmap__cell--scale-2 {
    background: #77a8ef;
  }

  &.CalendarHeatmap__cell--scale-3 {
    background: #3578e6;
  }

  &.CalendarHeatmap__cell--scale-4 {
    background: #225ae0;
  }
}

.CalendarHeatmap__cell__info {
  margin-top: 1em;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  .CalendarHeatmap__cell {
    cursor: default;
    &__wrapper {
      margin-right: 0.25em;
    }
  }
  span {
    line-height: 12px;
    margin-right: 0.75em;
    &:last-child {
      margin-left: 0.5em;
    }
  }
}
