@use "../../../scss/globals.scss";

.content-sidebar {
  height: 100%;
  flex-shrink: 0;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: calc(globals.$spacing-unit * 1.5);

  @media (min-width: 1024px) {
    width: 320px;
  }

  @media (min-width: 1280px) {
    width: 380px;
  }

  @media (min-width: 1440px) {
    width: 420px;
  }

  @media (max-width: 768px) {
    width: 35%;
    min-width: 220px;
  }

  @media (max-width: 480px) {
    width: 40%;
    min-width: 200px;
  }
}

.requirement {
  &__button-container {
    width: 100%;
    display: flex;
  }

  &__button {
    border: solid 1px globals.$border-color;
    border-left: none;
    border-right: none;
    border-radius: 0;
    width: 100%;
  }

  &__details {
    padding: calc(globals.$spacing-unit * 2);
    line-height: 22px;
    font-size: globals.$body-font-size;

    a {
      display: flex;
      color: globals.$body-color;
    }
  }

  &__details-skeleton {
    display: flex;
    flex-direction: column;
    gap: globals.$spacing-unit;
    padding: calc(globals.$spacing-unit * 2);
    font-size: globals.$body-font-size;
  }
}

.how-long-to-beat {
  &__categories-list {
    margin: 0;
    padding: calc(globals.$spacing-unit * 2);
    display: flex;
    flex-direction: column;
    gap: calc(globals.$spacing-unit * 2);
  }

  &__category {
    display: flex;
    flex-direction: column;
    gap: calc(globals.$spacing-unit / 2);
    background: linear-gradient(
      90deg,
      transparent 20%,
      rgb(255 255 255 / 2%) 100%
    );
    border-radius: 4px;
    padding: globals.$spacing-unit calc(globals.$spacing-unit * 2);
    border: solid 1px globals.$border-color;
  }

  &__category-label {
    color: globals.$muted-color;
  }

  &__category-label--bold {
    font-weight: bold;
  }

  &__category-skeleton {
    border: solid 1px globals.$border-color;
    border-radius: 4px;
    height: 76px;
  }
}

.protondb {
  &__content {
    padding: calc(globals.$spacing-unit * 2);
    overflow: hidden;
  }

  &__section {
    display: flex;
    gap: calc(globals.$spacing-unit * 1);
    justify-content: space-between;

    @media (min-width: 1024px) {
      flex-direction: column;
    }
  }

  &__category {
    display: flex;
    flex-direction: row;
    gap: calc(globals.$spacing-unit / 2);
    justify-content: space-between;
    align-items: center;
  }

  &__category-title {
    font-size: globals.$small-font-size;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: globals.$spacing-unit;
    color: globals.$muted-color;
  }

  &__steamdeck-icon {
    width: 18px;
    height: 18px;
    display: block;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(100%);
    flex-shrink: 0;
  }

  &__proton-icon {
    width: 18px;
    height: 18px;
    display: block;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(100%);
    flex-shrink: 0;
  }

  &__title-skeleton {
    display: block;
    width: 88px;
    height: 14px;
    border-radius: 4px;
  }

  &__value-skeleton {
    display: block;
    width: 64px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
  }

  &__link-skeleton {
    display: block;
    width: 142px;
    height: 14px;
    margin-top: calc(globals.$spacing-unit * 2);
    border-radius: 4px;
  }

  &__view-link {
    display: inline-flex;
    align-items: center;
    gap: calc(globals.$spacing-unit / 2);
    width: fit-content;
    margin-top: calc(globals.$spacing-unit * 2);
  }

  &__value {
    font-size: globals.$body-font-size;
    color: #fff;
    font-weight: 400;
    text-transform: capitalize;
  }

  &__tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #0a0a0a;
    background: rgb(180, 199, 220);
    border: 1px solid rgba(0, 0, 0, 0.25);
    line-height: 1.25;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.28);

    &--platinum {
      background: rgb(180, 199, 220);
    }

    &--gold {
      background: rgb(207, 181, 59);
    }

    &--silver {
      background: rgb(166, 166, 166);
    }

    &--bronze {
      background: rgb(205, 127, 50);
      color: #fff;
    }

    &--borked {
      background: #d72626;
      color: #fff;
    }
  }

  &__logo {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    display: block;
    opacity: 0.95;
  }
}

.stats {
  &__section {
    display: flex;
    gap: calc(globals.$spacing-unit * 1);
    padding: calc(globals.$spacing-unit * 2);
    justify-content: space-between;
    transition: max-height ease 0.5s;
    overflow: hidden;

    @media (min-width: 1024px) {
      flex-direction: column;
    }
  }

  &__category-title {
    font-size: globals.$small-font-size;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: globals.$spacing-unit;
  }

  &__category {
    display: flex;
    flex-direction: row;
    gap: calc(globals.$spacing-unit / 2);
    justify-content: space-between;
    align-items: center;
  }
}

.list {
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: calc(globals.$spacing-unit * 2);
  padding: calc(globals.$spacing-unit * 2);

  &__item {
    display: flex;
    cursor: pointer;
    transition: all ease 0.1s;
    color: globals.$muted-color;
    width: 100%;
    overflow: hidden;
    border-radius: 4px;
    padding: globals.$spacing-unit;
    gap: calc(globals.$spacing-unit * 2);
    align-items: center;
    text-align: left;

    &:hover {
      background-color: rgba(255, 255, 255, 0.15);
      text-decoration: none;
    }
  }

  &__item-image {
    width: 54px;
    height: 54px;
    border-radius: 4px;
    object-fit: cover;

    &--locked {
      filter: grayscale(100%);
    }
  }
}

.subscription-required-button {
  text-decoration: none;
  display: flex;
  justify-content: center;
  width: 100%;
  gap: calc(globals.$spacing-unit / 2);
  color: globals.$warning-color;
  cursor: pointer;

  &:hover {
    text-decoration: underline;
  }
}

.achievements-placeholder {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 8px;
}

.achievements-placeholder__blur {
  filter: blur(4px);
}
