/* style/faq.css */

/* --- General Styles for .page-faq (BEM Naming) --- */
.page-faq {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light background */
  background-color: var(--secondary-color, #FFFFFF); /* Assuming shared.css sets --secondary-color to white */
  padding-top: var(--header-offset, 120px); /* Fixed header spacing */
}

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

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

.page-faq__section-description {
  font-size: 1.1em;
  text-align: center;
  margin-bottom: 40px;
  color: #555555;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Hero Section (Adapted for FAQ page) --- */
.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: var(--primary-color, #017439); /* Dark background for hero */
  color: #ffffff; /* Light text for dark background */
}

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

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

.page-faq__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

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

.page-faq__main-title {
  font-size: 2.8em;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.3;
  color: #FFFF00; /* Use custom color for main title on dark background */
}

.page-faq__intro-text {
  font-size: 1.2em;
  margin-bottom: 30px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  color: #f0f0f0;
}

/* --- CTA Button Styles --- */
.page-faq__cta-button {
  display: inline-block;
  padding: 15px 40px;
  text-decoration: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  margin-top: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
  max-width: 100%; /* Ensure responsiveness */
}

.page-faq__btn-primary {
  background: var(--button-register-color, #C30808); /* Custom register color */
  color: var(--button-login-font-color, #FFFF00); /* Custom register font color */
  border: 2px solid var(--button-register-color, #C30808);
}

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

.page-faq__btn-secondary {
  background: #ffffff;
  color: var(--primary-color, #017439);
  border: 2px solid var(--primary-color, #017439);
  margin-left: 20px;
}

.page-faq__btn-secondary:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.page-faq__cta-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap; /* Allow wrapping on small screens */
  gap: 20px;
  margin-top: 40px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* --- Content Area --- */
.page-faq__content-area {
  padding: 60px 0;
  background-color: #f9f9f9; /* Light background for content */
  color: #333333;
}

.page-faq__content-area p {
  margin-bottom: 1em;
}

.page-faq__content-area ul {
  list-style-type: disc;
  margin-left: 20px;
  margin-bottom: 1em;
}

.page-faq__content-area li {
  margin-bottom: 0.5em;
}

.page-faq__content-area h3 {
  color: var(--primary-color, #017439);
  font-size: 1.4em;
  margin-top: 1.5em;
  margin-bottom: 0.8em;
}

.page-faq__content-area a {
  color: var(--primary-color, #017439);
  text-decoration: underline;
  transition: color 0.3s ease;
}

.page-faq__content-area a:hover {
  color: #004d2a;
}

/* --- FAQ Accordion Styles --- */
.page-faq__faq-list {
  margin-top: 40px;
}

.page-faq__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.page-faq__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-faq__faq-item.active .page-faq__faq-question {
  border-radius: 8px 8px 0 0;
  background-color: #e6ffe6; /* Lighter green for active question */
  border-color: var(--primary-color, #017439);
}

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

.page-faq__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 1.1em;
  font-weight: 600;
  line-height: 1.5;
  color: var(--primary-color, #017439);
  pointer-events: none; /* Prevent h3 from blocking click event */
}

.page-faq__faq-toggle {
  font-size: 28px;
  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; /* Prevent icon from blocking click event */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}

.page-faq__faq-item.active .page-faq__faq-toggle {
  color: var(--primary-color, #017439);
  transform: rotate(180deg); /* Rotate for minus sign effect */
}

.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.3s ease;
  padding: 0 25px;
  opacity: 0;
  background: #fcfcfc;
  color: #555555;
}

.page-faq__faq-item.active .page-faq__faq-answer {
  max-height: 2000px !important; /* Ensure content expands fully */
  padding: 20px 25px !important;
  opacity: 1;
  background: #fcfcfc;
  border-radius: 0 0 8px 8px;
}

.page-faq__faq-answer p {
  margin-bottom: 1em;
}

.page-faq__faq-answer p:last-child {
  margin-bottom: 0;
}

.page-faq__faq-image {
  margin: 20px 0;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  max-width: 100%; /* Ensure responsiveness */
  height: auto; /* Maintain aspect ratio */
  display: block;
}

/* --- Conclusion Section --- */
.page-faq__conclusion-section {
  padding: 80px 20px;
  background-color: var(--primary-color, #017439); /* Dark background */
  color: #ffffff;
  text-align: center;
}

.page-faq__conclusion-section .page-faq__section-title {
  color: #FFFF00; /* Custom font color for title on dark background */
}

.page-faq__conclusion-section .page-faq__intro-text {
  color: #f0f0f0;
  margin-bottom: 25px;
}

/* --- Responsive Design (Mobile) --- */
@media (max-width: 768px) {
  .page-faq {
    font-size: 15px;
    line-height: 1.5;
  }

  .page-faq__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Ensure mobile header offset */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-faq__hero-image img {
    border-radius: 4px;
  }

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

  .page-faq__intro-text {
    font-size: 1em;
  }

  .page-faq__cta-button {
    padding: 12px 25px;
    font-size: 16px;
    margin-left: 0 !important; /* Remove margin for single column */
    margin-right: 0 !important;
    width: 100% !important; /* Full width for buttons */
    max-width: 100% !important;
  }

  .page-faq__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    padding-left: 15px;
    padding-right: 15px;
  }

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

  .page-faq__section-description {
    font-size: 1em;
    padding: 0 15px;
  }

  .page-faq__content-area,
  .page-faq__conclusion-section {
    padding: 40px 0;
  }

  .page-faq__container {
    padding: 0 15px;
  }

  .page-faq__faq-question {
    padding: 15px 20px;
    flex-wrap: wrap; /* Allow question text to wrap */
  }

  .page-faq__faq-question h3 {
    font-size: 1em;
    width: calc(100% - 40px); /* Adjust width for toggle icon */
  }

  .page-faq__faq-toggle {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-left: 10px;
  }

  .page-faq__faq-answer {
    padding: 0 20px;
  }

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

  /* Mobile image responsiveness */
  .page-faq img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  
  .page-faq__section,
  .page-faq__card,
  .page-faq__container,
  .page-faq__hero-section,
  .page-faq__content-area,
  .page-faq__conclusion-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    /* Removed padding-left/right here to avoid double padding if already set on .page-faq__container */
  }
}

/* Color contrast adjustments for specific backgrounds */
.page-faq__dark-bg {
  background: var(--primary-color, #017439);
  color: #ffffff; /* Light text for dark background */
}

.page-faq__light-bg {
  background: #ffffff;
  color: #333333; /* Dark text for light background */
}

/* Ensure all p and li tags within .page-faq have readable color */
.page-faq p,
.page-faq li {
  color: inherit; /* Inherit from parent, which is set by dark/light bg classes */
}

/* Override for links in dark background sections */
.page-faq__dark-bg a {
  color: #FFFF00; /* Yellow links on dark green background */
}
.page-faq__dark-bg a:hover {
  color: #FFD700;
}