import type { Metadata } from "next";
import { LegalDoc, type LegalSection } from "@/components/marketing/legal-doc";

export const metadata: Metadata = { title: "Privacy Policy" };

const UPDATED = "June 7, 2026";

const SECTIONS: LegalSection[] = [
  {
    heading: "Information we collect",
    paragraphs: ["We collect the following categories of information to operate Podcast Distribution AI:"],
    bullets: [
      "Account information you provide — your name, email address, and password (passwords are stored only as salted hashes).",
      "Content you create — episode topics, prompts, configuration (tone, format, language, voices), generated scripts, audio, cover art, and repurposed content.",
      "Billing information — your plan, subscription status, and payment-provider customer IDs. Card and bank details are handled by our payment processors and are never stored on our servers.",
      "Usage and technical data — feature usage, monthly generation counts, API-key activity, IP address, browser/user-agent, and server logs used for security and debugging.",
    ],
  },
  {
    heading: "How we use your information",
    paragraphs: [
      "We use your information to provide and improve the service: to authenticate you, generate and store your episodes, enforce plan limits, process payments, send transactional email, prevent abuse, and meet legal obligations. We do not sell your personal data, and we do not use your private content to train our own models.",
    ],
  },
  {
    heading: "AI processing and sub-processors",
    paragraphs: [
      "Generating an episode requires sending the content you submit (and content derived from it) to our AI sub-processors so they can produce your script, audio, and artwork:",
    ],
    bullets: [
      "OpenAI — script generation, content moderation, and cover-art generation.",
      "ElevenLabs — text-to-speech and multi-speaker dialogue synthesis.",
      "These providers process your prompts and generated text under their own terms and security commitments. Only the data needed to perform the requested generation is shared.",
    ],
  },
  {
    heading: "Payments",
    paragraphs: [
      "Subscriptions are processed by Stripe and PayPal. When you check out you interact with the provider directly; we receive only confirmation of your subscription status and identifiers needed to manage it. Please review the privacy policies of Stripe and PayPal for how they handle your payment data.",
    ],
  },
  {
    heading: "Email",
    paragraphs: [
      "Transactional email (account verification, password resets, and episode-ready notifications) is delivered through Resend. We send only the information necessary to deliver these messages.",
    ],
  },
  {
    heading: "Data retention",
    paragraphs: [
      "We retain your account and content for as long as your account is active. Generated assets (audio and artwork) are stored so we can deliver your episodes. When you delete an episode it is removed from our systems; when you delete your account, your personal data and content are deleted or anonymized except where we must retain records to comply with legal, tax, or accounting obligations.",
    ],
  },
  {
    heading: "Your rights",
    paragraphs: [
      "Depending on where you live, you may have rights to access, correct, export, or delete your personal data, and to object to or restrict certain processing. You can edit your profile and delete your content from within the app, or contact us to exercise any of these rights. We will not discriminate against you for exercising them.",
    ],
  },
  {
    heading: "Cookies and sessions",
    paragraphs: [
      "We use strictly-necessary cookies to keep you signed in and to secure your session. We do not use third-party advertising cookies.",
    ],
  },
  {
    heading: "Security",
    paragraphs: [
      "We protect your data with encryption in transit, hashed credentials and API keys, scoped access controls, signed billing webhooks, and least-privilege storage. No method of transmission or storage is perfectly secure, but we work to protect your information and to respond promptly to any incident.",
    ],
  },
  {
    heading: "Children",
    paragraphs: [
      "Podcast Distribution AI is not directed to children under 13 (or the minimum age required in your jurisdiction), and we do not knowingly collect their personal data.",
    ],
  },
  {
    heading: "International transfers",
    paragraphs: [
      "We and our sub-processors may process your data in countries other than your own. Where required, we rely on appropriate safeguards for such transfers.",
    ],
  },
  {
    heading: "Changes to this policy",
    paragraphs: [
      "We may update this policy from time to time. Material changes will be reflected by updating the date above and, where appropriate, by notifying you.",
    ],
  },
  {
    heading: "Contact",
    paragraphs: [
      "Questions about this policy or your data? Email privacy@podcastdistributionai.com and we'll be glad to help.",
    ],
  },
];

export default function PrivacyPage() {
  return (
    <LegalDoc
      title="Privacy Policy"
      updated={UPDATED}
      intro="This Privacy Policy explains what information Podcast Distribution AI collects, how we use it, who we share it with, and the choices you have. It applies to your use of the Podcast Distribution AI website and application."
      sections={SECTIONS}
    />
  );
}
