import React from "react";
import type { Metadata } from "next";
import Header from "@/components/Header";
import Footer from "@/components/Footer";

export const metadata: Metadata = {
  title: "Privacy Policy — AV Beat",
  description: "AV Beat Privacy Policy — how we collect, use, and protect your personal information. GDPR and CCPA compliant.",
  alternates: {
    canonical: "/privacy",
  },
};

export default function PrivacyPage() {
  return (
    <div className="min-h-screen bg-background">
      <Header />
      <div className="bg-[#111] border-b border-[#222] py-8">
        <div className="max-w-container mx-auto px-4">
          <h1 className="font-heading text-[#0F172A] text-3xl font-bold">Privacy Policy</h1>
          <p className="text-[#475569] font-body text-sm mt-2">Last updated: April 2026 — JTR Media Properties</p>
        </div>
      </div>
      <main id="main-content" className="max-w-container mx-auto px-4 py-10">
        <div className="max-w-3xl space-y-8 font-body text-[#1e293b] leading-relaxed">

          <section aria-labelledby="section-intro">
            <p id="section-intro">
              This website is owned by <strong className="text-[#0F172A]">JTR Media Properties</strong>. Advertising and media representation services are provided by Relevant Media Properties, LLC, an independent company. This Privacy Policy explains how information is collected, used, and protected when you visit this site.
            </p>
          </section>

          <section aria-labelledby="section-1">
            <h2 id="section-1" className="font-heading text-[#0F172A] text-xl font-bold mb-3">1. Information We Collect</h2>
            <h3 className="font-heading text-[#1e293b] text-base font-semibold mb-2">Information You Provide</h3>
            <p>We collect information you provide directly to us, such as when you subscribe to our newsletter, create an account, post in our forum, or contact us. This may include your name, email address, username, and professional information.</p>
            <h3 className="font-heading text-[#1e293b] text-base font-semibold mb-2 mt-4">Information Collected Automatically</h3>
            <p className="mt-2">We also collect information automatically when you use our sites, including:</p>
            <ul className="list-disc list-inside mt-2 space-y-1 text-[#475569]">
              <li>IP address and approximate geographic location</li>
              <li>Browser type, version, and operating system</li>
              <li>Pages visited, time spent, and referring URLs</li>
              <li>Device identifiers and cookie data</li>
              <li>Interaction data (clicks, scrolls, video plays)</li>
            </ul>
            <h3 className="font-heading text-[#1e293b] text-base font-semibold mb-2 mt-4">Cookies and Tracking Technologies</h3>
            <p className="mt-2">We use cookies, web beacons, and similar tracking technologies. You can control cookie preferences through our cookie consent banner or your browser settings. Essential cookies required for site functionality cannot be disabled.</p>
          </section>

          <section aria-labelledby="section-2">
            <h2 id="section-2" className="font-heading text-[#0F172A] text-xl font-bold mb-3">2. How We Use Your Information</h2>
            <p>We use the information we collect to:</p>
            <ul className="list-disc list-inside mt-2 space-y-1 text-[#475569]">
              <li>Provide, maintain, and improve our editorial content and services</li>
              <li>Send newsletters and editorial content you have subscribed to</li>
              <li>Respond to your comments, questions, and support requests</li>
              <li>Analyze usage patterns to improve site performance and content</li>
              <li>Serve relevant advertising through our ad operations platform</li>
              <li>Detect and prevent fraud, abuse, and security incidents</li>
              <li>Comply with legal obligations</li>
            </ul>
            <p className="mt-3"><strong className="text-[#1e293b]">Legal basis (GDPR):</strong> We process your data based on consent (newsletter subscriptions, analytics cookies), legitimate interests (site security, fraud prevention), and contractual necessity (account management).</p>
          </section>

          <section aria-labelledby="section-3">
            <h2 id="section-3" className="font-heading text-[#0F172A] text-xl font-bold mb-3">3. Information Sharing</h2>
            <p>We do not sell your personal information. We may share information with:</p>
            <ul className="list-disc list-inside mt-2 space-y-1 text-[#475569]">
              <li><strong className="text-[#1e293b]">Service providers</strong> who assist in operating our websites (hosting, email delivery, analytics)</li>
              <li><strong className="text-[#1e293b]">Advertising partners</strong> for serving and measuring ad campaigns (subject to your consent)</li>
              <li><strong className="text-[#1e293b]">Legal authorities</strong> when required by law or to protect our rights</li>
              <li><strong className="text-[#1e293b]">Business successors</strong> in the event of a merger, acquisition, or sale of assets</li>
            </ul>
          </section>

          <section aria-labelledby="section-4">
            <h2 id="section-4" className="font-heading text-[#0F172A] text-xl font-bold mb-3">4. Cookies Policy</h2>
            <p>We use the following categories of cookies:</p>
            <div className="mt-3 space-y-3">
              <div className="bg-[#FFFFFF] border border-[#DCE6F2] rounded p-3">
                <p className="font-bold text-[#1e293b] text-sm">Essential Cookies</p>
                <p className="text-sm mt-1">Required for the website to function. Cannot be disabled. Includes session management and security tokens.</p>
              </div>
              <div className="bg-[#FFFFFF] border border-[#DCE6F2] rounded p-3">
                <p className="font-bold text-[#1e293b] text-sm">Analytics Cookies</p>
                <p className="text-sm mt-1">Help us understand how visitors interact with our site (Google Analytics). Requires your consent.</p>
              </div>
              <div className="bg-[#FFFFFF] border border-[#DCE6F2] rounded p-3">
                <p className="font-bold text-[#1e293b] text-sm">Advertising Cookies</p>
                <p className="text-sm mt-1">Used to serve relevant ads and measure campaign performance. Requires your consent.</p>
              </div>
            </div>
          </section>

          <section aria-labelledby="section-5">
            <h2 id="section-5" className="font-heading text-[#0F172A] text-xl font-bold mb-3">5. Your Rights</h2>
            <p>Depending on your location, you may have the following rights regarding your personal data:</p>
            <ul className="list-disc list-inside mt-2 space-y-1 text-[#475569]">
              <li><strong className="text-[#1e293b]">Access:</strong> Request a copy of the personal data we hold about you</li>
              <li><strong className="text-[#1e293b]">Correction:</strong> Request correction of inaccurate or incomplete data</li>
              <li><strong className="text-[#1e293b]">Deletion:</strong> Request deletion of your personal data ("right to be forgotten")</li>
              <li><strong className="text-[#1e293b]">Portability:</strong> Receive your data in a structured, machine-readable format</li>
              <li><strong className="text-[#1e293b]">Opt-out (CCPA):</strong> California residents may opt out of the sale of personal information</li>
              <li><strong className="text-[#1e293b]">Unsubscribe:</strong> Opt out of marketing emails at any time via the unsubscribe link</li>
            </ul>
            <p className="mt-3">To exercise any of these rights, contact us at <a href="mailto:privacy@avbeat.com" className="text-[#1D4ED8] underline hover:text-blue-400 transition-colors">privacy@avbeat.com</a>. We will respond within 30 days.</p>
          </section>

          <section aria-labelledby="section-6">
            <h2 id="section-6" className="font-heading text-[#0F172A] text-xl font-bold mb-3">6. Data Retention</h2>
            <p>We retain personal data for as long as necessary to provide our services and comply with legal obligations. Newsletter subscriber data is retained until you unsubscribe. Account data is retained for the life of your account plus 90 days after deletion.</p>
          </section>

          <section aria-labelledby="section-7">
            <h2 id="section-7" className="font-heading text-[#0F172A] text-xl font-bold mb-3">7. Children's Privacy</h2>
            <p>Our services are not directed to children under 13 years of age. We do not knowingly collect personal information from children under 13. If you believe we have inadvertently collected such information, please contact us immediately.</p>
          </section>

          <section aria-labelledby="section-8">
            <h2 id="section-8" className="font-heading text-[#0F172A] text-xl font-bold mb-3">8. Changes to This Policy</h2>
            <p>We may update this Privacy Policy from time to time. We will notify you of significant changes by posting a notice on our website or sending an email to newsletter subscribers. Your continued use of our services after changes take effect constitutes acceptance of the updated policy.</p>
          </section>

          <section aria-labelledby="section-9">
            <h2 id="section-9" className="font-heading text-[#0F172A] text-xl font-bold mb-3">9. Contact Us</h2>
            <p>For privacy-related questions, data requests, or to report a concern:</p>
            <address className="not-italic mt-3 space-y-1 text-[#475569]">
              <p><strong className="text-[#1e293b]">JTR Media Properties</strong></p>
              <p>Privacy Officer</p>
              <p>Email: <a href="mailto:privacy@avbeat.com" className="text-[#1D4ED8] underline hover:text-blue-400 transition-colors">privacy@avbeat.com</a></p>
            </address>
          </section>

        </div>
      </main>
      <Footer />
    </div>
  );
}
