/* style/faq.css */

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

.page-faq {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color-dark);
  background-color: var(--background-color);
  padding-top: var(--header-offset, 120px); /* Ensure content is below fixed header */
}

.page-faq__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  background-color: #f0f8f0; /* Light green tint for hero background */
  overflow: hidden;
}

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

.page-faq__hero-image {
  width: 100%;
  margin-bottom: 30px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.page-faq__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: cover;
}

.page-faq__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
}

.page-faq__main-title {
  font-size: 3.2em;
  color: var(--primary-color);
  margin-bottom: 20px;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.page-faq__intro-description {
  font-size: 1.2em;
  color: var(--text-color-dark);
  max-width: 800px;
  margin: 0 auto 30px auto;
}

.page-faq__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--button-register-bg);
  color: var(--button-text-color);
  text-decoration: none;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-faq__cta-button:hover {
  background: darken(var(--button-register-bg), 10%);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.page-faq__content-section {
  padding: 80px 20px;
  background-color: var(--background-color);
}

.page-faq__container {
  max-width: 1000px;
  margin: 0 auto;
  box-sizing: border-box;
}

.page-faq__section-title {
  font-size: 2.5em;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 20px;
  font-weight: 700;
}

.page-faq__section-description {
  font-size: 1.1em;
  color: var(--text-color-dark);
  text-align: center;
  max-width: 700px;
  margin: 0 auto 50px auto;
}

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

/* FAQ容器样式 */
.page-faq__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* FAQ默认状态 - 答案隐藏 */
.page-faq__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: var(--text-color-dark);
}

/* FAQ展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.page-faq__faq-item.active .page-faq__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 !important;
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 8px 8px;
}

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

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

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

/* 问题标题样式 */
.page-faq__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 1.15em;
  font-weight: 600;
  line-height: 1.5;
  color: var(--primary-color);
  pointer-events: none; /* 防止h3标签阻止点击事件 */
}

/* 切换图标 */
.page-faq__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; /* 防止图标阻止点击事件 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--primary-color);
  border-radius: 50%;
}

.page-faq__faq-item.active .page-faq__faq-toggle {
  color: var(--secondary-color);
  background-color: var(--primary-color);
  transform: rotate(45deg); /* Rotate to form an 'X' or similar effect */
}

.page-faq__image-inline {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.page-faq__btn-primary {
  display: inline-block;
  padding: 12px 25px;
  background: var(--primary-color);
  color: var(--text-color-light);
  text-decoration: none;
  border-radius: 5px;
  font-size: 1em;
  font-weight: bold;
  margin-top: 20px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

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

.page-faq__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  background: var(--secondary-color);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 5px;
  font-size: 1em;
  font-weight: bold;
  margin-top: 20px;
  transition: all 0.3s ease;
  border: 2px solid var(--primary-color);
  margin-left: 15px;
}

.page-faq__btn-secondary:hover {
  background: var(--primary-color);
  color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-faq__cta-section {
  padding: 60px 20px;
  color: var(--text-color-light);
  text-align: center;
}

.page-faq__dark-bg {
  background: var(--primary-color);
}

.page-faq__cta-title {
  font-size: 2.2em;
  margin-bottom: 15px;
  font-weight: 700;
  color: var(--text-color-light);
}

.page-faq__cta-description {
  font-size: 1.1em;
  max-width: 700px;
  margin: 0 auto 30px auto;
  color: rgba(255, 255, 255, 0.9);
}

.page-faq__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* 移动端响应式设计 */
@media (max-width: 768px) {
  .page-faq {
    font-size: 16px;
    line-height: 1.6;
    padding-top: var(--header-offset, 120px) !important;
  }

  .page-faq__hero-section {
    padding: 40px 15px;
  }

  .page-faq__main-title {
    font-size: 2.2em;
    margin-bottom: 15px;
  }

  .page-faq__intro-description {
    font-size: 1em;
    margin-bottom: 20px;
  }

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

  .page-faq__content-section {
    padding: 40px 15px;
  }

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

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

  .page-faq__faq-question {
    padding: 15px;
  }

  .page-faq__faq-question h3 {
    font-size: 1em;
  }

  .page-faq__faq-toggle {
    font-size: 24px;
    width: 28px;
    height: 28px;
  }

  .page-faq__faq-item.active .page-faq__faq-answer {
    padding: 15px !important;
  }

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

  .page-faq__container,
  .page-faq__cta-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-faq__btn-primary,
  .page-faq__btn-secondary,
  .page-faq a[class*="button"],
  .page-faq a[class*="btn"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    margin-left: 0 !important; /* Reset margin for single column */
  }

  .page-faq__cta-buttons {
    flex-direction: column;
    gap: 15px;
  }

  .page-faq__cta-title {
    font-size: 1.8em;
  }

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