/* style/index.css */

/* Căn chỉnh khoảng cách cho nội dung đầu tiên sau header cố định */
.page-index {
  padding-top: 0; /* HERO section không cần padding-top vì nó là full-width và ở đầu */
  color: #ffffff; /* Body background là dark, nên dùng màu chữ sáng */
}

/* 🚨 Desktop HERO主图区域样式（必须严格遵守） */
.page-index__hero-section {
  position: relative;
  width: 100%;
  padding-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  margin-top: 120px; /* Khoảng cách cho header cố định */
}

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

.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 (Products Showcase) */
.page-index__products-section {
  width: 100%;
  padding: 60px 20px;
  background: var(--primary-color); /* Sử dụng màu nền chính của body */
  color: #ffffff;
}

.page-index__products-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 4fr 2fr; /* Desktop: 4 sản phẩm đầu chiếm 4 cột, 2 sản phẩm sau chiếm 2 cột */
  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%;
  border-radius: 8px;
  overflow: hidden;
  background: #2A313E; /* Nền card tối hơn nền body */
  border: 3px solid #FFD700; /* Viền vàng */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

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

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

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

/* Các phần chung cho nội dung */
.page-index__content-area {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
}

.page-index__main-heading,
.page-index__secondary-heading {
  color: #FFD700;
  text-align: center;
  margin-bottom: 30px;
  font-weight: 700;
}

.page-index__main-heading {
  font-size: 3.2em;
  line-height: 1.2;
}

.page-index__secondary-heading {
  font-size: 2.5em;
  line-height: 1.3;
}

.page-index__text-block {
  font-size: 1.1em;
  line-height: 1.8;
  margin-bottom: 20px;
  text-align: justify;
  color: #e0e0e0;
}

.page-index__dark-section {
  background: var(--primary-color);
  color: #ffffff;
  padding: 60px 0;
}

.page-index__light-bg {
  background: #ffffff;
  color: #333333;
  padding: 60px 0;
}

/* Nút (Buttons) */
.page-index__btn-primary,
.page-index__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05em;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
}

.page-index__btn-primary {
  background: #FFD700;
  color: #1A202C;
  border: 2px solid #FFD700;
}

.page-index__btn-primary:hover {
  background: #e6c200;
  border-color: #e6c200;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.page-index__btn-secondary:hover {
  background: #FFD700;
  color: #1A202C;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Module 2: Quick Links */
.page-index__quick-links-section {
  padding-top: 0; /* Đã có padding của .page-index__light-bg */
}

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

/* Module 3: Games Section */
.page-index__game-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-index__game-card {
  background: #2A313E;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  text-align: center;
  padding-bottom: 25px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.page-index__game-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  margin-bottom: 20px;
}

.page-index__game-title {
  font-size: 1.8em;
  color: #FFD700;
  margin-bottom: 15px;
  padding: 0 20px;
}

.page-index__game-description {
  font-size: 1em;
  color: #e0e0e0;
  line-height: 1.7;
  margin-bottom: 25px;
  flex-grow: 1;
  padding: 0 20px;
}

.page-index__game-card .page-index__btn-primary {
  margin-top: auto; /* Đẩy nút xuống dưới */
  align-self: center;
}

/* Module 4: Promotions Section */
.page-index__promotions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-index__promo-card {
  background: #f9f9f9;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
  padding-bottom: 25px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #333333;
}

.page-index__promo-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  margin-bottom: 20px;
}

.page-index__promo-title {
  font-size: 1.6em;
  color: #1A202C;
  margin-bottom: 15px;
  padding: 0 20px;
}

.page-index__promo-description {
  font-size: 0.95em;
  color: #555555;
  line-height: 1.6;
  margin-bottom: 25px;
  flex-grow: 1;
  padding: 0 20px;
}

.page-index__promo-card .page-index__btn-primary {
  margin-top: auto;
  align-self: center;
}

/* Module 5: Security & Support Section */
.page-index__features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-index__feature-item {
  text-align: center;
  padding: 25px;
  background: #2A313E;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.page-index__feature-item img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 20px;
}

