/* style/index.css */

:root {
  --primary-color: #E0B400; /* Imperial Gold */
  --secondary-color: #00BFFF; /* Electric Blue */
  --dark-primary-color: #1A1A2E; /* Space Blue */
  --text-light: #ffffff;
  --text-dark: #333333;
  --card-bg: rgba(255, 255, 255, 0.1);
  --border-color: rgba(255, 255, 255, 0.2);
}

/* 确保页面内容不 bị che bởi fixed header */
.page-index {
  color: var(--text-light); /* Dark body background, so light text */
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  padding-bottom: 60px; /* Thêm khoảng trống ở cuối trang */
}

/* 🚨 Desktop Video Section Styles (Must strictly adhere) */
.page-index__video-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  padding-top: 10px; /* Desktop: Adjust according to actual navigation bar height */
  background: linear-gradient(135deg, var(--dark-primary-color), #0f0f1d);
  box-shadow: inset 0 -50px 100px rgba(0, 0, 0, 0.3);
}

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

/* 🚨 Video Click Link Styles (Must strictly adhere) */
.page-index__video-link {
  display: block;
  text-decoration: none;
  position: relative;
  width: 100%;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__video-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.page-index__video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio - 🚨 PageSpeed Optimization: Fixed aspect ratio to avoid layout shifts (CLS) */
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.page-index__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
  object-fit: cover;
  pointer-events: none; /* Prevent video controls from blocking click event */
}

/* 🚨 Video Click Hint Overlay Styles (Optional, enhances user experience) */
.page-index__video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.page-index__video-link:hover .page-index__video-overlay {
  opacity: 1;
}

