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

export const metadata: Metadata = {
  title: "Cookie Policy | Affiliate+",
  description:
    "How Affiliate+ uses cookies and similar technologies, and how you can manage your preferences in line with applicable data protection laws.",
}

export default function CookiePolicyPage() {
  return (
    <div className="min-h-screen bg-gray-50 py-10 px-4 sm:px-6 lg:px-8">
      <div className="max-w-3xl mx-auto bg-white rounded-2xl border border-gray-100 shadow-sm p-6 sm:p-10">
        <h1 className="text-2xl sm:text-3xl font-bold text-gray-900 mb-2">Cookie Policy</h1>
        <p className="text-sm text-gray-500 mb-8">Last updated: {new Date().toLocaleDateString("en-GB", { day: "numeric", month: "long", year: "numeric" })}</p>

        <div className="prose prose-gray max-w-none space-y-6 text-gray-700">
          <section>
            <h2 className="text-lg font-semibold text-gray-900">1. What are cookies?</h2>
            <p>
              Cookies are small text files stored on your device when you visit a website. They help
              the site remember your preferences, keep you signed in, and understand how the service
              is used. We also use similar technologies such as local storage and pixels.
            </p>
          </section>

          <section>
            <h2 className="text-lg font-semibold text-gray-900">2. How we use cookies</h2>
            <ul className="list-disc pl-5 space-y-1">
              <li><strong>Essential cookies</strong>, required for authentication, security, and core functionality.</li>
              <li><strong>Preference cookies</strong>, remember your language, currency, and consent choices.</li>
              <li><strong>Analytics cookies</strong>, help us measure traffic and improve the platform.</li>
              <li><strong>Advertising cookies</strong>, used by third-party partners to show relevant ads.</li>
            </ul>
          </section>

          <section>
            <h2 className="text-lg font-semibold text-gray-900">3. Third-party cookies</h2>
            <p>
              We use trusted third-party services (such as Google Analytics, Meta Pixel, and
              Cloudflare Turnstile) that may set their own cookies. These providers process data
              under their own privacy policies.
            </p>
          </section>

          <section>
            <h2 className="text-lg font-semibold text-gray-900">4. Managing your preferences</h2>
            <p>
              You can control or delete cookies through your browser settings. Disabling essential
              cookies may prevent parts of the platform from working correctly. You may withdraw
              consent at any time by clearing your browser storage.
            </p>
          </section>

          <section>
            <h2 className="text-lg font-semibold text-gray-900">5. Data protection</h2>
            <p>
              We process personal data responsibly and in line with applicable data protection laws.
              For more information on how we collect, use, and protect your data, please read our{" "}
              <Link href="/privacy-policy" className="text-purple-600 underline">
                Privacy Policy
              </Link>
              .
            </p>
          </section>

          <section>
            <h2 className="text-lg font-semibold text-gray-900">6. Contact</h2>
            <p>
              For questions about this Cookie Policy, contact us via the{" "}
              <Link href="/contact" className="text-purple-600 underline">
                Contact page
              </Link>
              .
            </p>
          </section>
        </div>
      </div>
    </div>
  )
}