.page-index__feature-title {
  font-size: 1.7em;
  color: #FFD700;
  margin-bottom: 15px;
}

.page-index__feature-description {
  font-size: 1em;
  color: #e0e0e0;
  line-height: 1.7;
}

/* Module 6: FAQ Section */
.page-index__faq-container {
  margin-top: 40px;
}

/* FAQ容器样式 */
.page-index__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

/* FAQ默认状态 - 答案隐藏 */
.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;
  padding: 0 15px;
  opacity: 0;
}

/* FAQ展开状态 - 🚨 Sử dụng!important và đủ lớn max-height để đảm bảo mở rộng */
.page-index__faq-item.active .page-index__faq-answer {
  max-height: 2000px !important; /* 🚨 Sử dụng!important đảm bảo ưu tiên, giá trị đủ lớn để chứa mọi nội dung */
  padding: 20px 15px !important;
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
  color: #333333;
}

/* Vấn đề (Question) style */
.page-index__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
  color: #1A202C;
}

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

.page-index__faq-question:active {
  background: #eeeeee;
}

/* Vấn đề tiêu đề style */
.page-index__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Ngăn chặn h3 chặn sự kiện click */
  color: #1A202C;
}

/* Biểu tượng chuyển đổi */
.page-index__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #666;
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Ngăn chặn biểu tượng chặn sự kiện click */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-index__faq-item.active .page-index__faq-toggle {
  color: #333;
  transform: rotate(45deg); /* Để biểu tượng '+' thành 'x' hoặc '-' */
}

/* Module 7: Blog Section */
.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: #2A313E;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.page-index__blog-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.page-index__blog-title {
  font-size: 1.5em;
  color: #FFD700;
  margin: 20px 20px 10px;
  line-height: 1.4;
}

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

.page-index__blog-title a.page-index__blog-link:hover {
  color: #e6c200;
  text-decoration: underline;
}

.page-index__blog-summary {
  font-size: 0.95em;
  color: #e0e0e0;
  line-height: 1.6;
  margin: 0 20px 15px;
  flex-grow: 1;
}

.page-index__blog-date {
  font-size: 0.85em;
  color: #aaaaaa;
  margin: 0 20px 20px;
  display: block;
}

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

