/* style/index-popular-games.css */
:root {
  --primary-color: #0A2463;
  --secondary-color: #FFD700;
  --dark-bg-1: #0d0d0d; /* Assuming this is from shared.css */
}

.page-index-popular-games {
  font-family: 'Arial', sans-serif;
  color: #333333; /* Default text color for light backgrounds */
  background-color: #f1f3f5; /* Light grey background for the page content */
}

/* HERO Section */
.page-index-popular-games__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  padding-top: 180px; /* Desktop: Adjust for fixed header */
  background: var(--primary-color);
  color: #ffffff;
  overflow: hidden;
}

.page-index-popular-games__hero-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.page-index-popular-games__hero-image {
  width: 100%;
  margin-bottom: 30px;
  max-width: 1000px; /* Limit image width */
}

.page-index-popular-games__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.page-index-popular-games__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
}

.page-index-popular-games__hero-title {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #ffffff;
  line-height: 1.2;
}

.page-index-popular-games__hero-description {
  font-size: 20px;
  line-height: 1.6;
  margin-bottom: 30px;
  color: #f0f0f0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-index-popular-games__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--secondary-color);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  margin-top: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-index-popular-games__cta-button:hover {
  background: #e0b800;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Game Leaderboard Section */
.page-index-popular-games__game-leaderboard-section {
  padding: 60px 20px;
  background: #f1f3f5;
  text-align: center;
}

.page-index-popular-games__page-title {
  font-size: 36px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 40px;
  text-align: center;
}

.page-index-popular-games__game-leaderboard {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-index-popular-games__game-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  padding: 20px;
  transition: transform 0.3s ease;
  min-height: 150px;
}

.page-index-popular-games__game-card:hover {
  transform: translateY(-5px);
}

.page-index-popular-games__game-card-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  position: relative;
  height: 100%;
}

.page-index-popular-games__game-card-segment:not(:first-child)::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10%;
  height: 80%;
  width: 1px;
  background-color: #e4e4e4;
}

/* Segment 1: Rank Badge + Game Icon */
.page-index-popular-games__segment-1 {
  flex-direction: column;
  min-width: 120px;
  max-width: 150px;
  padding-left: 0;
  padding-right: 20px;
  justify-content: flex-start;
}

