/**
 * General Homepage Layout Styles - CrazyGames Inspired
 * Clean, minimal design with horizontal scrolling sections
 */

.homepage-general {
  width: 100%;
  background: var(--background-color);
  padding-top: 1rem;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Hero Content Section - Single Game Style */
.hero-content-section {
  padding: 2rem 0 3rem;
  margin-bottom: 2rem;
}

.hero-content-card {
  background: var(--card-background);
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.hero-main-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 2rem;
  line-height: 1.2;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
}

/* Hero content styles moved to post-content.css for unified styling */





/* Section Headings */
.section-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-new {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.view-more-link {
  color: var(--text-60);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.view-more-link:hover {
  color: var(--primary-color);
  gap: 0.5rem;
}

/* Latest Games Grid - Square Cards */
.latest-games-section {
  padding: 1.5rem 0 2.5rem;
}

.latest-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.latest-game-card {
  text-decoration: none;
  display: block;
  transition: transform 0.2s ease;
}

.latest-game-card:hover {
  transform: translateY(-4px);
}

.game-square-thumb {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-background);
  margin-bottom: 0.5rem;
}

.game-square-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.latest-game-card:hover .game-square-thumb img {
  transform: scale(1.1);
}

.game-hover-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 0.75rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.latest-game-card:hover .game-hover-overlay {
  opacity: 1;
}

.game-overlay-title {
  color: white !important;
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Game Category Sections */
.game-category-section {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.game-category-section:last-child {
  border-bottom: none;
  padding-bottom: 3rem;
}

/* Horizontal Scrolling Game Rows */
.game-row-scroll {
  position: relative;
  margin: 0 -1.5rem;
  padding: 0 1.5rem;
}

.game-row {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.game-row::-webkit-scrollbar {
  height: 8px;
}

.game-row::-webkit-scrollbar-track {
  background: transparent;
}

.game-row::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.game-row::-webkit-scrollbar-thumb:hover {
  background: var(--text-60);
}

/* Individual Game Cards in Rows */
.game-card-row {
  flex: 0 0 auto;
  width: 180px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.game-card-row:hover {
  transform: translateY(-4px);
}

.game-card-thumb {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-background);
  margin-bottom: 0.5rem;
}

/* Recently Played - Smaller Cards */
#recently-played-section .game-card-row {
  width: 140px;
}

#recently-played-section .game-card-thumb {
  width: 140px;
  height: 140px;
}

.game-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.game-card-row:hover .game-card-thumb img {
  transform: scale(1.1);
}

.game-title-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.875rem 0.75rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-card-row:hover .game-title-overlay {
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .latest-games-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .latest-games-section {
    padding: 1rem 0 1.5rem;
  }

  .latest-games-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
  }

  .section-heading {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .game-category-section {
    padding: 1rem 0;
  }

  .game-row-scroll {
    margin: 0 -1rem;
    padding: 0 1rem;
  }

  .game-row {
    gap: 0.75rem;
  }

  .game-card-row {
    width: 150px;
  }

  .game-card-thumb {
    width: 150px;
    height: 150px;
    border-radius: 8px;
  }

  .game-card-title {
    font-size: 0.875rem;
  }

  .view-more-link {
    font-size: 0.875rem;
  }

  /* Hero content section mobile */
  .hero-content-card {
    padding: 2rem 1.5rem;
  }

  .hero-main-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
  }

  .hero-description-content {
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
  }

  .hero-description-content h2 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
  }

  .hero-description-content h3 {
    font-size: 1.125rem;
  }
}

@media (max-width: 480px) {
  .latest-games-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .game-card-row {
    width: 130px;
  }

  .game-card-thumb {
    width: 130px;
    height: 130px;
  }

  .hero-content-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-text-content h1 {
    font-size: 1.5rem;
  }

  .hero-categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
  }

  .hero-category-card {
    padding: 1rem 0.75rem;
  }

  .category-icon,
  .category-icon-placeholder {
    width: 36px;
    height: 36px;
  }

  .category-name {
    font-size: 0.8125rem;
  }

  .hero-modal-content {
    margin: 2vh auto;
    padding: 1.5rem;
    max-height: 90vh;
  }

  .hero-modal-content h2 {
    font-size: 1.5rem;
  }

  .hero-modal-close {
    top: 1rem;
    right: 1rem;
  }
}

/* Gameplay Video Section */
.gameplay-video-section {
  padding: 0 0 3rem;
  margin-bottom: 1rem;
}

.gameplay-video-card {
  background: var(--card-background);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.gameplay-video-title {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.gameplay-video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.gameplay-video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 768px) {
  .gameplay-video-section {
    padding: 0 0 2rem;
  }

  .gameplay-video-card {
    padding: 1.25rem;
    border-radius: 12px;
  }

  .gameplay-video-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }

  .gameplay-video-wrapper {
    border-radius: 8px;
  }
}

/* All Games Section */
.all-games-section {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border-color);
}

.all-games-section .games-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}

/* Games Pagination */
.games-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.games-pagination a,
.games-pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  background: var(--card-background);
  color: var(--text-color);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
}

.games-pagination a:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.games-pagination .current {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.games-pagination .prev,
.games-pagination .next {
  padding: 0 0.5rem;
}

.games-pagination .dots {
  background: transparent;
  border: none;
  color: var(--text-60);
}

/* Infinite Scroll Loader */
.infinite-scroll-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--text-60);
  font-size: 0.9rem;
}

.loader-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.infinite-scroll-end {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-40);
  font-size: 0.875rem;
}

@media (max-width: 1200px) {
  .all-games-section .games-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .all-games-section {
    padding: 1.5rem 0 2rem;
  }

  .all-games-section .games-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .games-pagination {
    gap: 0.375rem;
    margin-top: 1.5rem;
  }

  .games-pagination a,
  .games-pagination span {
    min-width: 36px;
    height: 36px;
    font-size: 0.8rem;
    padding: 0 0.5rem;
  }
}
