/* 🚨 style/index.css */

/* ========================================================================== */
/* 🚨 Tổng quan và Reset cơ bản */
/* ========================================================================== */
.page-index {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #ffffff; /* Body background #121212 là tối, nên dùng chữ trắng */
  background-color: transparent; /* Main content sẽ có nền riêng hoặc trong suốt */
}

/* ========================================================================== */
/* 🚨 Tiêu đề và Mô tả chung */
/* ========================================================================== */
.page-index__main-title {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 20px;
  text-align: center;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-index__section-title {
  font-size: 2.2em;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  margin-bottom: 20px;
}

.page-index__section-description {
  font-size: 1.1em;
  color: #f0f0f0;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px;
}

.page-index__note {
  font-size: 0.9em;
  color: #cccccc;
  text-align: center;
  margin-top: 30px;
}

/* ========================================================================== */
/* 🚨 Container và Căn chỉnh */
/* ========================================================================== */
.page-index__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
}

/* ========================================================================== */
/* 🚨 Nút và CTA */
/* ========================================================================== */
.page-index__btn-primary,
.page-index__btn-secondary,
.page-index__btn-tertiary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05em;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  text-align: center;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-primary {
  background-color: #C30808; /* Màu đăng ký/đăng nhập */
  color: #FFFF00; /* Màu chữ đăng ký/đăng nhập */
  border: 2px solid #C30808;
}

.page-index__btn-primary:hover {
  background-color: #e02020;
  border-color: #e02020;
  color: #ffffff;
}

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

.page-index__btn-secondary:hover {
  background-color: #02944b;
  border-color: #02944b;
}

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

.page-index__btn-tertiary:hover {
  background-color: #017439;
  color: #FFFFFF;
}

