/* =========================================== */
/*    HOME PAGE - MODERN PREMIUM THEME STYLES  */
/* =========================================== */

/* 1. PAGE HEADER */
.page-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  position: relative;
  padding: 2rem 0;
}

.page-header h2 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: var(--spacing-md);
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
  text-shadow: none;
}

.page-header p {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* 2. SECTION TITLES AND STYLES */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: left;
  position: relative;
  padding-bottom: 0;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
  text-shadow: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title::before {
  content: '';
  display: block;
  width: 6px;
  height: 24px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

.section-title::after {
  display: none;
}

/* 3. SECTION STYLING - Clean Backgrounds */
.section-featured,
.section-arcade,
.section-multiplayer,
.section-strategy,
.section-idle-games,
.section-casual-games,
.section-all-games {
  padding: var(--spacing-2xl) 0;
  background: transparent; /* Let body bg show through or set specifically */
}

/* Alternating backgrounds for visual separation */
.section-featured {background: var(--color-bg-primary); }
.section-arcade {background: var(--color-bg-secondary); }
.section-multiplayer {background: var(--color-bg-primary); }
.section-strategy {background: var(--color-bg-secondary); }
.section-idle-games {background: var(--color-bg-primary); }
.section-casual-games {background: var(--color-bg-secondary); }
.section-all-games {background: var(--color-bg-primary); }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
  gap: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--spacing-md);
}

/* 4. FILTER CONTROLS - Modern Pills */
.filter-controls {
  display: flex;
  justify-content: center;
  margin-bottom: var(--spacing-xl);
}

.filter-tags-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
}

.filter-tags-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--spacing-xs);
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  justify-content: center;
}

.filter-tag {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
  line-height: 1;
}

.filter-tag:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  border-color: var(--color-text-muted);
  transform: translateY(-1px);
}

.filter-tag.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

/* 5. GAME GRID AND CARDS */
.grid-games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); /* Larger cards */
  gap: var(--spacing-lg);
}

.grid-featured {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Even larger for featured */
}

/* 6. GAME CARD COMPONENT - Modern Premium Style */
.card-game {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  border: 1px solid rgba(255, 255, 255, 0.05); /* Very subtle border */
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  height: 100%;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.card-game:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Remove old neon effects */
.card-game::before {display: none; }

.container-image {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
  background: var(--color-bg-tertiary);
}

.game-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card-game:hover .game-image {
  transform: scale(1.05);
}

.placeholder-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-tertiary);
  flex-direction: column;
}

.placeholder-icon {
  font-size: 2rem;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-xs);
}

.placeholder-text {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Image loading logic classes */
.placeholder-image {display: none; }
.game-image.loading + .placeholder-image {display: flex; }
.game-image.error {display: none; }
.game-image.error + .placeholder-image {display: flex; }

.container-game-info {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--color-bg-card);
  position: relative;
  z-index: 2;
}

.title-game {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* Allow 2 lines */
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.card-game:hover .title-game {
  color: var(--color-primary-light);
  text-shadow: none;
}

.container-game-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--color-warning);
  font-size: 0.85rem;
  font-weight: 600;
  text-shadow: none;
}

.container-game-rating i {
  font-size: 0.9rem;
}

.container-game-genre {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto; /* Push to bottom */
  padding-top: 0.75rem;
}

.tag-genre {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  border: none;
  transition: all var(--transition-normal);
}

.card-game:hover .tag-genre {
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-primary-light);
}

.badge-featured {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--color-primary);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 2;
  box-shadow: var(--shadow-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* 7. HERO STATS - Clean Dashboard Style */
.stats-hero,
.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--spacing-xl);
  margin-top: var(--spacing-2xl);
  flex-wrap: wrap;
  width: 100%;
  max-width: 1000px;
}

.stat-item,
.stat {
  flex: 1;
  text-align: center;
  padding: var(--spacing-lg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  min-width: 160px;
  transition: all var(--transition-normal);
}

.stat-item:hover,
.stat:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-text-primary);
  margin-bottom: 0.25rem;
  text-shadow: none;
  background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Color specific stats overrides if needed, keeping it clean for now */
