/* style/faq.css */

/* Variables from shared.css will be available */
:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --text-color-dark: #333333;
  --text-color-light: #ffffff;
  --border-color: #e0e0e0;
  --background-light: #f9f9f9;
}

/* Base styles for the page-faq scope */
.page-faq {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-color-dark); /* Default text color for light body background */
  background: var(--secondary-color); /* Default background color for the main content area */
}

/* Fixed Header Offset - applied to the first main content section */
.page-faq__hero-title-section {
  padding-top: var(--header-offset, 120px); /* Ensures content is not hidden by fixed header */
  padding-bottom: 40px;
  background: linear-gradient(135deg, var(--primary-color) 0%, #a8e0f5 100%); /* Lighter blue gradient */
  color: var(--text-color-light);
  text-align: center;
  position: relative;
  overflow: hidden; /* Ensure image doesn't overflow */
}

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

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

.page-faq__intro-text {
  font-size: 1.2em;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-color-light);
}

.page-faq__hero-image-wrapper {
  max-width: 900px; /* Adjust based on desired visual impact */
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

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

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

.page-faq__section-title--light {
  color: var(--text-color-light);
}

.page-faq__faq-list-section {
  padding: 60px 0;
  background-color: var(--background-light); /* Light background for contrast */
}

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

/* 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; /* Adjusted padding */
  opacity: 0;
  color: var(--text-color-dark);
  font-size: 0.95em;
}

/* FAQ展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.page-faq__faq-item.active .page-faq__faq-answer {
  max-height: 2000px !important; /* 🚨 使用!important确保优先级，值足够大以容纳任何内容 */
  padding: 20px !important; /* Adjusted padding */
  opacity: 1;
  background: var(--secondary-color); /* Consistent background */
  border-top: 1px solid var(--border-color); /* Separator */
}

/* 问题样式 */
.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; /* Consistent border-radius */
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.page-faq__faq-question:hover {
  background: var(--background-light);
  border-color: var(--primary-color); /* Highlight on hover */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.page-faq__faq-item.active .page-faq__faq-question {
  border-color: var(--primary-color); /* Active state border */
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}


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

/* 切换图标 */
.page-faq__faq-toggle {
  font-size: 28px; /* Larger icon */
  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; /* Larger toggle area */
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
}

.page-faq__faq-item.active .page-faq__faq-toggle {
  color: var(--text-color-light);
  background-color: var(--primary-color);
  transform: rotate(45deg); /* Rotate for 'x' effect */
}

/* Image styling within FAQ answers */
.page-faq__image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  /* No CSS filters */
}

/* Conclusion Section */
.page-faq__conclusion-section {
  padding: 80px 0;
  background: var(--primary-color);
  color: var(--text-color-light);
  text-align: center;
}

.page-faq__conclusion-text {
  font-size: 1.1em;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-faq__cta-buttons {
  display: flex;
  flex-wrap: wrap; /* Allow wrapping on small screens */
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

/* Button styles */
.page-faq__cta-button,
.page-faq__btn-primary,
.page-faq__btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: none;
  border-radius: 50px; /* Pill-shaped buttons */
  transition: all 0.3s ease;
  cursor: pointer;
  box-sizing: border-box; /* Crucial for responsive buttons */
  white-space: normal; /* Allow text wrap */
  word-wrap: break-word; /* Allow text break */
  text-align: center;
  max-width: 100%; /* Ensure button doesn't overflow */
}

.page-faq__btn-primary {
  background: var(--secondary-color); /* White background for primary */
  color: var(--primary-color); /* Brand color text */
  border: 2px solid var(--secondary-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.page-faq__btn-primary:hover {
  background: var(--primary-color);
  color: var(--secondary-color);
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.page-faq__btn-secondary {
  background: transparent;
  color: var(--text-color-light);
  border: 2px solid var(--text-color-light);
}

.page-faq__btn-secondary:hover {
  background: var(--text-color-light);
  color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Copyright Info */
.page-faq__copyright-info {
  background: #1a8cc4; /* A slightly darker blue for the footer section */
  color: rgba(255, 255, 255, 0.8);
  padding: 20px;
  text-align: center;
  font-size: 0.9em;
}

.page-faq__copyright-text {
  margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-faq__main-title {
    font-size: 2.4em;
  }
  .page-faq__section-title {
    font-size: 1.8em;
  }
}

@media (max-width: 768px) {
  /* Mobile padding for hero section */
  .page-faq__hero-title-section {
    padding-top: var(--header-offset, 120px) !important;
    padding-bottom: 30px;
    padding-left: 15px;
    padding-right: 15px;
  }

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

  .page-faq__intro-text {
    font-size: 1em;
    margin-bottom: 30px;
  }

  .page-faq__section-title {
    font-size: 1.6em;
    margin-bottom: 30px;
  }

  /* FAQ Item Mobile */
  .page-faq__faq-question {
    padding: 15px;
    flex-wrap: wrap; /* Allow wrapping for question text */
    border-radius: 6px;
  }

  .page-faq__faq-question h3 {
    font-size: 1em;
    margin-bottom: 0;
    width: calc(100% - 40px); /* Adjust width to make space for toggle */
  }

  .page-faq__faq-toggle {
    margin-left: 10px;
    width: 28px;
    height: 28px;
    font-size: 24px;
    border-width: 1px;
  }
  
  .page-faq__faq-answer {
    padding: 0 15px;
    font-size: 0.9em;
  }
  
  .page-faq__faq-item.active .page-faq__faq-answer {
    padding: 15px !important;
  }

  /* Image responsive for mobile */
  .page-faq img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 6px;
  }

  .page-faq__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-faq__hero-image-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 15px;
  }

  /* Button responsive for mobile */
  .page-faq__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    padding: 0 15px; /* Add padding to the button group */
  }

  .page-faq__cta-button,
  .page-faq__btn-primary,
  .page-faq__btn-secondary {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding: 12px 20px;
    font-size: 1em;
    border-radius: 30px;
  }

  .page-faq__conclusion-section {
    padding: 50px 15px;
  }
  .page-faq__conclusion-text {
    font-size: 1em;
  }
}