import type { Metadata } from "next"
import Link from "next/link"
import { Suspense } from "react"

import FAQAccordion from "@/components/pro/FAQAccordion"
import PricingCards from "@/components/pro/PricingCards"

export function generateMetadata(): Metadata {
  return {
    title: "Parallax Pro",
    description:
      "Weekly geopolitical analysis, Data Boards, and in-depth Guides. Join Parallax Pro.",
    openGraph: {
      type: "website",
      title: "Parallax Pro",
      description:
        "Weekly geopolitical analysis, Data Boards, and in-depth Guides. Join Parallax Pro.",
    },
  }
}

const features = [
  {
    icon: "📰",
    title: "Pro Weekly",
    body: "Every week we revisit one significant geopolitical event from the past 3-18 months — when the data is in and the dust has settled. Applied analysis, not hot takes.",
  },
  {
    icon: "📊",
    title: "Data Boards",
    body: "Interactive maps and charts you can explore hands-on. Military strength by country, global shipping chokepoints, economies and populations, AI geopolitics. Updated weekly.",
  },
  {
    icon: "📖",
    title: "Pf Guides",
    body: "Long-form reports on the broadest topics — conflict histories, alliance structures, economic blocs. Quarterly releases. Yearly subscribers only.",
  },
  {
    icon: "💬",
    title: "Community",
    body: "Comment, vote, and discuss every report with other Pro members. Moderated for quality. No social media noise.",
  },
]

const stats = [
  { value: "500+", label: "Pro members" },
  { value: "40+", label: "Reports published" },
  { value: "Weekly", label: "New Pro analysis" },
]

export default function ProPage() {
  return (
    <main className="min-h-screen bg-[var(--color-bg)]">
      <section className="mx-auto max-w-[760px] px-6 pb-16 pt-32 text-center">
        <p className="text-[11px] font-semibold uppercase tracking-widest text-[#7c3aed]">
          PARALLAX PRO
        </p>
        <h1 className="mt-3 font-serif text-[clamp(2.8rem,6vw,4.2rem)] font-normal leading-[1.15] text-[var(--color-text-primary)]">
          Miss nothing.
        </h1>
        <p className="mx-auto mt-4 max-w-[580px] text-lg leading-[1.7] text-[var(--color-text-secondary)]">
          Weekly geopolitical event analysis, interactive Data Boards, long-form
          Guides, and a community of curious minds.
        </p>
        <p className="mt-4 text-[13px] italic text-[var(--color-text-secondary)]">
          Join 500+ Pro members including senior analysts and policy
          professionals.
        </p>
      </section>

      <Suspense
        fallback={
          <div className="px-6 pb-16 text-center text-sm text-[var(--color-text-secondary)]">
            Loading...
          </div>
        }
      >
        <PricingCards />
      </Suspense>

      <section className="mx-auto max-w-[1000px] border-t border-[var(--color-border)] px-6 pb-16 pt-4">
        <p className="mb-2 text-[11px] font-semibold uppercase tracking-widest text-[var(--color-accent)]">
          WHAT YOU GET
        </p>
        <h2 className="mb-10 font-serif text-3xl font-normal text-[var(--color-text-primary)]">
          Everything in Pro.
        </h2>
        <div className="grid gap-6 md:grid-cols-2">
          {features.map((feature) => (
            <article
              key={feature.title}
              className="rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-6"
            >
              <div className="mb-3 inline-block rounded bg-[var(--color-tag-bg)] p-2 text-xl">
                {feature.icon}
              </div>
              <h3 className="font-serif text-lg text-[var(--color-text-primary)]">
                {feature.title}
              </h3>
              <p className="mt-2 text-[13px] leading-[1.7] text-[var(--color-text-secondary)]">
                {feature.body}
              </p>
            </article>
          ))}
        </div>
      </section>

      <section className="border-y border-[var(--color-border)] bg-[var(--color-surface)] py-12">
        <div className="mx-auto flex max-w-[1000px] flex-wrap justify-center gap-8 px-6 md:gap-16">
          {stats.map((stat) => (
            <div key={stat.label} className="text-center">
              <p className="font-serif text-[2.5rem] leading-none text-[var(--color-text-primary)]">
                {stat.value}
              </p>
              <p className="mt-2 text-[13px] text-[var(--color-text-secondary)]">
                {stat.label}
              </p>
            </div>
          ))}
        </div>
      </section>

      <FAQAccordion />

      <section className="px-6 py-20">
        <div className="mx-auto max-w-[640px] rounded-2xl bg-[var(--color-surface)] p-10 text-center">
          <h2 className="font-serif text-[2.2rem] font-normal text-[var(--color-text-primary)]">
            Ready to go deeper?
          </h2>
          <p className="mt-3 text-[15px] leading-7 text-[var(--color-text-secondary)]">
            Join Parallax Pro and get the analysis that matters — every week,
            without the noise.
          </p>
          <div className="mt-6 flex flex-col items-center justify-center gap-3 sm:flex-row">
            <Link
              href="/pro/checkout?plan=monthly"
              className="rounded bg-[var(--color-accent)] px-6 py-3 text-sm font-medium text-white transition hover:bg-[var(--color-accent-hover)]"
            >
              Subscribe Monthly
            </Link>
            <Link
              href="/pro/checkout?plan=yearly"
              className="rounded border border-[var(--color-border)] px-6 py-3 text-sm font-medium text-[var(--color-text-primary)] transition hover:border-[var(--color-accent)]"
            >
              Subscribe Yearly
            </Link>
          </div>
          <p className="mt-4 text-xs text-[var(--color-text-secondary)]">
            Secure checkout via Stripe. Cancel anytime.
          </p>
        </div>
      </section>
    </main>
  )
}
