/* style/index.css */

/* Custom CSS Variables for 88win */
:root {
  --primary-color: #FFD700; /* Gold */
  --secondary-color: #8B0000; /* Dark Red / Maroon */
  --text-color-dark: #333333;
  --text-color-light: #ffffff;
  --background-light: #f8f8f8; /* Body background from shared.css */
  --border-color: #e0e0e0;
}

/* Base styles for the page content, ensuring contrast with body background */
.page-index {
  font-family: 'Arial', sans-serif;
  color: var(--text-color-dark); /* Default text color for light background body */
  line-height: 1.6;
  background-color: var(--background-light); /* Ensure consistency with body bg */
}

.page-index__section {
  padding: 60px 0;
  margin: 0 auto;
  position: relative;
}

.page-index__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-index__section-title {
  font-size: 36px;
  font-weight: bold;
  color: var(--secondary-color);
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 15px;
}

.page-index__section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

.page-index__section-title--light {
  color: var(--text-color-light);
}

.page-index__section-title--light::after {
  background-color: var(--text-color-light);
}

/* HERO Section */
.page-index__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0; /* Will be set by padding-top */
  overflow: hidden;
  /* Fixed header spacing: Apply padding-top to the first content section */
  padding-top: var(--header-offset, 120px);
}

.page-index__hero-container {
  position: relative;
  width: 100%;
  max-width: 100%; /* Ensure it takes full width */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-color-light); /* Text on hero image */
}

.page-index__hero-image {
  width: 100%;
  height: auto;
  line-height: 0; /* Remove extra space below img */
}

.page-index__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: cover;
}

.page-index__hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  text-align: center;
  width: 90%;
  max-width: 800px;
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.4); /* Dark overlay for text readability */
  border-radius: 10px;
}

.page-index__hero-title {
  font-size: 52px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--primary-color); /* Gold title for impact */
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  line-height: 1.2;
}

.page-index__hero-description {
  font-size: 20px;
  margin-bottom: 30px;
  color: var(--text-color-light);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.page-index__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--primary-color);
  color: var(--text-color-light);
  text-decoration: none;
  border-radius: 50px;
  font-size: 20px;
  font-weight: bold;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.page-index__cta-button:hover {
  background: var(--secondary-color);
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.page-index__cta-button--small {
  font-size: 16px;
  padding: 12px 30px;
  border-radius: 30px;
}

/* Module 1: Intro Section */
.page-index__intro-section {
  background-color: var(--background-light);
}

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

.page-index__intro-item {
  background: #ffffff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__intro-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.page-index__intro-item img {
  width: 100%;
  max-width: 300px;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
  min-width: 200px; /* Enforce min size */
  min-height: 200px; /* Enforce min size */
}

.page-index__intro-heading {
  font-size: 24px;
  color: var(--secondary-color);
  margin-bottom: 15px;
  font-weight: 600;
}

.page-index__intro-text {
  font-size: 16px;
  color: var(--text-color-dark);
  line-height: 1.6;
}

.page-index__intro-summary {
  text-align: center;
  margin-top: 40px;
  font-size: 18px;
  font-style: italic;
  color: #555555;
}

/* Module 2: Quick Access Section */
.page-index__dark-section {
  background: linear-gradient(90deg, var(--secondary-color), #a00000);
  color: var(--text-color-light);
  padding: 40px 0;
}

.page-index__button-group {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.page-index__btn-primary,
.page-index__btn-secondary {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 50px;
  font-size: 18px;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
  text-align: center;
  box-sizing: border-box; /* Ensure padding doesn't push width */
  max-width: 100%; /* Ensure button doesn't overflow */
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Allow long words to break */
}

.page-index__btn-primary {
  background: var(--primary-color);
  color: var(--text-color-light);
  border: 2px solid var(--primary-color);
}

.page-index__btn-primary:hover {
  background: var(--text-color-light);
  color: var(--secondary-color);
  border-color: var(--text-color-light);
}

.page-index__btn-secondary {
  background: transparent;
  color: var(--text-color-light);
  border: 2px solid var(--text-color-light);
}

.page-index__btn-secondary:hover {
  background: var(--primary-color);
  color: var(--text-color-light);
  border-color: var(--primary-color);
}

/* Module 3: Games Section */
.page-index__games-section {
  background-color: #ffffff;
}

.page-index__game-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
}

.page-index__game-card {
  background: var(--background-light);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.page-index__game-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.page-index__game-card img {
  width: 100%;
  height: 250px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border-color);
  min-width: 200px; /* Enforce min size */
  min-height: 200px; /* Enforce min size */
}

.page-index__game-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--secondary-color);
  padding: 20px 20px 10px;
}

.page-index__game-description {
  font-size: 15px;
  color: #555555;
  padding: 0 20px 20px;
}

/* Module 4: Promotions Section */
.page-index__promotions-section {
  background-color: var(--background-light);
}

.page-index__promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.page-index__promo-card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  text-align: center;
  padding-bottom: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__promo-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.page-index__promo-card img {
  width: 100%;
  height: 200px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
  margin-bottom: 20px;
  min-width: 200px; /* Enforce min size */
  min-height: 200px; /* Enforce min size */
}

.page-index__promo-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 10px;
  padding: 0 15px;
}

