/* =========================================== */
/*    HOME PAGE - CLEAN DASHBOARD THEME        */
/* =========================================== */

/* 1. PAGE HEADER */
.page-header {
  text-align: left;
  margin-bottom: var(--spacing-xl);
  position: relative;
  padding: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0;
  color: #3c22cd;
  background: none;
  -webkit-text-fill-color: initial;
  text-shadow: none;
}

.page-header p {
  display: none; /* Hide description for cleaner look */
}

/* Header Search Input */
.header-search-container {
    display: flex;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    width: 300px;
}

.search-input-wrapper input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border-radius: 20px;
    border: 1px solid #e4e4e4;
    background: #ffffff;
    font-size: 0.9rem;
    color: var(--color-text-primary);
    transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(108, 93, 211, 0.1);
}

.search-input-wrapper .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #808191;
    pointer-events: auto;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}

.search-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(108, 93, 211, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 700px;
    width: 100%;
}

.no-results-container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 700px;
    width: 100%;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* 2. SECTION TITLES AND STYLES */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-lg);
  text-align: left;
  position: relative;
  padding-bottom: 0;
  color: var(--color-text-primary);
  text-shadow: none;
}

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

/* 3. SECTION STYLING */
.section-introduction,
.section-featured,
.section-arcade,
.section-multiplayer,
.section-strategy,
.section-idle-games,
.section-casual-games,
.section-all-games,
.section-popular-categories,
.section-about-platform {
  padding: 0 0 var(--spacing-2xl);
  background: transparent; /* Let body background show */
  border: none;
}

/* 4. FILTER CONTROLS */
.filter-controls {
  display: none; /* Hide old filter controls if present */
}

/* 5. GAME GRID AND CARDS */
.grid-games {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* Force 5 columns */
  gap: 24px;
}

