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

.library-game-card-large {
  width: 100%;
  height: 300px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all ease 0.2s;
  cursor: pointer;
  display: flex;
  align-items: center;
  text-align: left;

  &:before {
    content: "";
    top: 0;
    left: 0;
    width: 100%;
    height: 172%;
    position: absolute;
    background: linear-gradient(
      35deg,
      rgba(0, 0, 0, 0.1) 0%,
      rgba(0, 0, 0, 0.07) 51.5%,
      rgba(255, 255, 255, 0.15) 64%,
      rgba(255, 255, 255, 0.1) 100%
    );
    transition: all ease 0.3s;
    transform: translateY(-36%);
    opacity: 0.5;
    z-index: 1;
  }

  &:hover::before {
    opacity: 1;
    transform: translateY(-20%);
  }

  &:hover {
    transform: scale(1.01);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
  }

  &__background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
  }

  &__gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 20%, transparent 100%);
    z-index: 1;
  }

  &__overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: calc(globals.$spacing-unit * 1.5);
  }

  &__top-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: calc(globals.$spacing-unit);
  }

  &__size-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: solid 1px rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 6px 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    min-height: 28px;
    box-sizing: border-box;
  }

  &__size-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.95);
  }

  &__size-bar-line {
    height: 4px;
    border-radius: 2px;
    transition: width 0.3s ease;
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.5),
      rgba(255, 255, 255, 0.8)
    );
  }

  &__size-bar-text {
    font-size: 12px;
    font-weight: 500;
  }

  &__logo-container {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
  }

  &__logo {
    max-height: 120px;
    max-width: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
  }

  &__title {
    font-size: 28px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
  }

  &__info-bar {
    display: flex;
    align-items: center;
    gap: calc(globals.$spacing-unit * 2);
    justify-content: flex-end;
  }

  &__playtime {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.95);
    border: solid 1px rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-size: 12px;
  }

  &__playtime-text {
    font-weight: 500;
  }

  &__manual-playtime {
    color: globals.$warning-color;
  }

  &__achievements {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
  }

  &__achievement-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  &__achievements-gap {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  &__achievement-trophy {
    color: #fff;
    flex-shrink: 0;
  }

  &__achievement-progress {
    width: 100%;
    height: 4px;
    transition: all ease 0.2s;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;

    &::-webkit-progress-bar {
      background-color: transparent;
      border-radius: 4px;
    }

    &::-webkit-progress-value {
      background-color: globals.$muted-color;
      border-radius: 4px;
    }
  }

  &__achievement-bar {
    height: 100%;
    background-color: globals.$muted-color;
    border-radius: 4px;
    transition: width 0.3s ease;
  }

  &__achievement-count {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
  }

  &__achievement-percentage {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
  }
}
