/* style/index.css */

:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --register-color: #C30808;
    --login-color: #C30808;
    --text-on-dark-bg: #FFFFFF;
    --text-on-light-bg: #333333;
    --text-register-login: #FFFF00;
    --border-color: #e0e0e0;
}

.page-index {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-on-light-bg);
    background-color: var(--secondary-color); /* Body background is light */
}

/* Hero Section */
.page-index__hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    padding-top: var(--header-offset, 120px); /* Ensure content is below fixed header */
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

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

.page-index__hero-image {
    width: 100%;
    margin-bottom: 30px;
}

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

.page-index__hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    color: var(--text-on-dark-bg);
}

.page-index__hero-title {
    font-size: 3.2em;
    margin-bottom: 15px;
    color: var(--text-on-dark-bg);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.page-index__hero-description {
    font-size: 1.3em;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-on-dark-bg);
}

.page-index__cta-button {
    display: inline-block;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s ease;
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text wrapping */
}

.page-index__btn-primary {
    background: var(--register-color); /* Use register color for primary CTA */
    color: var(--text-register-login);
    border: 2px solid var(--register-color);
}

.page-index__btn-primary:hover {
    background: darken(var(--register-color), 10%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.page-index__section-title {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.page-index__section-title--white {
    color: var(--text-on-dark-bg);
}

.page-index__text-block {
    font-size: 1.1em;
    text-align: center;
    max-width: 900px;
    margin: 0 auto 40px auto;
    color: var(--text-on-light-bg);
}

.page-index__text-block--white {
    color: var(--text-on-dark-bg);
}

.page-index__highlight {
    font-weight: bold;
    color: var(--primary-color);
}

.page-index__text-block--white .page-index__highlight {
    color: var(--text-on-dark-bg);
}

/* Intro Section */
.page-index__intro-section {
    padding: 80px 0;
    background-color: var(--secondary-color);
    color: var(--text-on-light-bg);
}

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

.page-index__feature-item {
    padding: 30px;
    background: var(--secondary-color);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-index__feature-title {
    font-size: 1.5em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.page-index__feature-item p {
    font-size: 1em;
    color: var(--text-on-light-bg);
}

/* Quick Links Section */
.page-index__quick-links-section {
    padding: 80px 0;
    background-color: var(--primary-color); /* Dark background */
    color: var(--text-on-dark-bg);
}

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

.page-index__btn-secondary {
    background: var(--secondary-color);
    color: var(--primary-color);
    border: 2px solid var(--secondary-color);
    padding: 12px 25px;
    font-size: 1.05em;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text wrapping */
}

.page-index__btn-secondary:hover {
    background: var(--primary-color);
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Games Section */
.page-index__games-section {
    padding: 80px 0;
    background-color: var(--secondary-color);
    color: var(--text-on-light-bg);
}

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

.page-index__game-card {
    background: var(--secondary-color);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-index__game-card img {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    margin-bottom: 15px;
}

.page-index__game-title {
    font-size: 1.4em;
    margin-bottom: 10px;
    padding: 0 15px;
}

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

.page-index__game-title a:hover {
    color: darken(var(--primary-color), 10%);
}

.page-index__game-card p {
    font-size: 0.95em;
    color: var(--text-on-light-bg);
    padding: 0 15px 20px;
}

/* Promotions Section */
.page-index__promotions-section {
    padding: 80px 0;
    background-color: var(--primary-color); /* Dark background */
    color: var(--text-on-dark-bg);
}

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

.page-index__promo-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: var(--text-on-dark-bg);
    padding-bottom: 20px;
}

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

.page-index__promo-card img {
    width: 100%;
     /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    margin-bottom: 15px;
}

.page-index__promo-title {
    font-size: 1.3em;
    margin-bottom: 10px;
    padding: 0 15px;
}

.page-index__promo-title a {
    color: var(--text-on-dark-bg);
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-index__promo-title a:hover {
    color: var(--secondary-color);
}

.page-index__promo-card p {
    font-size: 0.95em;
    color: var(--text-on-dark-bg);
    padding: 0 15px;
}

.page-index__button-container {
    margin-top: 50px;
    text-align: center;
}

.page-index__button-container--center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Security & Support Section */
.page-index__security-support-section {
    padding: 80px 0;
    background-color: var(--secondary-color);
    color: var(--text-on-light-bg);
}

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

.page-index__security-item {
    padding: 30px;
    background: var(--secondary-color);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-index__security-title {
    font-size: 1.5em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.page-index__security-item p {
    font-size: 1em;
    color: var(--text-on-light-bg);
}

/* FAQ Section */
.page-index__faq-section {
    padding: 80px 0;
    background-color: var(--secondary-color);
    color: var(--text-on-light-bg);
}

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

/* 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, opacity 0.4s ease;
  padding: 0 15px;
  opacity: 0;
}

/* FAQ展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.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;
}

/* 问题样式 */
.page-index__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.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: 1.1em;
  font-weight: 600;
  line-height: 1.5;
  color: var(--primary-color);
  pointer-events: none; /* 防止h3标签阻止点击事件 */
}

/* 切换图标 */
.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; /* 防止图标阻止点击事件 */
  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 'x' effect */
}

.page-index__faq-answer p {
    color: var(--text-on-light-bg);
    font-size: 0.95em;
}

.page-index__faq-answer a {
    color: var(--primary-color);
    text-decoration: underline;
}

.page-index__faq-answer a:hover {
    color: darken(var(--primary-color), 10%);
}

/* Blog Section */
.page-index__blog-section {
    padding: 80px 0;
    background-color: var(--primary-color); /* Dark background */
    color: var(--text-on-dark-bg);
}

.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: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: var(--text-on-dark-bg);
    padding-bottom: 20px;
}

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

.page-index__blog-card img {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    margin-bottom: 15px;
}

.page-index__blog-title {
    font-size: 1.3em;
    margin-bottom: 10px;
    padding: 0 15px;
}

.page-index__blog-title a {
    color: var(--text-on-dark-bg);
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-index__blog-title a:hover {
    color: var(--secondary-color);
}

.page-index__blog-card p {
    font-size: 0.95em;
    color: var(--text-on-dark-bg);
    padding: 0 15px;
    margin-bottom: 10px;
}

.page-index__blog-date {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
    padding: 0 15px;
    display: block;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-index__hero-title {
        font-size: 2.8em;
    }

    .page-index__hero-description {
        font-size: 1.1em;
    }

    .page-index__section-title {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .page-index {
        font-size: 16px;
        line-height: 1.6;
    }

    /* Hero Section */
    .page-index__hero-section {
        padding-top: var(--header-offset, 120px) !important;
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .page-index__hero-title {
        font-size: 2.2em;
    }

    .page-index__hero-description {
        font-size: 1em;
    }

    .page-index__cta-button {
        padding: 12px 30px;
        font-size: 1em;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    /* General Sections */
    .page-index__container {
        padding: 30px 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-index__section-title {
        font-size: 1.8em;
        margin-bottom: 25px;
    }

    .page-index__text-block {
        font-size: 1em;
        margin-bottom: 30px;
    }

    /* Grids */
    .page-index__features-grid, 
    .page-index__games-grid, 
    .page-index__promotions-grid, 
    .page-index__security-grid, 
    .page-index__blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Images */
    .page-index img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    .page-index__game-card img, 
    .page-index__promo-card img, 
    .page-index__blog-card img {
         /* Adjust height for mobile if needed */
    }

    /* Buttons */
    .page-index__button-group {
        flex-direction: column;
        gap: 15px;
    }

    .page-index__btn-secondary {
        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;
    }
    
    /* FAQ */
    .page-index__faq-question {
        padding: 15px;
        flex-wrap: wrap;
    }
    
    .page-index__faq-question h3 {
        font-size: 1em;
        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__promo-card, .page-index__blog-card {
        padding-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .page-index__hero-title {
        font-size: 1.8em;
    }

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