/* === FAQ Section === */

.fda-faq-section {
  /* Scoped purple accent variables */
  --faq-purple-accent: #8b5cf6;
  --faq-purple-light: #c4b5fd;
  --faq-card-bg: #0d0c14;
  --faq-card-border: rgba(139, 92, 246, 0.12);
  --faq-card-border-hover: rgba(139, 92, 246, 0.35);
  --faq-card-active-bg: rgba(139, 92, 246, 0.08);
  --faq-text-light: #f8fafc;
  --faq-text-muted: #94a3b8;
  --faq-tab-inactive: #64748b;

  position: relative;
  background-color: #000000 !important;
  color: var(--faq-text-light);
  padding: 120px 0;
  overflow: hidden;
  z-index: 10;
  transition: background-color var(--transition-fast, 0.2s ease), color var(--transition-fast, 0.2s ease);
}

/* Base fade-in and slide-up reveal states for animation */
.fda-faq-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fda-faq-section.active .fda-faq-reveal {
  opacity: 1;
  transform: translateY(0);
}

/* === Section Header === */

.fda-faq-header {
  text-align: center;
  margin-bottom: 64px;
}

.fda-faq-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--faq-purple-accent);
  color: var(--faq-purple-accent);
  font-family: var(--font-secondary, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 20px;
  background-color: rgba(139, 92, 246, 0.05);
  transition: background-color var(--transition-fast, 0.2s ease);
}

.fda-faq-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--faq-purple-accent);
  display: inline-block;
}

.fda-faq-title {
  font-family: var(--font-primary, sans-serif);
  font-size: 42px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--faq-text-light);
  letter-spacing: -0.02em;
  margin: 0 0 16px 0;
  transition: color var(--transition-fast, 0.2s ease);
}

.fda-faq-title .text-purple-italic {
  color: var(--faq-purple-accent);
  font-style: italic;
  font-weight: 800;
}

.fda-faq-subtext {
  font-family: var(--font-secondary, 'Inter', sans-serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--faq-text-muted);
  max-width: 580px;
  margin: 0 auto;
  transition: color var(--transition-fast, 0.2s ease);
}

/* === Tabs & Indicator === */

.fda-faq-tabs-wrapper {
  position: relative;
  margin-bottom: 48px;
}

.fda-faq-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0 0 0 0;
}

.fda-faq-tab-btn {
  position: relative;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 14px 36px;
  font-family: var(--font-secondary, 'Inter', sans-serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--faq-tab-inactive);
  letter-spacing: 0.01em;
  transition: color 0.25s ease;
  white-space: nowrap;
}

.fda-faq-tab-btn:hover {
  color: var(--faq-text-light);
}

.fda-faq-tab-btn.active {
  color: var(--faq-text-light);
  font-weight: 700;
}

/* Full-width thin base divider line */
.fda-faq-tabs-track {
  position: relative;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.07);
  margin-top: 0;
}

/* Sliding animated accent underline bar */
.fda-faq-tabs-indicator {
  position: absolute;
  top: 0;
  height: 2px;
  background: linear-gradient(to right, var(--faq-purple-light), var(--faq-purple-accent));
  border-radius: 2px;
  transition: left 0.3s cubic-bezier(0.25, 1, 0.5, 1),
              width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  /* Initial position set via JS */
  left: 0;
  width: 0;
}

/* Small downward-pointing triangle on the indicator */
.fda-faq-tabs-indicator::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid var(--faq-purple-accent);
}

/* === Question Grid === */

/* Wrapper that gets the scroll reveal animation instead of individual panels */
.fda-faq-panels-wrapper {
  min-height: 200px; /* Prevents layout jump while panels swap */
}

.fda-faq-category-panel {
  /* Inactive — fully hidden, out of layout */
  display: none;
  opacity: 0;
}

.fda-faq-category-panel.active {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  align-items: start;
}

/* Fade-in on newly visible panel only */
.fda-faq-category-panel.active.visible {
  animation: faqPanelFadeIn 0.3s ease forwards;
}

@keyframes faqPanelFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Accordion Item === */

.fda-faq-item {
  background-color: var(--faq-card-bg);
  border: 1px solid var(--faq-card-border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.fda-faq-item:hover {
  border-color: var(--faq-card-border-hover);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.08);
}

.fda-faq-item.open {
  border-color: var(--faq-card-border-hover);
  background-color: var(--faq-card-active-bg);
  box-shadow: 0 8px 28px rgba(139, 92, 246, 0.12);
}

/* Question Button (header of accordion) */
.fda-faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 24px 28px;
  text-align: left;
}

