/* style/resources-faq.css */

:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --text-color-dark: #333333;
  --text-color-light: #FFFFFF;
  --background-color-light: #FFFFFF;
  --border-color: #e0e0e0;
  --hover-bg-color: #f5f5f5;
  --active-bg-color: #eeeeee;
  --faq-answer-bg: #f9f9f9;
}

.page-resources-faq {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-color-dark);
  background-color: var(--background-color-light);
}

.page-resources-faq__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);
  background: linear-gradient(135deg, var(--primary-color) 0%, #aed6f1 100%); /* Adjusted gradient for visual appeal */
  color: var(--text-color-light);
  overflow: hidden;
}

.page-resources-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-resources-faq__hero-image {
  width: 100%;
  margin-bottom: 30px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

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

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

.page-resources-faq__hero-title {
  font-size: 3.2em;
  margin-bottom: 15px;
  color: var(--text-color-light);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  font-weight: 700;
}

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

.page-resources-faq__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: #EA7C07; /* Login color */
  color: var(--text-color-light);
  text-decoration: none;
  border-radius: 5px;
  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);
  border: none;
}

.page-resources-faq__cta-button:hover {
  background: #d46f06;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.page-resources-faq__section {
  padding: 60px 20px;
  background-color: var(--background-color-light);
}

.page-resources-faq__section:nth-of-type(even) {
  background-color: var(--faq-answer-bg);
}

.page-resources-faq__container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 15px;
}

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

.page-resources-faq__faq-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* FAQ item styles */
.page-resources-faq__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* FAQ default state - answer hidden */
.page-resources-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 15px;
  opacity: 0;
  color: var(--text-color-dark);
}

/* FAQ expanded state - 🚨 Use !important and sufficiently large max-height */
.page-resources-faq__faq-item.active .page-resources-faq__faq-answer {
  max-height: 2000px !important; /* 🚨 Use !important ensure priority, value large enough to accommodate any content */
  padding: 20px 15px !important;
  opacity: 1;
  background: var(--faq-answer-bg);
  border-radius: 0 0 5px 5px;
}

/* Question styles */
.page-resources-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: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-resources-faq__faq-question:hover {
  background: var(--hover-bg-color);
  border-color: #d0d0d0;
}

.page-resources-faq__faq-question:active {
  background: var(--active-bg-color);
}

/* Question title styles */
.page-resources-faq__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 1.15em;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Prevent h3 tag from blocking click event */
  color: var(--text-color-dark);
}

/* Toggle icon */
.page-resources-faq__faq-toggle {
  font-size: 1.5em;
  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: 28px;
  height: 28px;
}

.page-resources-faq__faq-item.active .page-resources-faq__faq-toggle {
  color: var(--primary-color);
  transform: rotate(45deg); /* Plus to X for active */
}

.page-resources-faq__faq-answer p {
  margin: 0 0 10px 0;
  color: var(--text-color-dark);
}

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

.page-resources-faq__faq-answer a {
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: 600;
}

.page-resources-faq__faq-answer a:hover {
  color: #1a7bb7;
}

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

.page-resources-faq__link-more {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 20px;
  background: var(--primary-color);
  color: var(--text-color-light);
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.page-resources-faq__link-more:hover {
  background: #1a7bb7;
}

.page-resources-faq__cta-section {
  background: linear-gradient(90deg, #26A9E0, #007bff);
  color: var(--text-color-light);
  padding: 80px 20px;
  text-align: center;
}

.page-resources-faq__cta-title {
  font-size: 2.5em;
  margin-bottom: 20px;
  color: var(--text-color-light);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.page-resources-faq__cta-description {
  font-size: 1.2em;
  margin-bottom: 30px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.page-resources-faq__cta-button--large {
  padding: 18px 50px;
  font-size: 1.2em;
  background: #EA7C07; /* Login color */
}

.page-resources-faq__cta-button--large:hover {
  background: #d46f06;
}

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

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

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

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

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

  .page-resources-faq__hero-title {
    font-size: 2.2em;
    margin-bottom: 10px;
  }

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

  .page-resources-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-resources-faq__section {
    padding: 40px 15px;
  }

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

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

  .page-resources-faq__faq-question h3 {
    font-size: 1em;
    margin-bottom: 0;
    width: calc(100% - 40px);
  }

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

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

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

  /* Mobile image adaptation */
  .page-resources-faq img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

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

  .page-resources-faq__cta-section {
    padding: 60px 15px;
  }

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

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

  .page-resources-faq__cta-button--large {
    padding: 15px 30px;
    font-size: 1.1em;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Ensure all buttons and button containers are responsive */
  .page-resources-faq__cta-button,
  .page-resources-faq__btn-primary,
  .page-resources-faq__btn-secondary,
  .page-resources-faq a[class*="button"],
  .page-resources-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: auto;
    margin-right: auto;
  }

  .page-resources-faq__cta-buttons,
  .page-resources-faq__button-group,
  .page-resources-faq__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    flex-wrap: wrap !important;
    gap: 10px;
  }
}