.page-index-popular-games__rank-badge {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 10px;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.page-index-popular-games__rank-1 {
  background: linear-gradient(135deg, #FFD700, #FFA500); /* Gold */
}

.page-index-popular-games__rank-2 {
  background: linear-gradient(135deg, #C0C0C0, #A0A0A0); /* Silver */
}

.page-index-popular-games__rank-3 {
  background: linear-gradient(135deg, #CD7F32, #B87333); /* Bronze */
}

.page-index-popular-games__rank-badge:not(.page-index-popular-games__rank-1):not(.page-index-popular-games__rank-2):not(.page-index-popular-games__rank-3) {
  background: linear-gradient(135deg, #ff6b35, #ff8c42); /* Orange for 4+ */
}

.page-index-popular-games__game-icon {
  max-width: 80px;
  height: auto;
  display: block;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Segment 2: Game Info */
.page-index-popular-games__segment-2 {
  flex: 1;
  flex-direction: column;
  text-align: center;
  justify-content: center;
  min-width: 200px;
}

.page-index-popular-games__game-name {
  font-size: 24px;
  font-weight: bold;
  color: #000000;
  margin: 0 0 8px 0;
  text-transform: uppercase;
  line-height: 1.2;
}

.page-index-popular-games__game-name-link {
  color: #000000;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-index-popular-games__game-name-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.page-index-popular-games__game-description {
  font-size: 14px;
  color: #000000;
  font-weight: bold;
  margin: 0;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.page-index-popular-games__game-description a {
  color: #0066cc;
  font-weight: bold;
  text-decoration: none;
}

.page-index-popular-games__game-description a:hover {
  color: #004499;
  text-decoration: underline;
}

/* Segment 3: Rating + Promotion Text */
.page-index-popular-games__segment-3 {
  flex-direction: column;
  min-width: 150px;
  max-width: 180px;
  text-align: center;
}

.page-index-popular-games__game-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.page-index-popular-games__stars {
  color: #FFD700;
  font-size: 18px;
  margin-right: 5px;
  font-weight: bold;
}

.page-index-popular-games__rating-number {
  font-size: 16px;
  font-weight: bold;
  color: #333333;
}

.page-index-popular-games__promotion-text {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.page-index-popular-games__promotion-link {
  color: #0066cc;
  font-size: 14px;
  text-decoration: none;
  font-weight: bold;
  margin-right: 5px;
  transition: color 0.3s ease;
}

.page-index-popular-games__promotion-link:hover {
  color: #004499;
  text-decoration: underline;
}

.page-index-popular-games__hot-badge {
  background: #e74c3c;
  color: #ffffff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 3px;
  font-weight: bold;
  flex-shrink: 0;
}

/* Segment 4: CTA Buttons */
.page-index-popular-games__segment-4 {
  flex-direction: column;
  min-width: 180px;
  max-width: 200px;
  gap: 10px;
  padding-right: 0;
  justify-content: center;
}

.page-index-popular-games__cta-button {
  display: block;
  width: 100%;
  padding: 12px 15px;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border: none;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Ensure long words break */
}

.page-index-popular-games__btn-download {
  background: var(--primary-color);
  color: #ffffff;
}

.page-index-popular-games__btn-download:hover {
  background: #071a47;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.page-index-popular-games__btn-review {
  background: var(--secondary-color);
  color: var(--primary-color);
}

.page-index-popular-games__btn-review:hover {
  background: #e0b800;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Brand Review Content Section */
.page-index-popular-games__review-content-section {
  padding: 40px 20px;
  background: #f1f3f5;
}

.page-index-popular-games__review-content-container {
  max-width: 1400px;
  margin: 0 auto;
}

.page-index-popular-games__review-content-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 40px;
}

.page-index-popular-games__review-title {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 24px;
  text-align: center;
}

.page-index-popular-games__review-subtitle {
  font-size: 20px;
  font-weight: bold;
  color: #333333;
  margin-top: 24px;
  margin-bottom: 12px;
}

.page-index-popular-games__review-body {
  color: #333333;
  line-height: 1.7;
}

.page-index-popular-games__review-body p {
  margin-bottom: 16px;
  font-size: 16px;
}

/* Homepage Intro Section */
.page-index-popular-games__intro-section {
  padding: 60px 20px;
  background: #ffffff;
}

.page-index-popular-games__container {
  max-width: 1200px;
  margin: 0 auto;
}

.page-index-popular-games__intro-title {
  font-size: 32px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 40px;
  text-align: center;
}

.page-index-popular-games__intro-content {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

.page-index-popular-games__intro-image {
  flex-shrink: 0;
  width: 400px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  object-fit: cover;
}

.page-index-popular-games__intro-text {
  flex-grow: 1;
  line-height: 1.7;
  color: #333333;
}

.page-index-popular-games__intro-text h3 {
  font-size: 22px;
  font-weight: bold;
  color: var(--primary-color);
  margin-top: 20px;
  margin-bottom: 10px;
}

.page-index-popular-games__intro-text p {
  margin-bottom: 15px;
}

/* Games Showcase Section */
.page-index-popular-games__games-showcase-section {
  padding: 60px 20px;
  background: #f1f3f5;
}

.page-index-popular-games__showcase-title {
  font-size: 32px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 40px;
  text-align: center;
}

.page-index-popular-games__games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.page-index-popular-games__game-type-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 25px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index-popular-games__game-type-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.page-index-popular-games__game-type-image {
  max-width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 20px;
  width: 100%;
}

.page-index-popular-games__game-type-title {
  font-size: 22px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.page-index-popular-games__game-type-description {
  font-size: 15px;
  color: #555555;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-index-popular-games__game-type-button {
  display: inline-block;
  padding: 10px 25px;
  background: var(--secondary-color);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  font-size: 15px;
  transition: all 0.3s ease;
}

.page-index-popular-games__game-type-button:hover {
  background: #e0b800;
  transform: translateY(-1px);
}

/* Promotions Section */
.page-index-popular-games__promotions-section {
  padding: 60px 20px;
  background: var(--primary-color);
  color: #ffffff;
}

.page-index-popular-games__promotions-title {
  font-size: 32px;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 40px;
  text-align: center;
}

.page-index-popular-games__promotions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.page-index-popular-games__promotion-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  padding: 25px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease, background 0.3s ease;
}

.page-index-popular-games__promotion-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.15);
}

.page-index-popular-games__promotion-image {
  max-width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 20px;
  width: 100%;
}

.page-index-popular-games__promotion-card-title {
  font-size: 22px;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 10px;
}

.page-index-popular-games__promotion-card-description {
  font-size: 15px;
  color: #f0f0f0;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-index-popular-games__promotion-button {
  display: inline-block;
  padding: 10px 25px;
  background: var(--secondary-color);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  font-size: 15px;
  transition: all 0.3s ease;
}

.page-index-popular-games__promotion-button:hover {
  background: #e0b800;
  transform: translateY(-1px);
}

/* Blog Section */
.page-index-popular-games__blog-section {
  padding: 60px 20px;
  background: #f1f3f5;
}

.page-index-popular-games__blog-title {
  font-size: 32px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 40px;
  text-align: center;
}

.page-index-popular-games__blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.page-index-popular-games__blog-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 25px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index-popular-games__blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.page-index-popular-games__blog-image {
  max-width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 20px;
  width: 100%;
}

.page-index-popular-games__blog-card-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 10px;
  line-height: 1.4;
}

.page-index-popular-games__blog-card-title a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-index-popular-games__blog-card-title a:hover {
  color: #071a47;
  text-decoration: underline;
}

.page-index-popular-games__blog-summary {
  font-size: 15px;
  color: #555555;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-index-popular-games__blog-readmore {
  display: inline-block;
  padding: 10px 25px;
  background: var(--primary-color);
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  font-size: 15px;
  transition: all 0.3s ease;
}

.page-index-popular-games__blog-readmore:hover {
  background: #071a47;
  transform: translateY(-1px);
}

.page-index-popular-games__keyword {
  color: var(--secondary-color);
  font-weight: bold;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-index-popular-games__hero-title {
    font-size: 40px;
  }

  .page-index-popular-games__hero-description {
    font-size: 18px;
  }

  .page-index-popular-games__page-title,
  .page-index-popular-games__intro-title,
  .page-index-popular-games__showcase-title,
  .page-index-popular-games__promotions-title,
  .page-index-popular-games__blog-title {
    font-size: 28px;
  }

  .page-index-popular-games__game-card {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  .page-index-popular-games__game-card-segment {
    width: 100%;
    padding: 10px 0;
  }
  
  .page-index-popular-games__game-card-segment:not(:first-child)::before {
    display: none;
  }

  .page-index-popular-games__segment-1 {
    flex-direction: row;
    gap: 15px;
    min-width: unset;
    max-width: unset;
    padding-right: 0;
    justify-content: center;
  }

  .page-index-popular-games__game-icon {
    max-width: 60px;
  }

  .page-index-popular-games__segment-2,
  .page-index-popular-games__segment-3,
  .page-index-popular-games__segment-4 {
    min-width: unset;
    max-width: unset;
    padding-left: 0;
    padding-right: 0;
    border-top: 1px solid #e4e4e4;
    margin-top: 10px;
    padding-top: 10px;
  }

  .page-index-popular-games__game-name {
    font-size: 20px;
  }

  .page-index-popular-games__game-description {
    font-size: 13px;
  }

  .page-index-popular-games__segment-4 {
    flex-direction: row;
    gap: 15px;
    justify-content: center;
  }

  .page-index-popular-games__cta-button {
    flex: 1;
    font-size: 14px;
    padding: 10px 10px;
  }

  .page-index-popular-games__intro-content {
    flex-direction: column;
    align-items: center;
  }

  .page-index-popular-games__intro-image {
    width: 100%;
    max-width: 600px;
    margin-bottom: 30px;
  }

  .page-index-popular-games__review-content-card {
    padding: 30px;
  }

  .page-index-popular-games__review-title {
    font-size: 24px;
  }

  .page-index-popular-games__review-subtitle {
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  .page-index-popular-games__hero-section {
    padding-top: 140px !important; /* Mobile: Adjust for fixed header */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .page-index-popular-games__hero-title {
    font-size: 32px;
  }

  .page-index-popular-games__hero-description {
    font-size: 16px;
  }

  .page-index-popular-games__cta-button {
    padding: 12px 30px;
    font-size: 16px;
  }

  .page-index-popular-games__game-leaderboard-section,
  .page-index-popular-games__review-content-section,
  .page-index-popular-games__intro-section,
  .page-index-popular-games__games-showcase-section,
  .page-index-popular-games__promotions-section,
  .page-index-popular-games__blog-section {
    padding: 30px 15px;
  }

  .page-index-popular-games__page-title,
  .page-index-popular-games__intro-title,
  .page-index-popular-games__showcase-title,
  .page-index-popular-games__promotions-title,
  .page-index-popular-games__blog-title {
    font-size: 24px;
    margin-bottom: 30px;
  }

  .page-index-popular-games__game-card {
    padding: 15px;
    flex-direction: column;
    align-items: center;
  }

  .page-index-popular-games__game-card-segment {
    width: 100%;
    padding: 10px 0;
  }
  
  .page-index-popular-games__segment-1 {
    flex-direction: row;
    gap: 15px;
    min-width: unset;
    max-width: unset;
    padding-right: 0;
    justify-content: center;
  }

  .page-index-popular-games__game-icon {
    max-width: 60px;
  }

  .page-index-popular-games__segment-2,
  .page-index-popular-games__segment-3,
  .page-index-popular-games__segment-4 {
    min-width: unset;
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 10px;
    padding-right: 10px;
    border-top: 1px solid #e4e4e4;
    margin-top: 10px;
    padding-top: 10px;
    box-sizing: border-box !important;
  }

  .page-index-popular-games__game-name {
    font-size: 18px;
  }

  .page-index-popular-games__game-description {
    font-size: 12px;
  }

  .page-index-popular-games__segment-4 {
    flex-direction: column;
    gap: 10px;
  }

  .page-index-popular-games__btn-download,
  .page-index-popular-games__btn-review {
    max-width: 100% !important;
    width: 100% !important;
    font-size: 12px !important;
    padding: 8px 12px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    min-width: auto !important;
  }

  .page-index-popular-games__intro-content {
    flex-direction: column;
  }

  .page-index-popular-games__intro-image {
    width: 100%;
    height: auto !important;
    max-width: 100% !important;
  }

  .page-index-popular-games__intro-text h3 {
    font-size: 20px;
  }

  .page-index-popular-games__games-grid,
  .page-index-popular-games__promotions-grid,
  .page-index-popular-games__blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-index-popular-games__game-type-image,
  .page-index-popular-games__promotion-image,
  .page-index-popular-games__blog-image {
    height: 150px;
  }

  .page-index-popular-games__review-content-card {
    padding: 24px 20px;
  }
  
  .page-index-popular-games__review-title {
    font-size: 20px;
  }
  
  .page-index-popular-games__review-subtitle {
    font-size: 16px;
  }
  
  .page-index-popular-games__review-body p {
    font-size: 15px;
  }

  .page-index-popular-games img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-index-popular-games__section,
  .page-index-popular-games__card,
  .page-index-popular-games__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Contrast Fixes */
.page-index-popular-games__dark-section {
  background: var(--primary-color);
  color: #ffffff; /* Forced white text */
}

.page-index-popular-games__text-contrast-fix {
  color: #333333 !important;
  text-shadow: none !important;
}