.page-index__button-group {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.page-index__button-group .page-index__btn-primary,
.page-index__button-group .page-index__btn-secondary,
.page-index__button-group .page-index__btn-tertiary {
  flex-grow: 1;
  flex-basis: auto;
  min-width: 180px;
}

.page-index__contact-cta {
  text-align: center;
  margin-top: 60px;
  padding: 30px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.page-index__contact-cta p {
  font-size: 1.2em;
  margin-bottom: 20px;
  color: #f0f0f0;
}

/* ========================================================================== */
/* 🚨 HERO 主图区域 */
/* ========================================================================== */
.page-index__hero-section {
  position: relative;
  padding-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 10px; /* shared đã cho body padding-top, nên chỉ cần 10px */
  margin-top: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

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

.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;
}

/* ========================================================================== */
/* 🚨 Sản phẩm trưng bày (Product Display) */
/* ========================================================================== */
.page-index__products-section {
  width: 100%;
  padding: 60px 20px;
  background: #1a1a1a; /* Nền tối cho phần sản phẩm */
  box-sizing: border-box;
}

.page-index__products-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 4fr 2fr; /* 4 sản phẩm đầu chiếm 4 phần, 2 sản phẩm sau chiếm 2 phần */
  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; /* 🚨 Tối đa 300px */
  border-radius: 0; /* Không bo tròn */
  overflow: hidden;
  background: transparent;
  box-shadow: none; /* Không đổ bóng */
  transition: transform 0.3s ease;
  margin: 0 auto; /* Căn giữa card trong ô grid */
}

.page-index__product-card:hover {
  transform: translateY(-5px); /* Chỉ cho phép dịch chuyển nhẹ */
}

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

.page-index__product-card-image {
  width: 100%;
  max-width: 300px; /* 🚨 Tối đa 300px */
  overflow: hidden;
}

.page-index__product-card-image img {
  max-width: 100%;
  width: 100%;
  height: auto; /* 🚨 Giữ tỷ lệ khung hình gốc */
  display: block;
}

/* ========================================================================== */
/* 🚨 Giới thiệu trang chủ (Intro Section) */
/* ========================================================================== */
.page-index__intro-section {
  padding: 80px 20px;
  background-color: #017439; /* Nền màu chủ đạo */
  color: #ffffff;
  text-align: center;
  box-sizing: border-box;
}

.page-index__intro-section .page-index__main-title {
  color: #ffffff;
  margin-bottom: 25px;
}

.page-index__intro-section .page-index__intro-description {
  font-size: 1.15em;
  max-width: 900px;
  margin: 0 auto 50px;
  line-height: 1.8;
}

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

.page-index__feature-item {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  transition: transform 0.3s ease;
}

.page-index__feature-item:hover {
  transform: translateY(-10px);
}

.page-index__feature-item img {
  width: 100%;
  max-width: 250px;
  height: auto;
  margin-bottom: 20px;
  border-radius: 8px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.page-index__feature-item h3 {
  font-size: 1.4em;
  color: #FFFF00;
  margin-bottom: 15px;
}

.page-index__feature-item p {
  font-size: 0.95em;
  color: #f0f0f0;
}

/* ========================================================================== */
/* 🚨 Liên kết nhanh (Quick Links Section) */
/* ========================================================================== */
.page-index__quick-links-section {
  padding: 80px 20px;
  background-color: #121212; /* Nền tối */
  color: #ffffff;
  text-align: center;
  box-sizing: border-box;
}

.page-index__quick-links-section .page-index__section-title {
  color: #ffffff;
}

.page-index__quick-links-section .page-index__section-description {
  color: #f0f0f0;
}

/* ========================================================================== */
/* 🚨 Giới thiệu trò chơi (Games Section) */
/* ========================================================================== */
.page-index__games-section {
  padding: 80px 20px;
  background-color: #017439; /* Nền màu chủ đạo */
  color: #ffffff;
  box-sizing: border-box;
}

.page-index__games-section .page-index__section-title {
  color: #ffffff;
}

.page-index__games-section .page-index__section-description {
  color: #f0f0f0;
}

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

.page-index__game-card {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  transition: transform 0.3s ease;
}

.page-index__game-card:hover {
  transform: translateY(-10px);
}

.page-index__game-card img {
  width: 100%;
  max-width: 350px;
  height: auto;
  margin-bottom: 20px;
  border-radius: 8px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.page-index__game-card h3 {
  font-size: 1.5em;
  color: #FFFF00;
  margin-bottom: 15px;
}

.page-index__game-card p {
  font-size: 0.95em;
  color: #f0f0f0;
  margin-bottom: 20px;
}

/* ========================================================================== */
/* 🚨 Ưu đãi & Khuyến mãi (Promotions Section) */
/* ========================================================================== */
.page-index__promotions-section {
  padding: 80px 20px;
  background-color: #121212; /* Nền tối */
  color: #ffffff;
  box-sizing: border-box;
}

.page-index__promotions-section .page-index__section-title {
  color: #ffffff;
}

.page-index__promotions-section .page-index__section-description {
  color: #f0f0f0;
}

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

.page-index__promo-card {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  transition: transform 0.3s ease;
}

.page-index__promo-card:hover {
  transform: translateY(-10px);
}

.page-index__promo-card img {
  width: 100%;
  max-width: 500px;
  height: auto;
  margin-bottom: 20px;
  border-radius: 8px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.page-index__promo-card h3 {
  font-size: 1.4em;
  color: #FFFF00;
  margin-bottom: 15px;
}

.page-index__promo-card p {
  font-size: 0.95em;
  color: #f0f0f0;
  margin-bottom: 20px;
}

/* ========================================================================== */
/* 🚨 An toàn & Hỗ trợ (Security & Support Section) */
/* ========================================================================== */
.page-index__security-support-section {
  padding: 80px 20px;
  background-color: #017439; /* Nền màu chủ đạo */
  color: #ffffff;
  box-sizing: border-box;
}

.page-index__security-support-section .page-index__section-title {
  color: #ffffff;
}

.page-index__security-support-section .page-index__section-description {
  color: #f0f0f0;
}

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

.page-index__security-item {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 10px;
  text-align: center;
}

.page-index__security-item img {
  width: 100%;
  max-width: 250px;
  height: auto;
  margin-bottom: 20px;
  border-radius: 8px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.page-index__security-item h3 {
  font-size: 1.4em;
  color: #FFFF00;
  margin-bottom: 15px;
}

.page-index__security-item p {
  font-size: 0.95em;
  color: #f0f0f0;
}

/* ========================================================================== */
/* 🚨 Câu hỏi thường gặp (FAQ Section) */
/* ========================================================================== */
.page-index__faq-section {
  padding: 80px 20px;
  background-color: #121212; /* Nền tối */
  color: #ffffff;
  box-sizing: border-box;
}

.page-index__faq-section .page-index__section-title {
  color: #ffffff;
}

.page-index__faq-section .page-index__section-description {
  color: #f0f0f0;
}

.page-index__faq-list {
  margin-top: 50px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

details.page-index__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

details.page-index__faq-item summary.page-index__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background-color 0.3s ease;
}

details.page-index__faq-item summary.page-index__faq-question::-webkit-details-marker {
  display: none;
}

details.page-index__faq-item summary.page-index__faq-question:hover {
  background: rgba(255, 255, 255, 0.1);
}

.page-index__faq-qtext {
  flex: 1;
  font-size: 1.1em;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: #ffffff;
}

.page-index__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  color: #FFFF00;
  flex-shrink: 0;
  margin-left: 15px;
  width: 28px;
  text-align: center;
}

details.page-index__faq-item .page-index__faq-answer {
  padding: 0 20px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 0 8px 8px;
  color: #f0f0f0;
}

/* ========================================================================== */
/* 🚨 Blog mới nhất (Blog Section) */
/* ========================================================================== */
.page-index__blog-section {
  padding: 80px 20px;
  background-color: #017439; /* Nền màu chủ đạo */
  color: #ffffff;
  box-sizing: border-box;
}

.page-index__blog-section .page-index__section-title {
  color: #ffffff;
}

.page-index__blog-section .page-index__section-description {
  color: #f0f0f0;
}

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

.page-index__blog-card {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 25px;
  border-radius: 10px;
  transition: transform 0.3s ease;
}

.page-index__blog-card:hover {
  transform: translateY(-10px);
}

.page-index__blog-card img {
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 20px;
  display: block;
}

.page-index__blog-card h3 {
  font-size: 1.3em;
  margin-bottom: 10px;
}

.page-index__blog-card h3 a {
  color: #FFFF00; /* Tiêu đề blog màu vàng */
  text-decoration: none;
}

.page-index__blog-card h3 a:hover {
  text-decoration: underline;
}

.page-index__blog-card p {
  font-size: 0.9em;
  color: #cccccc;
  margin-bottom: 10px;
}

.page-index__read-more {
  display: inline-block;
  margin-top: 15px;
  color: #FFFF00;
  text-decoration: none;
  font-weight: 600;
}

.page-index__read-more:hover {
  text-decoration: underline;
}

.page-index__view-all-posts {
  text-align: center;
  margin-top: 60px;
}

/* ========================================================================== */
/* 🚨 CSS chung cho hình ảnh (General Image CSS) */
/* ========================================================================== */
.page-index img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========================================================================== */
/* 🚨 Responsive Mobile (max-width: 768px) */
/* ========================================================================== */
@media (max-width: 768px) {
  .page-index {
    font-size: 15px;
  }

  .page-index__container {
    padding: 30px 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .page-index__main-title {
    font-size: 1.8em;
    margin-bottom: 15px;
  }

  .page-index__section-title {
    font-size: 1.6em;
    margin-bottom: 15px;
  }

  .page-index__section-description {
    font-size: 1em;
    margin-bottom: 30px;
  }

  /* HERO 主图区域 */
  .page-index__hero-section {
    padding-top: 10px !important; /* Luôn giữ 10px, không dùng var */
    padding-left: 0;
    padding-right: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

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

  /* Sản phẩm trưng bày */
  .page-index__products-section {
    padding: 40px 15px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .page-index__products-container {
    grid-template-columns: 1fr; /* Stack grids vertically */
    gap: 15px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  
  .page-index__products-grid--small {
    grid-template-columns: repeat(2, 1fr); /* 4 sản phẩm thành 2x2 */
    gap: 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .page-index__products-grid--large {
    grid-template-columns: 1fr; /* 2 sản phẩm mỗi cái một hàng */
    gap: 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .page-index__product-card {
    max-width: 100%; /* Đảm bảo card không vượt quá 100% của cột grid */
  }

  .page-index__product-card-image {
    max-width: 100%;
  }

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

  /* General Images and Containers */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-index__intro-section,
  .page-index__quick-links-section,
  .page-index__games-section,
  .page-index__promotions-section,
  .page-index__security-support-section,
  .page-index__faq-section,
  .page-index__blog-section {
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* Buttons and Button Containers */
  .page-index__btn-primary,
  .page-index__btn-secondary,
  .page-index__btn-tertiary,
  .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;
    padding-right: 15px;
  }

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

  .page-index__contact-cta .page-index__btn-primary {
    width: auto !important; /* Cho phép nút tự điều chỉnh chiều rộng trong CTA */
    max-width: 100% !important;
    min-width: unset;
  }

  /* Other Content Modules (Intro, FAQ, Blog, etc.) */
  .page-index__intro-features,
  .page-index__game-categories,
  .page-index__promotions-grid,
  .page-index__security-grid,
  .page-index__blog-grid {
    grid-template-columns: 1fr; /* Stack items vertically */
    gap: 20px;
  }

  .page-index__feature-item,
  .page-index__game-card,
  .page-index__promo-card,
  .page-index__security-item,
  .page-index__blog-card {
    padding: 20px;
  }

  .page-index__feature-item img,
  .page-index__game-card img,
  .page-index__promo-card img,
  .page-index__security-item img,
  .page-index__blog-card img {
    max-width: 100%;
    width: 100%;
  }

  details.page-index__faq-item summary.page-index__faq-question {
    padding: 15px;
  }

  .page-index__faq-qtext {
    font-size: 1em;
  }

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

  details.page-index__faq-item .page-index__faq-answer {
    padding: 0 15px 15px;
  }
}

/* ========================================================================== */
/* 🚨 Responsive Tablet (max-width: 1024px) */
/* ========================================================================== */
@media (max-width: 1024px) {
  .page-index__container {
    padding: 40px 30px;
  }

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

  .page-index__products-grid--small {
    grid-template-columns: repeat(2, 1fr); /* 4 sản phẩm thành 2x2 */
  }

  .page-index__products-grid--large {
    grid-template-columns: repeat(2, 1fr); /* 2 sản phẩm vẫn 1x2 */
  }

  .page-index__button-group {
    gap: 10px;
  }

  .page-index__button-group .page-index__btn-primary,
  .page-index__button-group .page-index__btn-secondary,
  .page-index__button-group .page-index__btn-tertiary {
    min-width: unset;
    flex-basis: 48%; /* Cho phép 2 nút trên một hàng */
  }

  .page-index__intro-features,
  .page-index__game-categories,
  .page-index__promotions-grid,
  .page-index__security-grid,
  .page-index__blog-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 cột trên tablet */
    gap: 25px;
  }
}