/* Responsive adjustments for the grid */
@media (max-width: 1200px) {
  .grid-games {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  .grid-games {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-games {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  
  .container {
      padding: 0 var(--container-padding);
  }

  .card-game {
      border-radius: 8px;
  }

  .container-image {
      margin: 1px;
      width: calc(100% - 2px);
      border-radius: 6px;
  }

  .container-game-info {
      padding: 4px 2px;
      gap: 0;
  }

  .title-game {
      font-size: 11px;
      margin-bottom: 1px;
      line-height: 1.2;
  }

  .game-genre-text {
      font-size: 9px;
  }

  /* Extra reductions */
  .section-introduction,
  .section-featured,
  .section-arcade,
  .section-multiplayer,
  .section-strategy,
  .section-idle-games,
  .section-casual-games,
  .section-all-games,
  .section-popular-categories,
  .section-about-platform {
    padding-bottom: 15px;
  }
  
  .page-header {
      margin-bottom: 12px;
      flex-wrap: nowrap; /* 防止换行 */
      gap: 10px;
  }
  
  .page-header h2 {
      white-space: nowrap; /* 强制标题不换行 */
      font-size: 1.1rem;
  }

  .search-input-wrapper {
      width: 150px; /* 移动端减小搜索框宽度 */
  }

  .search-input-wrapper input {
      padding: 8px 32px 8px 12px;
      font-size: 0.8rem;
  }

  .search-input-wrapper .search-icon {
      right: 12px;
      font-size: 12px;
  }

  .section-title {
      margin-bottom: 8px;
      font-size: 1.1rem;
  }

  .pagination-container {
      margin-top: 20px;
      gap: 4px;
  }

  .pagination-btn {
      min-width: 32px;
      height: 32px;
      font-size: 14px;
  }
}

@media (max-width: 480px) {
  .grid-games {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding-bottom: 20px;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-card);
    color: var(--color-text-primary);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.pagination-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--color-bg-tertiary);
}

/* 6. GAME CARD COMPONENT */
.card-game {
  background: transparent; /* Remove white background */
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  border: 4px solid transparent; /* Prepare for border */
  cursor: pointer;
  box-shadow: none; /* Remove shadow */
  height: 100%;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  position: relative;
  padding: 0; /* Remove padding to make content touch borders */
}

.card-game:hover {
  transform: none; /* Remove lift animation */
  box-shadow: none; /* Remove shadow */
  border-color: #c8c1f1; /* Add border color on hover */
  border-radius: 20px; /* Ensure 20px border radius matches radius-lg */
}

.card-game::before {
  display: none;
}

.container-image {
  position: relative;
  width: 100%;
  padding-bottom: 75%; /* 4:3 Aspect Ratio */
  min-height: 0;
  max-height: none;
  overflow: hidden;
  border-radius: 16px; /* Slightly smaller radius for inner image */
  margin: 4px; /* Space for the border */
  width: calc(100% - 8px); /* Adjust width to account for margin */
}

.game-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.container-game-info {
  padding: 10px 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: transparent;
}

.title-game {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: left;
  line-height: 1.4;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-genre-text {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-align: left;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-game:hover .title-game {
  text-shadow: none;
}

.container-game-rating {
  display: none; /* Hide rating for cleaner look */
}

.container-game-genre {
  margin-top: auto;
}

.tag-genre {
  background: transparent;
  color: var(--color-text-secondary);
  padding: 0;
  border-radius: 0;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: capitalize;
  border: none;
}

.badge-featured {
  top: 20px;
  right: 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* 7. HERO SECTION */
.hero {
  background: transparent;
  padding: 0 0 var(--spacing-xl);
  margin-top: 0;
  display: block;
}

/* 8. LOAD MORE BUTTON */
.container-load-more {
  text-align: center;
  margin-top: var(--spacing-xl);
}

.button-load-more {
  padding: 12px 30px;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

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

/* 9. CATEGORIES */
.categories-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.category-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: none;
  box-shadow: var(--shadow-sm);
  gap: 16px;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.category-icon {
  font-size: 2.5rem;
  filter: none;
}

.category-card h3 {
  font-size: 1.1rem;
  color: var(--color-text-primary);
}

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

.category-card p {
  display: none;
}

/* 10. ABOUT SECTION */
.section-about-platform {
  background: var(--color-bg-card);
  margin: 0 -30px -40px; /* Stretch to edges of main content */
  padding: 40px 30px;
  border-top: 1px solid var(--color-border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.about-header h2 {
  color: var(--color-text-primary);
  text-shadow: none;
}

.header-line {
  background: var(--color-primary);
  box-shadow: none;
}

.about-feature {
  background: var(--color-bg-primary);
  border: none;
  box-shadow: none;
}

.about-feature:hover {
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.about-text-group h3 {
  color: var(--color-text-primary);
  text-shadow: none;
}

/* NEW: TOP CAROUSELS STYLES */
.top-carousels-section {
  padding-top: 30px;
  padding-bottom: 30px;
}

.top-carousels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.carousel-card {
    height: 220px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.carousel-card:hover {
    transform: translateY(-5px);
}

.carousel-content {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Cover bottom part */
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    /* Gradient handled by specific ID selectors below */
}

/* Seasonal Picks - Purple Gradient */
#carousel-seasonal .carousel-overlay {
    background: linear-gradient(160deg, rgba(203, 93, 255, 0) 40%, rgba(29, 65, 190, 0.6)), linear-gradient(1turn, rgba(203, 93, 255, 0.5) 21%, rgba(29, 65, 190, 0) 66%), linear-gradient(1turn, rgba(255, 255, 255, 0.1) 21%, rgba(29, 65, 190, 0) 100%);
}

/* Valentine's Day - Pink Gradient */
#carousel-valentine .carousel-overlay {
   background: linear-gradient(160deg, rgba(203, 93, 255, 0) 40%, rgba(29, 65, 190, 0.6)), linear-gradient(1turn, rgba(203, 93, 255, 0.5) 21%, rgba(29, 65, 190, 0) 66%), linear-gradient(1turn, rgba(255, 255, 255, 0.1) 21%, rgba(29, 65, 190, 0) 100%);
}

/* Best New - Blue Gradient */
#carousel-best .carousel-overlay {
    background: linear-gradient(160deg, rgba(203, 93, 255, 0) 40%, rgba(29, 65, 190, 0.6)), linear-gradient(1turn, rgba(203, 93, 255, 0.5) 21%, rgba(29, 65, 190, 0) 66%), linear-gradient(1turn, rgba(255, 255, 255, 0.1) 21%, rgba(29, 65, 190, 0) 100%);
}


.carousel-title {
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.carousel-nav {
    display: flex;
    gap: 8px;
}

.nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-primary);
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: white;
    transform: scale(1.1);
}

.nav-btn i {
    font-size: 0.8rem;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .tags-sidebar {
    display: none !important;
  }
  .tags-sidebar.active {
    display: flex !important;
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .main-content {
    padding: 20px 20px 0;
  }
  
  .top-carousels-grid {
      grid-template-columns: 1fr;
  }
}

/* COLLECTIONS SECTION */
.collections-section {
    padding-top: 40px;
    padding-bottom: 40px;
}

.collections-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 20px;
}

.collection-card {
    position: relative;
    height: 180px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: inherit;
    text-decoration: none;
}

.collection-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    z-index: 1;
}
.collection-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%);
    /* This gradient will be overridden by specific styles */
}

/* Card Specific Styles (Gradients) */
.style-exclusive .collection-content {
    background: linear-gradient(180deg, rgba(82, 107, 255, 0) 0%, rgba(68, 48, 230, 0.9) 100%);
}

.style-hot .collection-content {
    background: linear-gradient(180deg, rgba(255, 117, 85, 0) 0%, rgba(212, 53, 22, 0.9) 100%);
}

.style-brain .collection-content {
    background: linear-gradient(180deg, rgba(63, 206, 158, 0) 0%, rgba(13, 161, 107, 0.9) 100%);
}

.style-purchase .collection-content {
    background: linear-gradient(180deg, rgba(160, 97, 255, 0) 0%, rgba(95, 43, 226, 0.9) 100%);
}


.collection-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.collection-info h3 {
    color: white;
    margin: 0 10px 0 0;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    /* 不超过两行展示，超过部分省略号 */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.collection-count {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
}

.collection-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Specific button colors based on image if needed, but white glassmorphism looks clean */
.style-exclusive .collection-btn { background: #4e3ae2; border-color: transparent; }
.style-hot .collection-btn { background: #3b28cc; border-color: transparent; } /* Using blue/purple as seen in image for contrast? Or red? Image has blue buttons for all */
.style-brain .collection-btn { background: #3b28cc; border-color: transparent; }
.style-purchase .collection-btn { background: #3b28cc; border-color: transparent; }

/* Override button style to match image (solid blue/purple) */
.collection-btn {
    background: #4C35E0; /* Deep Blue/Purple */
    border: none;
    backdrop-filter: none;
}

.collection-btn:hover {
    background: #6a55e6; /* Lighter shade on hover */
    transform: translateX(2px);
}

.collection-btn i {
    font-size: 0.7rem;
}

/* Responsive for Collections */
@media (max-width: 992px) {
    .collections-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .collections-grid {
        grid-template-columns: 1fr;
    }
}

/* Final Mobile Overrides */
@media (max-width: 768px) {
  .main-content {
      padding: 10px 5px 0 !important;
  }
}
