.timeline {
  display: flex;
  flex-direction: column;
  align-items: center;

  .title {
    margin-bottom: 0;
    padding-bottom: 0;
    text-align: center;
    font-size: 32px;
    margin-top: 0;
  }

  .timeframe-controls {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    height: 40px;

    .cur-month {
      height: 36px;
      padding: 1px 3px;
      font-size: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      min-width: 220px;
      text-align: center;
    }

    button {
      height: 35px;
      width: 34px;
      background-color: #222;
      outline: none;
      border: 1px solid #333;
      color: #eee;
      cursor: pointer;
      font-size: 22px;
      margin-bottom: -6px;
    }
  }

  .timeline-week {
    display: grid;
    grid-template-columns: repeat(7, 126px);
    gap: 2px 2px;
    padding-top: 1px;
    padding-bottom: 1px;

    .timeline-day {
      height: 126px;
      cursor: pointer;
      background-color: #444;

      .timeline-date {
        position: absolute;
        z-index: 3;
        font-weight: bolder;
        padding-left: 2px;
      }

      .timeline-events.event-count-1-4 {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);

        .timeline-event {
          max-height: 63px;
        }
      }

      .timeline-events.event-count-5-9 {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);

        .timeline-event {
          max-height: 42px;
        }
      }
    }
  }

  .day-stats {
    width: 100%;

    .events-section .image-box-grid-title {
      margin-top: 20px;
      padding-top: 0;
      font-size: 30px;
    }
  }
}

.timeline-events {
  display: grid;
  grid-auto-flow: row;
  max-height: 100%;

  .timeline-event .timeline-event-tooltip {
    visibility: hidden;
    width: 150px;
    font-size: 11px;
    background-color: #121212;
    border: 1px solid #444;
    border-radius: 5px;
    position: absolute;
    z-index: 5;
    padding: 3px 4px;
  }

  .timeline-event:hover .timeline-event-tooltip {
    visibility: visible;
  }
}

.timeline.timeline-loading {
  .timeline-day {
    background-color: #353535;
  }
}

@media only screen and (max-width: 800px) {
  .timeline .day-stats .events-section .image-box-grid-title {
    font-size: 22px;
  }

  .timeframe-controls {
    button {
      height: 34px !important;
      padding-bottom: 33px;
    }
  }
}

.mobile-timeline-weeks {
  display: flex;
  flex-direction: column;
  width: 100%;

  .mobile-week-label {
    text-align: center;
    font-size: 13px;
    margin-top: 4px;
    margin-bottom: 3px;
  }

  .mobile-timeline-week {
    display: grid;
    min-height: 33.333vw;
    background-color: #040404;
    border-radius: 0px 0px 5px 5px;

    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: 1fr 1fr;

    .timeline-event {
      display: flex;
    }

    .timeline-event:hover .timeline-event-tooltip {
      margin-top: 16.666666vw;
    }

    .timeline-event:nth-child(5) > .timeline-event-tooltip,
    .timeline-event:nth-child(6) > .timeline-event-tooltip,
    .timeline-event:nth-child(11) > .timeline-event-tooltip,
    .timeline-event:nth-child(12) > .timeline-event-tooltip {
      right: 8px;
    }
  }
}
