/* style/index.css */

/* Base Styles for .page-index */
.page-index {
  font-family: 'Arial', sans-serif;
  color: #ffffff; /* Light text for dark body background #1a1a2e */
  background-color: #1a1a2e;
  line-height: 1.6;
  padding-bottom: 60px; /* Ensure space before footer */
}

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

.page-index__heading {
  font-size: 38px;
  font-weight: 700;
  color: #FFFFFF;
  text-align: center;
  margin-bottom: 30px;
  line-height: 1.2;
}

.page-index__paragraph {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 25px;
  text-align: center;
  color: #f0f0f0;
}

.page-index__button-group {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.page-index__button-group--center {
  justify-content: center;
}

.page-index__btn-primary,
.page-index__btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 30px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: center;
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-primary {
  background-color: #C30808; /* Register/Login color */
  color: #FFFF00; /* Register/Login font color */
  border: 2px solid #C30808;
}

.page-index__btn-primary:hover {
  background-color: #a00606;
  border-color: #a00606;
  transform: translateY(-2px);
}

.page-index__btn-secondary {
  background-color: transparent;
  color: #017439;
  border: 2px solid #017439;
}

.page-index__btn-secondary:hover {
  background-color: #017439;
  color: #FFFFFF;
  transform: translateY(-2px);
}

.page-index__dark-bg {
  background-color: #0d0d0d;
  color: #ffffff;
}

/* HERO Section */
.page-index__hero-section {
  position: relative;
  padding-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0; /* Assuming shared.css handles body padding-top */
  margin-top: 0;
  width: 100%;
  overflow: hidden;
}

.page-index__hero-container {
  position: relative;
  margin: 0 auto;
  width: 100%;
}

.page-index__hero-image {
  width: 100%;
  margin: 0;
}

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

/* Product Showcase Section */
.page-index__products-section {
  width: 100%;
  padding: 60px 20px;
  background: #1a1a2e;
  box-sizing: border-box;
}

.page-index__products-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 4fr 2fr;
  gap: 20px;
}

.page-index__products-grid {
  display: grid;
  gap: 20px;
}

.page-index__products-grid--small {
  grid-template-columns: repeat(4, 1fr);
}

.page-index__products-grid--large {
  grid-template-columns: repeat(2, 1fr);
}

.page-index__product-card {
  width: 100%;
  max-width: 300px; /* Max width for each card */
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  transition: transform 0.3s ease;
}

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

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

.page-index__product-card-image {
  width: 100%;
  max-width: 300px;
  overflow: hidden;
}

.page-index__product-card-image img {
  max-width: 100%;
  width: 100%;
  height: auto; /* Preserve aspect ratio */
  display: block;
}

/* Intro Section */
.page-index__intro-section {
  padding: 80px 0;
  text-align: center;
}

/* Quick Links Section */
.page-index__quick-links-section {
  padding: 60px 0;
  background-color: #1a1a2e;
  text-align: center;
}

.page-index__links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.page-index__quick-link-item {
  display: block;
  padding: 15px 20px;
  background-color: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.3s ease;
  text-align: center;
  box-sizing: border-box;
}

.page-index__quick-link-item:hover {
  background-color: #017439;
  transform: translateY(-3px);
}

/* Core Games Section */
.page-index__core-games-section {
  padding: 80px 0;
  text-align: center;
}

.page-index__game-category {
  margin-bottom: 60px;
  text-align: left;
}

.page-index__game-category-title {
  font-size: 32px;
  color: #FFFFFF;
  margin-bottom: 25px;
  text-align: center;
}

.page-index__game-category-content {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: center;
}

.page-index__game-category-content--reverse {
  flex-direction: row-reverse;
}

.page-index__game-category-image {
  flex: 1;
  min-width: 300px;
  max-width: 550px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  max-height: 400px; /* Constrain image height */
  object-fit: cover;
}