.stat:nth-child(2) .stat-number {
  /* color: var(--color-secondary); */
}

.section-description {
  text-align: left;
  color: var(--color-text-secondary);
  font-size: 1rem;
  max-width: 800px;
}

/* 8. ANIMATIONS - Subtle */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 9. LOADING STATES - Skeleton */
.animation-loading-shimmer {
  background: linear-gradient(90deg, var(--color-bg-secondary) 25%, var(--color-bg-tertiary) 50%, var(--color-bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {background-position: -200% 0; }
  100% {background-position: 200% 0; }
}

.state-loading {
  text-align: center;
  padding: var(--spacing-2xl);
  color: var(--color-text-secondary);
  font-size: 1rem;
  font-weight: 500;
  background: transparent;
  border-radius: var(--radius-lg);
  margin: var(--spacing-lg) 0;
  border: 1px dashed var(--border-color);
  animation: none;
}

/* 10. CATEGORY SPECIFIC STYLES - Clean Colors */
/* Just simple colored bars/accents instead of glowing text */

/* 11. LOAD MORE BUTTON - Modern Solid */
.container-load-more {
  text-align: center;
  margin-top: var(--spacing-2xl);
  padding-bottom: var(--spacing-xl);
}

.button-load-more {
  padding: 0.875rem 2.5rem;
  background: var(--color-bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--color-text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.button-load-more:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.button-load-more:active {
  transform: translateY(0);
}

.button-load-more.loading {
  pointer-events: none;
  opacity: 0.8;
}

.button-load-more.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 0.75rem;
}

@keyframes spin {
  0% {transform: rotate(0deg); }
  100% {transform: rotate(360deg); }
}

/* 12. POPULAR CATEGORIES SECTION - Clean Grid */
.section-popular-categories {
  padding: var(--spacing-3xl) 0;
  background: var(--color-bg-secondary);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--spacing-lg);
}

.category-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  text-align: center;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
  height: 100%;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
  background: var(--color-bg-card); /* Keep bg same or slight lighten */
}

.category-icon {
  font-size: 2.5rem;
  line-height: 1;
  color: var(--color-text-secondary); /* Muted icon default */
  transition: all var(--transition-normal);
  filter: none;
}

.category-card:hover .category-icon {
  transform: scale(1.1);
  color: var(--color-primary);
  filter: none;
}

.category-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--color-text-primary);
  transition: color var(--transition-normal);
}

.category-card:hover h3 {
  color: var(--color-primary);
  text-shadow: none;
}

.category-card p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* 13. MOBILE RESPONSIVE */
@media (max-width: 768px) {
  /* Hero Section */
  .page-header {
    padding: 1rem 0;
  }
  
  .section-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
  
  /* Stats */
  .stats-hero {
    gap: 12px;
    margin-top: 24px;
  }

  .stat-item,
  .stat {
    padding: 16px;
    min-width: 0; /* Allow shrinking */
  }
  
  .stat-number {
    font-size: 1.75rem;
  }
  
  .stat-label {
    font-size: 0.75rem;
  }
  
  /* Grid adjustments */
  .grid-games,
  .grid-featured {
    gap: 16px;
    grid-template-columns: repeat(2, 1fr); /* Force 2 columns on mobile */
  }
  
  .card-game {
    border-radius: var(--radius-md);
  }
  
  .container-game-info {
    padding: 12px;
    gap: 4px;
  }
  
  .title-game {
    font-size: 0.9rem;
    margin-bottom: 4px;
  }
  
  .tag-genre {
    font-size: 0.7rem;
    padding: 2px 8px;
  }
  
  /* Categories */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .grid-games,
  .grid-featured {
    grid-template-columns: repeat(2, 1fr); /* Still 2 columns for game density */
    gap: 10px;
  }
  
  .card-game {
    box-shadow: none; /* Flatter on mobile */
    border: none;
    background: transparent; /* Clean look on mobile */
  }
  
  .container-image {
    border-radius: var(--radius-md);
  }
  
  .container-game-info {
    padding: 8px 0; /* Remove padding for list-like feel if transparent, or keep if card */
    background: transparent;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
}
