:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --accent-color-register: #C30808; /* Đăng ký */
  --accent-color-login: #C30808;    /* Đăng nhập */
  --text-color-register-login: #FFFF00; /* Đăng ký và đăng nhập font */
  --dark-bg-text-color: #ffffff;
  --light-bg-text-color: #333333;
  --card-bg-dark-mode: rgba(255, 255, 255, 0.1); /* Semi-transparent white for dark body */
  --card-border-dark-mode: rgba(255, 255, 255, 0.2);
}

/* Base styles for the page content, considering dark body background from shared.css */
.page-index {
  color: var(--dark-bg-text-color); /* Light text on dark body background */
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background-color: transparent; /* Body background is handled by shared.css */
}

/* General container styles */
.page-index__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
}

.page-index__section-title {
  font-size: 36px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 20px;
  color: var(--dark-bg-text-color); /* Default to light text for dark background */
}

.page-index__section-description {
  font-size: 18px;
  text-align: center;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: var(--dark-bg-text-color); /* Default to light text for dark background */
}

/* Card base style */
.page-index__card {
  background: var(--card-bg-dark-mode);
  border: 1px solid var(--card-border-dark-mode);
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: var(--dark-bg-text-color);
}

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

/* Button base styles */
.page-index__cta-button {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: none;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Specific button colors */
.page-index__btn-register,
.page-index__btn-login {
  background: var(--accent-color-register); /* #C30808 */
  color: var(--text-color-register-login); /* #FFFF00 */
}

.page-index__btn-register:hover,
.page-index__btn-login:hover {
  background: #a30707; /* Darker red on hover */
}

/* Background color handling for sections */
.page-index__dark-section {
  background-color: var(--primary-color); /* #017439 */
  color: var(--dark-bg-text-color); /* White text */
}

.page-index__dark-section .page-index__section-title,
.page-index__dark-section .page-index__section-description,
.page-index__dark-section .page-index__main-title,
.page-index__dark-section .page-index__hero-description,
.page-index__dark-section .page-index__brand-item-title,
.page-index__dark-section .page-index__brand-item-text,
.page-index__dark-section .page-index__brand-advantages-list li {
  color: var(--dark-bg-text-color); /* Ensure text is white */
}

.page-index__light-bg {
  background-color: #f0f0f0; /* Light grey background for contrast */
  color: var(--light-bg-text-color); /* Dark text */
}

.page-index__light-bg .page-index__section-title,
.page-index__light-bg .page-index__section-description,
.page-index__light-bg .page-index__offering-title,
.page-index__light-bg .page-index__offering-text,
.page-index__light-bg .page-index__blog-item-title,
.page-index__light-bg .page-index__blog-item-excerpt,
.page-index__light-bg .page-index__blog-item-date,
.page-index__light-bg .page-index__faq-question h3,
.page-index__light-bg .page-index__faq-answer p {
  color: var(--light-bg-text-color); /* Ensure text is dark */
}

.page-index__light-bg .page-index__card {
  background: #ffffff; /* White card background on light section */
  border-color: #e0e0e0;
  color: var(--light-bg-text-color);
}

/* ==========================================================================
   Video Section (Module: Video)
   ========================================================================== */
.page-index__video-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  padding-top: var(--header-offset, 120px); /* Fixed header offset */
  background-color: var(--primary-color); /* Use primary color as background for video section */
}

.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;
  z-index: 1; /* Ensure video content is above any potential background patterns */
}

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

.page-index__video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.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); /* Darker overlay for better text visibility */
  border-radius: 8px;
  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: #ffffff;
  font-size: 20px;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  padding: 12px 25px;
  background: rgba(195, 8, 8, 0.8); /* Use register/login accent color for hint */
  border-radius: 5px;
  white-space: nowrap;
}

.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: 15px 40px;
  background: var(--accent-color-register); /* #C30808 */
  color: var(--text-color-register-login); /* #FFFF00 */
  text-decoration: none;
  border-radius: 8px;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: none;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.page-index__play-now-button:hover {
  background: #a30707;
  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 2px 8px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   H1 Title + Activity Promotion Buttons (Module 1)
   ========================================================================== */
.page-index__hero-section {
  padding: 80px 20px;
  text-align: center;
  background-image: url('[GALLERY:hero_main:1920x1080:vip_vn123,homepage,main_hero,sports_casino_action]');
  background-size: cover;
  background-position: center;
  position: relative;
  z-index: 0;
}

.page-index__hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6); /* Dark overlay for text readability */
  z-index: -1;
}

.page-index__hero-container {
  max-width: 900px;
  margin: 0 auto;
  color: var(--dark-bg-text-color); /* White text on dark overlay */
}

.page-index__main-title {
  font-size: 48px;
  font-weight: 900;
  margin-bottom: 20px;
  line-height: 1.2;
  color: #FFFF00; /* Yellow for H1 for prominence */
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.page-index__hero-description {
  font-size: 20px;
  margin-bottom: 40px;
  line-height: 1.5;
  color: var(--dark-bg-text-color);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.page-index__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

/* ==========================================================================
   Core Offerings Section
   ========================================================================== */
.page-index__offerings-section {
  padding: 80px 20px;
}

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

.page-index__offering-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-index__offering-img {
  width: 100%;
  height: 200px; /* Fixed height for consistency */
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
}

.page-index__offering-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--light-bg-text-color);
}