.page-index__game-category-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.page-index__game-category-text {
  flex: 1;
  min-width: 300px;
  max-width: 550px;
  color: #f0f0f0;
}

.page-index__game-category-text .page-index__btn-secondary {
  margin-top: 20px;
}

/* Promotions Section */
.page-index__promotions-section {
  padding: 80px 0;
  background-color: #1a1a2e;
  text-align: center;
}

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

.page-index__promotion-card {
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  padding-bottom: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-index__promotion-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
}

.page-index__promotion-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  margin-bottom: 15px;
}

.page-index__promotion-card-title {
  font-size: 22px;
  color: #FFFFFF;
  margin-bottom: 10px;
  padding: 0 15px;
  text-align: center;
}

.page-index__promotion-card-description {
  font-size: 15px;
  color: #f0f0f0;
  padding: 0 15px;
  margin-bottom: 20px;
  text-align: center;
  flex-grow: 1;
}

.page-index__promotion-card .page-index__btn-primary {
  margin-top: auto; /* Pushes button to the bottom */
}

/* Security Section */
.page-index__security-section {
  padding: 80px 0;
  text-align: center;
}

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

.page-index__feature-item {
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.page-index__feature-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  filter: brightness(1.2); /* Allowed for icons if needed for visibility on dark background, but not color change */
  min-width: 80px;
  min-height: 80px;
}

.page-index__feature-title {
  font-size: 22px;
  color: #FFFFFF;
  margin-bottom: 10px;
}

.page-index__feature-description {
  font-size: 15px;
  color: #f0f0f0;
}

/* FAQ Section */
.page-index__faq-section {
  padding: 80px 0;
  background-color: #1a1a2e;
}

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

.page-index__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  background: #017439; /* Brand color for question background */
  color: #FFFFFF;
  border: 1px solid #017439;
  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: #005f2e;
  border-color: #005f2e;
}

.page-index__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none;
}

.page-index__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: #FFFFFF;
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}

.page-index__faq-item.active .page-index__faq-toggle {
  transform: rotate(45deg);
  color: #FFFF00; /* Highlight toggle when active */
}

.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: #2a2a44;
  color: #f0f0f0;
  border-radius: 0 0 8px 8px;
}

.page-index__faq-item.active .page-index__faq-answer {
  max-height: 2000px !important;
  padding: 20px 25px !important;
  opacity: 1;
}

/* Blog Section */
.page-index__blog-section {
  padding: 80px 0;
  text-align: center;
}

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

.page-index__blog-card {
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
}

.page-index__blog-card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.page-index__blog-card-content {
  padding: 20px;
}

.page-index__blog-card-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4;
}

.page-index__blog-card-title a {
  color: #FFFFFF;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-index__blog-card-title a:hover {
  color: #FFFF00; /* Highlight on hover */
}

.page-index__blog-card-description {
  font-size: 15px;
  color: #f0f0f0;
  margin-bottom: 15px;
  text-align: left;
}

.page-index__blog-card-date {
  font-size: 13px;
  color: #aaaaaa;
  display: block;
  text-align: left;
}

/* --- Media Queries --- */

