@use '../../themes/index' as *;
@use '../../abstracts/index' as *;

/* 
  Game list styles
  For game list container and grid
*/
.game-list {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
  height: 100%;
  width: 100%;
  @include custom-scrollbar;
  position: relative;

  h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.3px;
  }
}

.game-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.9rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-dark);
}

// Game grid
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  width: 100%;
  padding: 0.5rem 0.5rem 2rem 0.5rem;
  scroll-behavior: smooth;
  align-items: stretch;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeIn 0.5s forwards;
}

// Loading and empty state
.loading-indicator,
.no-games-message {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 250px;
  width: 100%;
  font-size: 1.2rem;
  color: var(--text-secondary);
  text-align: center;
  border-radius: var(--radius-lg);
  background-color: var(--tertiary-bg);
  border: 1px solid var(--border-soft);
}

// Responsive adjustments
@include media-sm {
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@include media-lg {
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@include media-xl {
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }
}

// Scroll to top button
.scroll-top-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: var(--text-heavy);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--border-soft);
  opacity: 0;
  transform: translateY(10px);
  transition:
    background-color var(--duration-normal) var(--easing-ease-out),
    opacity var(--duration-normal) var(--easing-ease-out),
    transform var(--duration-normal) var(--easing-ease-out);
  z-index: var(--z-header);

  &.visible {
    opacity: 1;
    transform: translateY(0);
  }

  &:hover {
    background-color: color-mix(in srgb, black 8%, var(--primary-color));
  }
}