.page-index__offering-text {
  font-size: 16px;
  margin-bottom: 20px;
  flex-grow: 1; /* Push link to bottom */
  color: var(--light-bg-text-color);
}

.page-index__offering-link {
  display: inline-block;
  padding: 10px 20px;
  background: var(--primary-color);
  color: var(--dark-bg-text-color);
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.page-index__offering-link:hover {
  background: #005c2d;
}

/* ==========================================================================
   FAQ Section (Module 2)
   ========================================================================== */
.page-index__faq-section {
  padding: 80px 20px;
}

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

.page-index__faq-list {
  margin-top: 40px;
}

.page-index__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

.page-index__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #ffffff; /* White background for FAQ question */
  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: var(--light-bg-text-color); /* Dark text for FAQ question */
}

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

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

.page-index__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none;
  color: var(--light-bg-text-color);
}

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

.page-index__faq-item.active .page-index__faq-toggle {
  color: var(--primary-color);
  transform: rotate(45deg); /* Rotate for minus sign effect */
}

.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 15px;
  opacity: 0;
  background: #f9f9f9; /* Light background for FAQ answer */
  color: var(--light-bg-text-color);
  border-radius: 0 0 5px 5px;
}

.page-index__faq-item.active .page-index__faq-answer {
  max-height: 2000px !important; /* Ensure enough height for content */
  padding: 20px 15px !important;
  opacity: 1;
}

.page-index__faq-answer p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--light-bg-text-color);
}

.page-index__faq-app-download-link {
  display: inline-block;
  margin-top: 15px;
  padding: 8px 15px;
  background-color: var(--primary-color);
  color: var(--dark-bg-text-color);
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.page-index__faq-app-download-link:hover {
  background-color: #005c2d;
}

/* ==========================================================================
   Brand Introduction (Module 3)
   ========================================================================== */
.page-index__brand-section {
  padding: 80px 20px;
  text-align: center;
}

.page-index__brand-container {
  max-width: 1200px;
  margin: 0 auto;
}

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

.page-index__brand-item {
  text-align: left;
  padding: 25px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1); /* Semi-transparent white for dark body */
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--dark-bg-text-color);
}

.page-index__brand-img {
  width: 100%;
  height: 250px; /* Fixed height for brand images */
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
}

.page-index__brand-item-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--dark-bg-text-color);
}

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

.page-index__brand-advantages-list {
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--dark-bg-text-color);
}

.page-index__brand-advantages-list li {
  margin-bottom: 10px;
  padding-left: 25px;
  position: relative;
  font-size: 16px;
  line-height: 1.5;
}

.page-index__brand-advantages-list li strong {
  color: #FFFF00; /* Yellow highlight for strong points */
}

.page-index__brand-advantages-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #FFFF00; /* Yellow checkmark */
  font-weight: bold;
}

/* ==========================================================================
   Blog List Display (Module 4)
   ========================================================================== */
.page-index__blog-section {
  padding: 80px 20px;
}

.page-index__blog-container {
  max-width: 1200px;
  margin: 0 auto;
}

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

.page-index__blog-item {
  text-align: left;
  display: flex;
  flex-direction: column;
  background: #ffffff; /* White background for blog cards on light section */
  border: 1px solid #e0e0e0;
  color: var(--light-bg-text-color);
}

.page-index__blog-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-index__blog-item-img {
  width: 100%;
  height: 200px; /* Fixed height for blog thumbnails */
  object-fit: cover;
  border-radius: 8px 8px 0 0;
  margin-bottom: 15px;
}

.page-index__blog-item-title {
  font-size: 20px;
  font-weight: bold;
  margin: 0 15px 10px;
  line-height: 1.4;
  color: var(--light-bg-text-color);
}

.page-index__blog-item-excerpt {
  font-size: 15px;
  margin: 0 15px 15px;
  line-height: 1.5;
  flex-grow: 1; /* Push date to bottom */
  color: var(--light-bg-text-color);
}

.page-index__blog-item-date {
  font-size: 13px;
  color: #666;
  margin: 0 15px 15px;
  display: block;
}

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

.page-index__view-all-news .page-index__cta-button {
  background: var(--primary-color);
  color: var(--dark-bg-text-color);
}

.page-index__view-all-news .page-index__cta-button:hover {
  background: #005c2d;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1024px) {
  .page-index__main-title {
    font-size: 40px;
  }
  .page-index__hero-description {
    font-size: 18px;
  }
  .page-index__section-title {
    font-size: 32px;
  }
  .page-index__offering-title,
  .page-index__brand-item-title {
    font-size: 22px;
  }
  .page-index__blog-item-title {
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  /* General mobile adaptations */
  .page-index__container,
  .page-index__video-section,
  .page-index__hero-section,
  .page-index__offerings-section,
  .page-index__faq-section,
  .page-index__brand-section,
  .page-index__blog-section {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important; /* Prevent horizontal scrolling */
  }
}