/**
 * Canonical pricing page copy — shared between the public marketing pricing page
 * (Marketing/Pricing.tsx) and the authenticated billing plans page (Pricing.tsx).
 *
 * Update here and both pages stay in sync.
 */

import { BYOK_COST_PER_DRAFT_SHORT, PLAN_PRICES } from '@/config/plan-limits';

export interface FAQItem {
  question: string;
  answer: string;
}

interface PricingFaqParams {
  freeDrafts: number;
  proDrafts: number;
  proPrice: number;
}

export function getPricingFaqItems(params: PricingFaqParams): FAQItem[] {
  const { freeDrafts, proDrafts, proPrice } = params;

  return [
    {
      question: 'Do I need an OpenAI key to use RankWiz?',
      answer: `No. Every plan includes bundled AI drafts — no API key required to get started. Free users get ${freeDrafts} drafts/month. Pro and Team plans include ${proDrafts} and 200 drafts/month respectively. Power users on paid plans can optionally add their own OpenAI key (BYOK) for unlimited drafts at cost — typically $0.01–$0.05 per draft with no markup.`,
    },
    {
      question: "What's included in the free plan?",
      answer: `Free includes 1 WordPress site, monthly analysis runs, up to 25 pages analyzed per run, and ${freeDrafts} AI drafts per month. You get full access to traffic change detection, all 12 recommendation types, cannibalization detection, topic clustering, and freshness analysis. No credit card required.`,
    },
    {
      question: 'How does the Bring Your Own Key (BYOK) model work?',
      answer:
        "Pro and Team users can optionally connect their own OpenAI API key for unlimited AI drafts. You pay OpenAI directly for each draft generated — typically $0.01–$0.05 per draft. RankWiz doesn't mark up the cost. You keep full visibility into usage and can set spending limits in your OpenAI account. BYOK is an optional upgrade path — bundled AI works well for most users.",
    },
    {
      question: 'Can I cancel anytime?',
      answer:
        "Yes. There's no long-term contract. You can switch between plans at any time — upgrades take effect immediately and downgrades apply at the end of your current period. Monthly billing can be cancelled at the end of your current period. Annual billing can be downgraded to monthly at any time. All paid plans include a 30-day money-back guarantee — if you're not satisfied, contact us within 30 days of your first payment for a full refund, no questions asked.",
    },
    {
      question: 'Which plan should I choose?',
      answer: `Start free if you have 1 WordPress site and want to try RankWiz — no card needed. Upgrade to Pro ($${proPrice}/mo) when you need 2–5 sites, SERP scoring, or more AI drafts. Choose Team ($99/seat/mo) when you have a team or manage client sites and need white-label reporting and shared access. Enterprise is for publishers and large organizations — contact us for a quote.`,
    },
    {
      question: 'What if I need a custom plan?',
      answer:
        'Contact our sales team for enterprise pricing. We offer custom site limits, dedicated support, and volume discounts for agencies and large publishers.',
    },
    {
      question: 'Is my data private?',
      answer:
        'Your Google Search Console connection, WordPress content, and AI drafts are private by default. We never resell data or use it to train models. Data is encrypted in transit and at rest. See our privacy policy for full details.',
    },
  ];
}

/** Backward-compatible export using config defaults */
export const PRICING_FAQ_ITEMS: FAQItem[] = getPricingFaqItems({
  freeDrafts: 5,
  proDrafts: 30,
  proPrice: PLAN_PRICES.pro,
});

export const COMPETITIVE_PRICING_FAQ_ITEMS: FAQItem[] = [
  {
    question: 'How can RankWiz cost so much less than Semrush or Ahrefs?',
    answer:
      "RankWiz is purpose-built for WordPress content performance — not a general-purpose SEO suite. We don't maintain a backlink index, keyword database, or rank tracker. That focus means lower infrastructure costs. Plus our BYOK model means you pay OpenAI directly for AI drafts at cost (~$0.01–$0.05 each) with zero markup. The result: Pro-level WordPress SEO for a fraction of the price.",
  },
  {
    question: 'What features does RankWiz NOT have?',
    answer:
      "RankWiz doesn't include backlink analysis, a proprietary keyword research database, site crawling/auditing, or rank tracking beyond what Google Search Console provides. If those are core to your workflow, pair RankWiz with a tool like Ahrefs or Semrush — they complement each other well.",
  },
  {
    question: 'Can I use RankWiz alongside my existing SEO tools?',
    answer:
      'Absolutely. RankWiz reads your real Google Search Console data and focuses on content fixes, AI drafts, and ROI tracking. Use Ahrefs for backlinks, Semrush for competitor research, Rank Math for on-page — and RankWiz to close the loop: diagnose traffic drops, generate fixes, publish to WordPress, and prove what worked.',
  },
  {
    question: 'How does RankWiz work with Yoast SEO or Rank Math?',
    answer:
      'They complement each other perfectly. Yoast and Rank Math handle on-page technical SEO — XML sitemaps, schema markup, meta tag editing, and readability checks inside the WordPress editor. RankWiz sits on top of that: it connects to your real Google Search Console data, identifies which pages are actually losing traffic, generates AI-powered content fixes ranked by impact, publishes them to WordPress in one click, and tracks ROI to prove they worked. Think of Yoast/Rank Math as your on-page foundation and RankWiz as your content performance layer.',
  },
];

export const MONEY_BACK_GUARANTEE = {
  label: '30-day money-back guarantee',
  short: '30-day money-back',
  description:
    "Not satisfied? Contact us within 30 days of your first payment for a full refund — no questions asked.",
} as const;

export const BYOK_BULLETS = [
  `Pay OpenAI directly (${BYOK_COST_PER_DRAFT_SHORT})`,
  'Set your own spending limits in OpenAI',
  'No hidden fees or platform markup',
] as const;
