.leaderboard {
  $gold: #ffd82a;
  $silver: #c4c4c4;
  $bronze: #cd7f32;
  $success: #4bb543;

  .page {
    &__header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid var(--header_primary);
      margin-top: 2rem;
      padding-bottom: 0.5rem;

      svg {
        vertical-align: middle;
      }
    }

    &__title {
      margin: 0;
    }
  }

  &__controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  &__period-chooser {
    margin: 1.5rem 0 0.75rem;

    .selected-name {
      margin: 0;
    }
  }

  .-ghost,
  .-ghost .d-icon {
    padding: 0;
    color: var(--tertiary);
    border: 0;
    background-color: transparent;
    box-shadow: none;

    &:hover {
      color: var(--tertiary);
      background-color: transparent;

      .d-icon {
        color: var(--tertiary);
        background-color: transparent;
      }
    }
  }

  .podium {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 2rem;
    padding-bottom: 5rem;

    &__wrapper {
      background: rgb(var(--tertiary-rgb), 0.1);
      border-bottom-left-radius: 20px;
      border-bottom-right-radius: 20px;
    }
  }

  .winner {
    overflow: hidden; // best worst solution in case the username is very long, better to cut it than have it wrap mid-name or overflow

    &__crown {
      display: none;
      margin-bottom: 1rem;
      text-align: center;

      .d-icon {
        color: $gold;
        font-size: 40px;
      }
    }

    &__avatar {
      position: relative;
      margin-bottom: 25px;

      img {
        width: 100%;
        height: auto;
        border-radius: 100%;
        border-width: 5px;
        border-style: solid;
        box-sizing: border-box;
      }
    }

    &__rank {
      display: flex;
      align-items: center;
      justify-content: center;
      position: absolute;
      bottom: 0;
      right: 50%;
      transform: translate(50%, 50%);
      width: 48px;
      height: 48px;
      border-radius: 100%;
      font-size: 28px;
      color: #222;
      font-weight: bold;
    }

    &__name {
      text-align: center;
    }

    &__score {
      font-size: var(--font-up-5);
      font-weight: bold;
      text-align: center;
    }

    &.-position1 {
      position: relative;
      z-index: 1;
      order: 2;

      .winner__crown {
        display: block;
      }

      .winner__avatar img {
        border-color: $gold;
        background-color: #ffe46a;
      }

      .winner__rank {
        background-color: $gold;
      }
    }

    &.-position2 {
      order: 1;
      transform: translate(20%, 35%);

      .winner__avatar img {
        border-color: $silver;
        background-color: #d6d6d6;
      }

      .winner__rank {
        background-color: $silver;
      }
    }

    &.-position3 {
      order: 3;
      transform: translate(-20%, 35%);

      .winner__avatar img {
        border-color: $bronze;
        background-color: #dca570; // in case avatar has a transparent bg
      }

      .winner__rank {
        background-color: $bronze;
      }
    }
  }

  .ranking {
    margin-top: 2rem;
  }

  .ranking-col-names {
    position: sticky;
    display: flex;
    justify-content: space-between;
    top: var(--header-offset);
    background-color: var(--secondary);
    border-bottom: 1px solid black;

    .d-icon {
      margin-right: 0.25rem;
    }

    &__sticky-border {
      position: relative;
      height: 2px;
      margin-top: -1px;
      background-color: var(--secondary);
    }
  }

  .user {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: 0.5rem 1.5rem;
    background-color: rgb(var(--primary-rgb), 0.075);
    border-radius: 20px;

    &__rank {
      flex-shrink: 0;
      font-size: var(--font-up-5);
      font-weight: bold;
      font-family: monospace;
    }

    &__avatar {
      margin: 0 1rem 0 1rem;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;

      img {
        margin-right: 1rem;
        border-radius: 100%;
      }
    }

    &__name {
      font-size: var(--font-up-2);
    }

    &__score {
      flex-grow: 1;
      text-align: right;
      font-size: var(--font-up-4);
      font-weight: bold;
    }

    &.-self {
      margin-bottom: 2rem;
      padding-top: 0.25rem;
      padding-bottom: 0.25rem;
      background-color: var(--tertiary);
      color: var(--secondary);

      .user__name {
        flex-grow: 1;
        text-align: center;
        font-weight: bold;
      }

      .user__score {
        flex-grow: 0;
      }
    }

    &-highlight {
      background-color: var(--tertiary);
      color: var(--secondary);
    }
  }

  &__not-ready {
    display: flex;
    align-items: center;

    p {
      margin-right: 0.5em;
    }
  }
}

.recalculate-scores-form-modal {
  .modal-inner-container {
    min-width: 25em;

    .select-kit {
      width: 100%;
    }
  }

  .-custom-range {
    display: flex;
    align-items: baseline;
    margin-top: 0.5rem;

    > * {
      flex: 1 1 0;
    }

    .date-picker-wrapper {
      margin-left: auto;
    }

    .date-picker {
      max-width: 400px;
    }
  }

  .recalculate-modal__status.is-success .d-icon-check {
    color: $success;
  }
}

.recalculate-modal {
  &__date-range {
    margin-top: 0.5rem;
    color: var(--primary-high);
  }

  &__footer-text {
    margin-left: auto;
    color: var(--primary-high);
  }
}
