/* ═══════════════════════════════════════════
   catalog.css – PlaySprint Catalog Styles
   Extends game.css / style.css without
   modifying them. All new catalog UI lives
   here: skeletons, new home sections, filter
   bar, ad slots, collections, empty states.
═══════════════════════════════════════════ */

/* ── Skeleton Loaders ────────────────────── */

@keyframes skeleton-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    color-mix(in srgb, var(--surface-2) 80%, var(--text-primary)) 50%,
    var(--surface-2) 75%
  );
  background-size: 600px 100%;
  animation: skeleton-shimmer 1.4s infinite linear;
  border-radius: 6px;
}

.skeleton-card {
  pointer-events: none;
  opacity: 0.7;
}

.skeleton-img {
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: var(--radius) var(--radius) 0 0;
}

.skeleton-line {
  display: block;
  height: 14px;
  margin-bottom: 10px;
}

.skeleton-btn {
  height: 40px;
  border-radius: var(--radius-sm);
  width: 100%;
}

/* ── Game Count Badge ────────────────────── */

.catalog-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

#game-count {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ── Filter Bar ──────────────────────────── */

.filter-bar-v2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}

.filter-bar-v2 .search-box {
  flex: 1 1 200px;
}

.filter-bar-v2 .filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-bar-v2 .fav-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.filter-bar-v2 .fav-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* ── Category Chip Bar ───────────────────── */

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2rem;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.category-chip:hover,
.category-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Ad Row Slot ─────────────────────────── */

.games-grid-ad {
  grid-column: 1 / -1;
  padding: 1rem 0;
}

.ad-row-slot {
  width: 100%;
}

.ad-row-slot .ad-container {
  max-width: 728px;
  margin: 0 auto;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Empty State ─────────────────────────── */

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state p {
  margin-bottom: 1.5rem;
}

/* ── New Badge on Cards ──────────────────── */

.badge-new {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(135deg, #22C55E, #16A34A);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  z-index: 3;
}

/* ── Compact Card Variant ────────────────── */

.game-card--compact .game-card-img-wrapper {
  height: 120px;
  overflow: hidden;
}

.game-card--compact .game-card-desc {
  display: none;
}

.game-card--compact .game-card-meta {
  display: none;
}

/* ── Home Sections ───────────────────────── */

.home-section {
  padding: 3rem 0;
}

.home-section + .home-section {
  border-top: 1px solid var(--border);
}

.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.home-section-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
}

.home-section-header .see-all {
  font-size: 0.875rem;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.home-section-header .see-all:hover {
  text-decoration: underline;
}

.home-section-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* ── Collections Grid ────────────────────── */

.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.collection-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s;
  cursor: pointer;
}

.collection-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.collection-icon {
  font-size: 2rem;
  line-height: 1;
}

.collection-info h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.collection-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Recommendation Strip ────────────────── */

.reco-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.reco-strip::-webkit-scrollbar { height: 4px; }
.reco-strip::-webkit-scrollbar-track { background: transparent; }
.reco-strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.reco-card {
  flex: 0 0 180px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: all 0.2s;
}

.reco-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.reco-card img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.reco-card-body {
  padding: 10px 12px;
}

.reco-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.reco-card-genre {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Featured Game Banner ────────────────── */

.featured-game-banner {
  position: relative;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--bg-primary) 100%);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 280px;
  margin-bottom: 3rem;
}

@media (max-width: 640px) {
  .featured-game-banner {
    grid-template-columns: 1fr;
  }
  .featured-game-img {
    display: none;
  }
}

.featured-game-content {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.featured-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(59, 130, 246, 0.12);
  padding: 4px 10px;
  border-radius: 4px;
  width: fit-content;
}

.featured-game-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.2;
}

.featured-game-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 340px;
}

.featured-game-img {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(59,130,246,0.05), rgba(34,197,94,0.05));
}

.featured-game-img img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
}

/* ── Catalog Grid Override ───────────────── */

.catalog-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* ── Fav Pop Animation ───────────────────── */

@keyframes fav-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.fav-pop { animation: fav-pop 0.35s ease; }

/* ── Recently Played Bar ─────────────────── */

.continue-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.continue-item {
  flex: 0 0 140px;
  text-align: center;
  text-decoration: none;
  transition: transform 0.2s;
}

.continue-item:hover { transform: translateY(-3px); }

.continue-item img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  margin-bottom: 6px;
}

.continue-item span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
}

/* ── Responsive ──────────────────────────── */

@media (max-width: 768px) {
  .filter-bar-v2 { padding: 0.75rem; }
  .home-section-header h2 { font-size: 1.1rem; }
  .featured-game-title { font-size: 1.5rem; }
  .featured-game-content { padding: 1.5rem; }
}