/* 🚨 Mobile Responsive Design */
@media (max-width: 1024px) {
  .page-index__main-heading {
    font-size: 2.8em;
  }

  .page-index__secondary-heading {
    font-size: 2.2em;
  }

  .page-index__products-container {
    grid-template-columns: 1fr; /* Mobile: Hai lưới xếp chồng lên nhau */
  }

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

  .page-index__products-grid--large {
    grid-template-columns: 1fr;
  }

  .page-index__game-categories,
  .page-index__promotions-grid,
  .page-index__features-grid,
  .page-index__blog-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .page-index__hero-section {
    margin-top: 100px; /* Khoảng cách cho header cố định trên mobile */
  }

  .page-index__content-area {
    padding: 30px 15px;
  }

  .page-index__main-heading {
    font-size: 2.2em;
    margin-bottom: 20px;
  }

  .page-index__secondary-heading {
    font-size: 1.8em;
    margin-bottom: 25px;
  }

  .page-index__text-block {
    font-size: 1em;
    line-height: 1.7;
  }

  /* 🚨 Sản phẩm trưng bày (Products Showcase) - Mobile */
  .page-index__products-section {
    padding: 40px 15px;
  }
  
  .page-index__products-container {
    gap: 15px;
  }
  
  /* 🚨 4 ảnh đầu - bố cục 4 ô vuông (2x2) */
  .page-index__products-grid--small {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .page-index__products-grid--small .page-index__product-card {
    aspect-ratio: 1 / 1; /* Hình vuông */
  }
  
  .page-index__products-grid--small .page-index__product-card-image {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1; /* Hình vuông */
  }
  
  /* 🚨 2 ảnh lớn sau - mỗi ảnh một dòng, hình vuông */
  .page-index__products-grid--large {
    grid-template-columns: 1fr; /* Mỗi card chiếm một dòng */
    gap: 15px;
  }
  
  .page-index__products-grid--large .page-index__product-card {
    aspect-ratio: 1 / 1; /* Hình vuông */
  }
  
  .page-index__products-grid--large .page-index__product-card-image {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1; /* Hình vuông */
  }

  .page-index__btn-primary, .page-index__btn-secondary {
    padding: 10px 20px;
    font-size: 0.95em;
  }

  .page-index__links-grid {
    grid-template-columns: 1fr;
  }

  .page-index__game-card img,
  .page-index__promo-card img {
    height: 180px;
  }

  .page-index__game-title, .page-index__promo-title {
    font-size: 1.4em;
  }

  .page-index__feature-item img {
    width: 100px;
    height: 100px;
  }

  .page-index__feature-title {
    font-size: 1.5em;
  }

  /* FAQ Mobile */
  .page-index__faq-question {
    padding: 15px;
    flex-wrap: wrap;
  }
  
  .page-index__faq-question h3 {
    font-size: 16px;
    margin-bottom: 0;
    width: calc(100% - 40px);
  }
  
  .page-index__faq-toggle {
    margin-left: 10px;
    width: 24px;
    height: 24px;
    font-size: 20px;
  }
  
  .page-index__faq-answer {
    padding: 0 15px;
  }
  
  .page-index__faq-item.active .page-index__faq-answer {
    padding: 15px !important;
  }

  .page-index__blog-title {
    font-size: 1.3em;
  }

  /* 🚨 Mobile image responsive adaptation */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-index__section,
  .page-index__card,
  .page-index__container,
  .page-index__hero-section,
  .page-index__products-section,
  .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,
  .page-index__content-area,
  .page-index__products-grid,
  .page-index__product-card,
  .page-index__game-card,
  .page-index__promo-card,
  .page-index__feature-item,
  .page-index__blog-card {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-index__products-section, .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: 0 !important;
    padding-right: 0 !important;
  }
  .page-index__products-section .page-index__content-area, .page-index__intro-section .page-index__content-area, .page-index__quick-links-section .page-index__content-area, .page-index__games-section .page-index__content-area, .page-index__promotions-section .page-index__content-area, .page-index__security-support-section .page-index__content-area, .page-index__faq-section .page-index__content-area, .page-index__blog-section .page-index__content-area {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}

/* Thiết lập màu chữ mặc định cho toàn bộ nội dung chính */
.page-index {
  color: #ffffff;
}

/* Đảm bảo các tiêu đề và đoạn văn bản có độ tương phản cao */
.page-index h1, .page-index h2, .page-index h3, .page-index h4, .page-index h5, .page-index h6 {
  color: #FFD700; /* Tiêu đề thường dùng màu vàng phụ trợ */
}

.page-index p, .page-index li {
  color: #e0e0e0; /* Màu chữ sáng cho nền tối */
}

/* Đối với các phần có nền sáng (ví dụ: FAQ, Quick Links) */
.page-index__light-bg .page-index__secondary-heading {
  color: #1A202C; /* Tiêu đề màu tối trên nền sáng */
}

.page-index__light-bg p, .page-index__light-bg li {
  color: #333333; /* Chữ màu tối trên nền sáng */
}

/* Các card nền sáng */
.page-index__promo-card {
  background: #f9f9f9;
  color: #333333;
}

.page-index__promo-card .page-index__promo-title {
  color: #1A202C;
}

.page-index__promo-card .page-index__promo-description {
  color: #555555;
}

/* Các nút có màu chữ được định nghĩa rõ ràng */
.page-index__btn-primary {
  background: #FFD700;
  color: #1A202C; /* Chữ tối trên nền vàng */
}

.page-index__btn-secondary {
  background: transparent;
  color: #FFD700;
  border-color: #FFD700;
}

.page-index__btn-secondary:hover {
  background: #FFD700;
  color: #1A202C; /* Chữ tối trên nền vàng khi hover */
}

/* Đảm bảo link trong text cũng có độ tương phản */
.page-index__text-block a {
  color: #FFD700;
  text-decoration: underline;
}

.page-index__text-block a:hover {
  color: #e6c200;
}