/**
 * PAGES STYLES
 */

/* ==========================================================================
   1. GAME GRIDS & CAROUSELS
   ========================================================================== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
  width: 100%;
}

@media (max-width: 640px) {
  .games-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-5);
  width: 100%;
}

@media (max-width: 640px) {
  .categories-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }
}

/* ==========================================================================
   2. FILTER & SEARCH CONTROLS (LIBRARY PAGE)
   ========================================================================== */
.library-controls {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.library-search-bar {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-input-wrap input {
  width: 100%;
  height: 48px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 var(--space-4) 0 44px;
  font-size: var(--text-sm);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.search-input-wrap input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow-subtle);
}

.search-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.sort-select-wrap {
  width: 200px;
}

.sort-select-wrap select {
  width: 100%;
  height: 48px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
}

.filter-pills-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-pill {
  padding: 6px 14px;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-pill:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.filter-pill.active {
  background: rgba(255, 42, 75, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ==========================================================================
   3. EMPTY & LOADING STATES
   ========================================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-4);
  background: var(--bg-surface);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-xl);
  margin: var(--space-6) 0;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.empty-state-title {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-2);
}

.empty-state-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 420px;
  margin-bottom: var(--space-6);
}

/* Skeletons */
.skeleton-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 320px;
  animation: pulseSkeleton 1.6s infinite ease-in-out;
}

@keyframes pulseSkeleton {
  0% { opacity: 0.6; }
  50% { opacity: 0.3; }
  100% { opacity: 0.6; }
}

/* ==========================================================================
   4. GAME DETAIL PAGE LAYOUT
   ========================================================================== */
.game-detail-header {
  margin-bottom: var(--space-6);
}

.game-detail-meta-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.game-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-8);
  margin-top: var(--space-8);
}

@media (max-width: 992px) {
  .game-detail-grid {
    grid-template-columns: 1fr;
  }
}

.detail-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.detail-card-title {
  font-size: var(--text-md);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Key Instructions Diagram */
.controls-keys-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.control-key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.control-key-item:last-child {
  border-bottom: none;
}

.key-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-family: var(--font-family-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.1);
}

/* Compatibility List */
.compat-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.compat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.compat-pill.supported {
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   5. CTA BANNER (HOMEPAGE SECTION I)
   ========================================================================== */
.cta-banner {
  background: linear-gradient(135deg, rgba(255, 42, 75, 0.12) 0%, rgba(14, 16, 23, 0.95) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-2xl);
  padding: var(--space-16) var(--space-8);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px var(--accent-glow-subtle);
}

.cta-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.cta-title {
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: var(--font-weight-black);
  margin-bottom: var(--space-4);
  position: relative;
  z-index: 1;
}

.cta-desc {
  font-size: var(--text-md);
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto var(--space-8);
  position: relative;
  z-index: 1;
}