@media (max-width: 1024px) {
  .page-index__heading {
    font-size: 32px;
  }

  .page-index__paragraph {
    font-size: 16px;
  }

  .page-index__products-container {
    grid-template-columns: 1fr; /* Stack product grids */
  }

  .page-index__products-grid--small {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-index__products-grid--large {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-index__game-category-content {
    flex-direction: column;
    gap: 25px;
  }

  .page-index__game-category-content--reverse {
    flex-direction: column;
  }

  .page-index__game-category-image,
  .page-index__game-category-text {
    max-width: 100%;
  }

  .page-index__promotion-grid,
  .page-index__blog-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .page-index__security-features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* General Mobile Styles */
  .page-index {
    font-size: 16px;
    line-height: 1.6;
    padding-bottom: 40px;
  }

  .page-index__container,
  .page-index__intro-section,
  .page-index__quick-links-section,
  .page-index__core-games-section,
  .page-index__promotions-section,
  .page-index__security-section,
  .page-index__faq-section,
  .page-index__blog-section {
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 40px;
    padding-bottom: 40px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important; /* Prevent horizontal scroll */
  }

  .page-index__heading {
    font-size: 28px;
    margin-bottom: 20px;
  }

  .page-index__paragraph {
    font-size: 15px;
    margin-bottom: 20px;
  }

  /* HERO Section Mobile */
  .page-index__hero-section {
    padding-top: 0 !important; /* Ensure no double padding if shared.css handles body */
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .page-index__hero-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Product Showcase Section Mobile */
  .page-index__products-section {
    padding: 30px 15px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .page-index__products-container {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .page-index__products-grid--small {
    grid-template-columns: repeat(2, 1fr) !important; /* 2x2 grid */
    gap: 15px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-index__products-grid--small .page-index__product-card,
  .page-index__products-grid--small .page-index__product-card-image {
    max-width: 100% !important; /* Allow cards to fill grid cell */
    width: 100% !important;
  }
  
  .page-index__products-grid--small .page-index__product-card-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-index__products-grid--large {
    grid-template-columns: 1fr !important; /* Each large card takes full width */
    gap: 15px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-index__products-grid--large .page-index__product-card,
  .page-index__products-grid--large .page-index__product-card-image {
    max-width: 100% !important;
    width: 100% !important;
  }

  .page-index__products-grid--large .page-index__product-card-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Buttons Mobile */
  .page-index__button-group {
    flex-direction: column !important; /* Stack buttons vertically */
    gap: 15px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-index__btn-primary,
  .page-index__btn-secondary,
  .page-index a[class*="button"],
  .page-index a[class*="btn"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  /* Quick Links Mobile */
  .page-index__links-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }

  .page-index__quick-link-item {
    font-size: 16px;
    padding: 12px 15px;
  }

  /* Core Games Mobile */
  .page-index__game-category-title {
    font-size: 26px;
  }

  .page-index__game-category-content {
    gap: 20px;
  }

  .page-index__game-category-image {
    min-width: unset;
    height: 250px;
  }

  /* Promotions Mobile */
  .page-index__promotion-grid {
    grid-template-columns: 1fr !important;
  }

  .page-index__promotion-card-image {
    height: 180px;
  }

  .page-index__promotion-card-title {
    font-size: 20px;
  }

  /* Security Features Mobile */
  .page-index__security-features {
    grid-template-columns: 1fr !important;
  }

  .page-index__feature-icon {
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
  }

  .page-index__feature-title {
    font-size: 20px;
  }

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

  .page-index__faq-question h3 {
    font-size: 16px;
  }

  .page-index__faq-toggle {
    font-size: 24px;
    width: 25px;
    height: 25px;
  }

  .page-index__faq-item.active .page-index__faq-answer {
    padding: 15px 18px !important;
  }

  /* Blog Section Mobile */
  .page-index__blog-grid {
    grid-template-columns: 1fr !important;
  }

  .page-index__blog-card-image {
    height: 180px;
  }

  .page-index__blog-card-title {
    font-size: 18px;
  }

  /* Universal Image Responsiveness for content area */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
}

/* Global image constraints for content area (not header/footer) */
.page-index img {
  min-width: 200px; /* Enforce minimum size for all content images */
  min-height: 200px;
  object-fit: cover; /* Default to cover for better layout, can be overridden */
}

/* Override for specific elements if they need different object-fit */
.page-index__product-card-image img {
  object-fit: contain; /* Products should show full image */
  min-width: unset; /* Allow smaller images in grid if they fit */
  min-height: unset;
}

.page-index__feature-icon {
  object-fit: contain; /* Icons usually need to be contained */
}

.page-index__hero-image img {
  min-width: unset;
  min-height: unset;
}