.page-index__promo-description {
  font-size: 15px;
  color: #555555;
  margin-bottom: 20px;
  padding: 0 15px;
}

/* Module 5: Security & Support Section */
.page-index__security-support-section {
  background-color: #ffffff;
}

.page-index__security-support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.page-index__security-item {
  background: var(--background-light);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.page-index__security-item img {
  width: 100%;
  
  height: auto;
  object-fit: contain;
  margin-bottom: 20px;
  min-width: 200px; /* Enforce min size */
  min-height: 200px; /* Enforce min size */
}

.page-index__security-heading {
  font-size: 22px;
  color: var(--secondary-color);
  margin-bottom: 10px;
  font-weight: 600;
}

.page-index__security-text {
  font-size: 15px;
  color: #555555;
}

.page-index__contact-cta {
  text-align: center;
  padding: 30px;
  background-color: var(--primary-color);
  border-radius: 10px;
  color: var(--text-color-light);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.page-index__contact-text {
  font-size: 20px;
  margin-bottom: 25px;
  font-weight: 500;
}

/* Module 6: FAQ Section */
.page-index__faq-section {
  background-color: var(--background-light);
}

.page-index__faq-list {
  max-width: 900px;
  margin: 0 auto;
}

.page-index__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.page-index__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-index__faq-question:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

.page-index__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-color-dark);
  pointer-events: none; /* Prevent h3 from blocking click event */
}

.page-index__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: var(--secondary-color);
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Prevent icon from blocking click event */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}

.page-index__faq-item.active .page-index__faq-toggle {
  color: var(--primary-color);
  transform: rotate(45deg); /* Change to X shape */
}

.page-index__faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease, opacity 0.4s ease;
  padding: 0 25px;
  opacity: 0;
  background: #fefefe;
  border-top: none;
  border-radius: 0 0 8px 8px;
}

/* FAQ展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.page-index__faq-item.active .page-index__faq-answer {
  max-height: 2000px !important; /* 🚨 Ensure it can expand fully */
  padding: 20px 25px !important;
  opacity: 1;
  border: 1px solid var(--border-color);
  border-top: none;
}

.page-index__faq-answer p {
  margin: 0;
  font-size: 16px;
  color: #555555;
  line-height: 1.7;
}

/* Module 7: News Section */
.page-index__news-section {
  background-color: #ffffff;
}

.page-index__news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}

.page-index__news-card {
  background: var(--background-light);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.page-index__news-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.page-index__news-card img {
  width: 100%;
  height: 220px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border-color);
  min-width: 200px; /* Enforce min size */
  min-height: 200px; /* Enforce min size */
}

.page-index__news-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--secondary-color);
  padding: 20px 20px 10px;
}

.page-index__news-excerpt {
  font-size: 15px;
  color: #555555;
  padding: 0 20px;
  margin-bottom: 15px;
}

.page-index__news-date {
  display: block;
  font-size: 13px;
  color: #888888;
  padding: 0 20px 20px;
}

.page-index__view-all-news {
  text-align: center;
  margin-top: 50px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-index__hero-title {
    font-size: 44px;
  }
  .page-index__hero-description {
    font-size: 18px;
  }
  .page-index__section-title {
    font-size: 32px;
  }
  .page-index__game-categories {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  /* 🚨 Mobile Hero Section Padding */
  .page-index__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Ensure header offset is applied */
  }

  .page-index__hero-content {
    width: 95%;
    padding: 15px;
  }

  .page-index__hero-title {
    font-size: 32px;
    margin-bottom: 15px;
  }

  .page-index__hero-description {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .page-index__cta-button {
    padding: 12px 30px;
    font-size: 18px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-index__section {
    padding: 40px 0;
  }

  .page-index__container {
    padding: 0 15px; /* Add horizontal padding for mobile content */
  }

  .page-index__section-title {
    font-size: 28px;
    margin-bottom: 30px;
  }

  /* 🚨 Mobile Image Responsiveness */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }

  /* 🚨 Mobile Container Responsiveness */
  .page-index__intro-section .page-index__container,
  .page-index__quick-access-section .page-index__container,
  .page-index__games-section .page-index__container,
  .page-index__promotions-section .page-index__container,
  .page-index__security-support-section .page-index__container,
  .page-index__faq-section .page-index__container,
  .page-index__news-section .page-index__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-index__intro-grid,
  .page-index__game-categories,
  .page-index__promo-grid,
  .page-index__security-support-grid,
  .page-index__news-grid {
    grid-template-columns: 1fr; /* Single column layout */
    gap: 20px;
  }

  .page-index__intro-item img,
  .page-index__game-card img,
  .page-index__promo-card img,
  .page-index__security-item img,
  .page-index__news-card img {
    height: auto; /* Allow height to adjust naturally */
    min-width: 200px; /* Enforce min size */
    min-height: 200px; /* Enforce min size */
  }

  /* 🚨 Mobile Button Responsiveness */
  .page-index__button-group {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
  }

  .page-index__btn-primary,
  .page-index__btn-secondary {
    max-width: 100% !important;
    width: 100% !important;
    padding: 12px 20px;
    font-size: 16px;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* FAQ Mobile adjustments */
  .page-index__faq-question {
    padding: 15px 20px;
  }
}