//////////////////////////////////////////////////////////////////////////////////////////
//   _  _ ____ _  _ ___  ____                                                           //
//   |_/  |__| |\ | |  \ |  |    This file belongs to Kando, the cross-platform         //
//   | \_ |  | | \| |__/ |__|    pie menu. Read more on github.com/kando-menu/kando     //
//                                                                                      //
//////////////////////////////////////////////////////////////////////////////////////////

// SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
// SPDX-License-Identifier: MIT

@use '../../variables.scss' as *;

.levelContainer {
  color: $text-normal;
  margin: 0 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.achievementContainer {
  overflow: hidden;
}

.levelText {
  margin-bottom: 4px;
}

.achievementSlider {
  color: $text-normal;
  display: flex;
  width: 200%;
  transition: transform 0.3s ease-in-out;

  &.showCompleted {
    transform: translateX(-50%);
  }
}

.achievementListWrapper {
  margin: 0 16px;
  width: 100%;
}

.noAchievements {
  color: $text-muted;
  font-style: italic;
  margin-top: 100px;
  text-align: center;
}

.achievementList {
  margin-top: 20px;
  padding: 0 80px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.achievement {
  display: flex;
  gap: 12px;
  align-items: center;

  border-radius: 8px;
  padding: 0 8px;

  position: relative;
  overflow: hidden;

  &.new:before {
    content: '';
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, $widget-normal, transparent);

    animation: shine 1.5s ease-in-out infinite;
  }

  @keyframes shine {
    0% {
      left: -100%;
      transition-property: left;
    }
    30% {
      left: -100%;
      transition-property: left;
    }
    100% {
      left: 100%;
      transition-property: left;
    }
  }

  .achievementBadge {
    height: 80px;
    width: 80px;
    position: relative;

    img {
      height: 100%;
      width: 100%;
      position: absolute;
    }
  }

  .achievementData {
    flex-grow: 1;
    flex-basis: 0;
  }

  .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .achievementName {
    font-weight: bold;
  }

  .achievementStat {
    color: $text-muted;
    font-size: 0.9em;
    align-self: flex-start;
    flex-shrink: 0;
  }
}

.footerContainer {
  color: $text-normal;
  margin: 8px 16px 16px 16px;
  display: flex;
  justify-content: end;
}

.viewButtons {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 1fr;

  button {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}
