"use client";

const FAQS = [
  {
    q: "What makes meSEO different from SEMRush or Ahrefs?",
    a: "They estimate your traffic from third-party panels. We measure it directly with our Site Tag — first-party data from YOUR actual visitors. Plus we're the only platform that tracks your brand's visibility in ChatGPT, Perplexity, and other AI search engines.",
  },
  {
    q: "What are AI credits?",
    a: "AI credits power our AI Strategist conversations, content brief generation, schema markup generation, and AI-powered recommendations. Each AI interaction uses 1 credit. Most users on Professional use 200–400 credits/month.",
  },
  { q: "Can I switch plans anytime?", a: "Yes. Upgrade instantly and only pay the prorated difference. Downgrade at the end of your billing cycle — no penalties." },
  { q: "What happens when I hit my AI credit limit?", a: "You'll get a notification when you're at 80% usage. If you exceed the limit, AI features pause until the next billing cycle. You can upgrade anytime to get more credits immediately, or buy an AI Credit Pack (500 credits for $49)." },
  { q: "Can I add more brands without upgrading?", a: "Yes. Each plan has a brand limit, but you can buy extra brands as an add-on ($49–$79/mo depending on plan) without moving to the next tier." },
  { q: "Do you offer discounts for nonprofits/startups?", a: "Yes. We offer 30% off for verified nonprofits and early-stage startups (under $1M ARR). Contact us with proof of status." },
  { q: "What integrations are included?", a: "Google Search Console, Google Analytics 4, Google Business Profile, and the meSEO Site Tag are included at all tiers. Enterprise gets custom integrations (HubSpot, Salesforce, etc.)." },
  { q: "Is my data secure?", a: "All data is encrypted at rest and in transit. We use Clerk for authentication, Prisma for database access, and never store raw credentials — only encrypted tokens with automatic rotation." },
  {
    q: "Does meSEO use cookies?",
    a: "No. The meSEO Site Tag uses cookieless first-party tracking. No cookies are set on your visitors' browsers, so no cookie consent banner is needed for basic analytics tracking. Identifiers live in sessionStorage / localStorage, which aren't transmitted with HTTP requests and aren't covered by cookie-consent regulations. This also means meSEO works even when visitors block cookies.",
  },
];

export default function PricingFaq() {
  return (
    <div>
      <h2 className="text-2xl font-bold text-slate-900 text-center mb-8">Frequently Asked Questions</h2>
      <div className="max-w-3xl mx-auto space-y-3">
        {FAQS.map((faq, i) => (
          <details key={i} className="group bg-white rounded-xl border border-slate-200 overflow-hidden">
            <summary className="flex items-center justify-between px-5 py-4 cursor-pointer list-none">
              <span className="text-sm font-semibold text-slate-900 pr-4">{faq.q}</span>
              <span className="text-slate-400 group-open:rotate-45 transition-transform text-xl leading-none shrink-0">+</span>
            </summary>
            <p className="px-5 pb-4 text-sm text-slate-600 leading-relaxed">{faq.a}</p>
          </details>
        ))}
      </div>
    </div>
  );
}