.page-index__video-click-hint {
  color: var(--text-light);
  font-size: 20px;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  padding: 12px 25px;
  background: rgba(224, 180, 0, 0.8);
  border-radius: 8px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

/* 🚨 Play Now Button Styles (Must strictly adhere, positioned below video in center) */
.page-index__video-cta {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 30px;
}

.page-index__play-now-button {
  display: inline-block;
  padding: 18px 50px;
  background: var(--primary-color); /* Imperial Gold */
  color: var(--dark-primary-color); /* Dark text for contrast on gold */
  text-decoration: none;
  border-radius: 10px;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
  border: none;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.page-index__play-now-button:hover {
  background: #ffc107; /* Slightly lighter gold */
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.page-index__play-now-button:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* General Section Styling */
.page-index__title-section,
.page-index__brand-section,
.page-index__games-section,
.page-index__promotions-section,
.page-index__faq-section,
.page-index__blog-section {
  padding: 80px 20px;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.page-index__title-section {
  padding-top: 40px; /* Additional spacing below video */
  background: var(--dark-primary-color);
  color: var(--text-light);
}

.page-index__brand-section {
  background: #1A1A2E;
  color: var(--text-light);
}

.page-index__games-section {
  background: #0f0f1d;
  color: var(--text-light);
}

.page-index__promotions-section {
  background: var(--dark-primary-color);
  color: var(--text-light);
}

.page-index__faq-section {
  background: #0f0f1d;
  color: var(--text-light);
}

.page-index__blog-section {
  background: #1A1A2E;
  color: var(--text-light);
}

.page-index__main-title,
.page-index__brand-title,
.page-index__games-title,
.page-index__promotions-title,
.page-index__faq-title,
.page-index__blog-title {
  font-size: 44px;
  margin-bottom: 20px;
  color: var(--primary-color);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

.page-index__title-description,
.page-index__games-description,
.page-index__promotions-description,
.page-index__blog-description {
  font-size: 18px;
  margin-bottom: 40px;
  line-height: 1.8;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  color: rgba(255, 255, 255, 0.8);
}

/* CTA Buttons */
.page-index__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.page-index__cta-button {
  display: inline-block;
  padding: 15px 35px;
  font-size: 18px;
  font-weight: bold;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow word breaking */
}

.page-index__cta-button--primary {
  background: var(--primary-color);
  color: var(--dark-primary-color);
}

.page-index__cta-button--primary:hover {
  background: #ffc107;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.page-index__cta-button--secondary {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.page-index__cta-button--secondary:hover {
  background: var(--primary-color);
  color: var(--dark-primary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.page-index__cta-button--small {
  padding: 10px 25px;
  font-size: 16px;
  border-radius: 6px;
  margin-top: 20px;
}

/* Brand Section */
.page-index__brand-content {
  text-align: left;
  font-size: 17px;
  line-height: 1.7;
  max-width: 900px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.85);
}

.page-index__brand-content h3 {
  font-size: 28px;
  color: var(--secondary-color);
  margin-top: 40px;
  margin-bottom: 15px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.page-index__brand-content ul {
  list-style-type: disc;
  padding-left: 25px;
  margin-top: 15px;
}

.page-index__brand-content li {
  margin-bottom: 10px;
}

/* Game Categories */
.page-index__game-category-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.page-index__game-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.page-index__game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.page-index__game-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.page-index__game-card-title {
  font-size: 24px;
  color: var(--primary-color);
  margin-bottom: 15px;
  min-height: 60px; /* Ensure consistent card height */
}

.page-index__game-card-link {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-index__game-card-link:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.page-index__game-card-text {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  flex-grow: 1;
}

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

.page-index__promotion-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.page-index__promotion-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.page-index__promotion-card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.page-index__promotion-card-title {
  font-size: 24px;
  color: var(--primary-color);
  margin-bottom: 15px;
  min-height: 60px; /* Ensure consistent card height */
}

.page-index__promotion-card-link {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-index__promotion-card-link:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.page-index__promotion-card-text {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  flex-grow: 1;
}

.page-index__promotions-cta {
  margin-top: 50px;
}

/* FAQ Section */
.page-index__faq-list {
  max-width: 900px;
  margin: 50px auto 0;
  text-align: left;
}

/* FAQ container styles */
.page-index__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
}

/* FAQ default state - answer hidden */
.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 20px;
  opacity: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 16px;
  line-height: 1.7;
}

/* FAQ expanded state - 🚨 Use !important and sufficiently large max-height to ensure expansion */
.page-index__faq-item.active .page-index__faq-answer {
  max-height: 2000px !important; /* 🚨 Use !important to ensure priority, value large enough to contain any content */
  padding: 20px !important;
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0 0 8px 8px;
}

/* Question styles */
.page-index__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid transparent;
  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: rgba(255, 255, 255, 0.15);
  border-color: var(--primary-color);
}

.page-index__faq-question:active {
  background: rgba(255, 255, 255, 0.2);
}

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

/* Toggle icon */
.page-index__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: var(--primary-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: 32px;
  height: 32px;
}

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

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

.page-index__blog-item {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.page-index__blog-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.page-index__blog-link {
  display: block;
  padding: 25px;
  text-decoration: none;
  color: var(--text-light);
}

.page-index__blog-item-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
  margin-bottom: 20px;
  display: block;
}

.page-index__blog-item-title {
  font-size: 22px;
  color: var(--primary-color);
  margin-bottom: 10px;
  line-height: 1.4;
}

.page-index__blog-item-excerpt {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  margin-bottom: 15px;
}

.page-index__blog-item-date {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  display: block;
}

.page-index__blog-cta {
  margin-top: 50px;
}

/* 🚨 Mobile Responsive Design (Must strictly adhere) */
@media (max-width: 768px) {
  .page-index {
    font-size: 15px;
    line-height: 1.6;
    padding-bottom: 40px;
  }

  /* 🚨 Mobile Video Section Styles (Must strictly adhere) */
  .page-index__video-section {
    padding-top: 10px !important; /* Mobile: Adjust according to mobile navigation bar height */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  
  .page-index__video-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden !important;
  }
  
  /* 🚨 Video Link Mobile Adaptation (Must strictly adhere) */
  .page-index__video-link {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .page-index__video-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 8px;
    overflow: hidden !important;
  }
  
  .page-index__video {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    object-fit: contain; /* Use contain on mobile to ensure video is fully visible and doesn't overflow */
  }
  
  /* 🚨 Play Now Button Mobile Responsive Adaptation (Must strictly adhere) */
  .page-index__video-cta {
    margin-top: 25px;
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .page-index__play-now-button {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 15px 30px !important;
    font-size: 18px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }
  
  /* 🚨 Video Click Hint Overlay Mobile Adaptation */
  .page-index__video-click-hint {
    font-size: 16px !important;
    padding: 10px 20px !important;
  }

  .page-index__main-title,
  .page-index__brand-title,
  .page-index__games-title,
  .page-index__promotions-title,
  .page-index__faq-title,
  .page-index__blog-title {
    font-size: 32px;
  }

  .page-index__title-description,
  .page-index__games-description,
  .page-index__promotions-description,
  .page-index__blog-description {
    font-size: 16px;
    margin-bottom: 30px;
  }

  .page-index__cta-buttons {
    flex-direction: column;
    gap: 15px;
    padding: 0 15px;
  }

  /* 🚨 All buttons must adapt to screen width (Must strictly adhere) */
  .page-index__cta-button,
  .page-index__play-now-button {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  .page-index__brand-content h3 {
    font-size: 24px;
  }

  .page-index__game-category-list,
  .page-index__promotion-list,
  .page-index__blog-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-index__game-card,
  .page-index__promotion-card,
  .page-index__blog-item {
    padding: 20px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-index__game-card-image,
  .page-index__promotion-card-image,
  .page-index__blog-item-image {
    height: 180px;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-index__faq-list {
    padding: 0 15px;
  }

  .page-index__faq-question {
    padding: 15px;
    flex-wrap: wrap;
  }
  
  .page-index__faq-question h3 {
    font-size: 16px;
    width: calc(100% - 40px);
  }
  
  .page-index__faq-toggle {
    margin-left: 10px;
    width: 28px;
    height: 28px;
    font-size: 24px;
  }
  
  .page-index__faq-answer {
    padding: 0 15px;
  }
  
  .page-index__faq-item.active .page-index__faq-answer {
    padding: 15px !important;
  }
  
  .page-index__blog-link {
    padding: 20px;
  }
  .page-index__blog-item-title {
    font-size: 20px;
  }
  .page-index__blog-item-excerpt {
    font-size: 15px;
  }
}