.fda-faq-question-text {
  font-family: var(--font-primary, sans-serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--faq-text-light);
  flex: 1;
  transition: color var(--transition-fast, 0.2s ease);
}

/* Arrow Icon */
.fda-faq-arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--faq-card-border);
  color: var(--faq-text-muted);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.3s ease,
              border-color 0.3s ease;
}

.fda-faq-arrow svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2px;
}

.fda-faq-item.open .fda-faq-arrow {
  transform: rotate(180deg);
  color: var(--faq-purple-accent);
  border-color: var(--faq-card-border-hover);
}

/* === Accordion Answer === */

/* CSS grid trick for smooth height transition (no max-height hacks) */
.fda-faq-answer-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.fda-faq-item.open .fda-faq-answer-wrapper {
  grid-template-rows: 1fr;
}

.fda-faq-answer-inner {
  overflow: hidden;
}

.fda-faq-answer {
  padding: 0 28px 24px 28px;
  font-family: var(--font-secondary, 'Inter', sans-serif);
  font-size: 14px;
  line-height: 1.7;
  color: var(--faq-text-muted);
  transition: color var(--transition-fast, 0.2s ease);
}

/* === LIGHT THEME OVERRIDES === */

[data-theme="light"] .fda-faq-section {
  background-color: #f8f5ff !important;
  color: var(--color-text-dark, #0f172a);
}

[data-theme="light"] .fda-faq-badge {
  background-color: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.3);
}

[data-theme="light"] .fda-faq-title {
  color: var(--color-text-dark, #0f172a);
}

[data-theme="light"] .fda-faq-subtext {
  color: var(--color-text-muted, #475569);
}

[data-theme="light"] .fda-faq-tab-btn {
  color: #94a3b8;
}

[data-theme="light"] .fda-faq-tab-btn:hover,
[data-theme="light"] .fda-faq-tab-btn.active {
  color: var(--color-text-dark, #0f172a);
}

[data-theme="light"] .fda-faq-tabs-track {
  background-color: rgba(108, 93, 211, 0.12);
}

[data-theme="light"] .fda-faq-item {
  background-color: #ffffff;
  border-color: rgba(108, 93, 211, 0.12);
  box-shadow: 0 1px 4px rgba(108, 93, 211, 0.04);
}

[data-theme="light"] .fda-faq-item:hover {
  border-color: rgba(108, 93, 211, 0.3);
  box-shadow: 0 4px 20px rgba(108, 93, 211, 0.08);
}

[data-theme="light"] .fda-faq-item.open {
  background-color: rgba(139, 92, 246, 0.04);
  border-color: rgba(108, 93, 211, 0.3);
  box-shadow: 0 8px 28px rgba(108, 93, 211, 0.08);
}

[data-theme="light"] .fda-faq-question-text {
  color: var(--color-text-dark, #0f172a);
}

[data-theme="light"] .fda-faq-answer {
  color: var(--color-text-muted, #475569);
}

[data-theme="light"] .fda-faq-arrow {
  border-color: rgba(108, 93, 211, 0.2);
  color: #64748b;
}

[data-theme="light"] .fda-faq-item.open .fda-faq-arrow {
  color: var(--faq-purple-accent);
  border-color: rgba(139, 92, 246, 0.4);
}

/* === Accessibility: prefers-reduced-motion === */

@media (prefers-reduced-motion: reduce) {
  .fda-faq-section * {
    transition: none !important;
    animation: none !important;
  }
}

/* === Responsive === */

/* Tablet */
@media (max-width: 991.98px) {
  .fda-faq-section {
    padding: 100px 0;
  }

  .fda-faq-title {
    font-size: 34px;
  }

  .fda-faq-tab-btn {
    padding: 12px 24px;
    font-size: 14px;
  }

  .fda-faq-category-panel.active.visible {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* Mobile — single column */
@media (max-width: 767.98px) {
  .fda-faq-section {
    padding: 80px 0;
  }

  .fda-faq-title {
    font-size: 28px;
  }

  .fda-faq-subtext {
    font-size: 15px;
  }

  /* Tabs scroll horizontally on small screens */
  .fda-faq-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0;
  }

  .fda-faq-tabs::-webkit-scrollbar {
    display: none;
  }

  .fda-faq-tab-btn {
    padding: 12px 20px;
    font-size: 13px;
    flex-shrink: 0;
  }

  /* Question grid — single column on mobile */
  .fda-faq-category-panel.active.visible {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .fda-faq-question {
    padding: 20px;
  }

  .fda-faq-answer {
    padding: 0 20px 20px 20px;
  }
}

@media (max-width: 575.98px) {
  .fda-faq-header {
    margin-bottom: 48px;
  }
}
