import { Metadata } from "next"

export const metadata: Metadata = {
    title: "Privacy Policy - Elmeg",
    description: "Privacy Policy for Elmeg, a community archive platform for live music fans.",
}

export default function PrivacyPage() {
    return (
        <div className="max-w-3xl mx-auto py-8">
            <h1 className="text-4xl font-bold mb-2">Privacy Policy</h1>
            <p className="text-muted-foreground mb-8">Last updated: December 21, 2024</p>

            <div className="prose prose-neutral dark:prose-invert max-w-none space-y-8">
                <section>
                    <h2 className="text-2xl font-semibold mb-4">1. Introduction</h2>
                    <p className="text-muted-foreground leading-relaxed">
                        Elmeg ("we," "our," or "us") respects your privacy and is committed to protecting your
                        personal data. This Privacy Policy explains how we collect, use, disclose, and safeguard
                        your information when you use our Service.
                    </p>
                </section>

                <section>
                    <h2 className="text-2xl font-semibold mb-4">2. Information We Collect</h2>
                    <div className="text-muted-foreground leading-relaxed space-y-4">
                        <div>
                            <h3 className="text-lg font-medium text-foreground mb-2">Information You Provide</h3>
                            <ul className="list-disc pl-6 space-y-2">
                                <li><strong>Account Information:</strong> Email address, username, and password when you register</li>
                                <li><strong>Profile Information:</strong> Display name, bio, and avatar (optional)</li>
                                <li><strong>User Content:</strong> Reviews, comments, ratings, and other contributions you make</li>
                                <li><strong>Communications:</strong> Messages you send to us for support</li>
                            </ul>
                        </div>

                        <div>
                            <h3 className="text-lg font-medium text-foreground mb-2">Information Collected Automatically</h3>
                            <ul className="list-disc pl-6 space-y-2">
                                <li><strong>Log Data:</strong> IP address, browser type, pages visited, and access times</li>
                                <li><strong>Device Information:</strong> Device type, operating system, and unique device identifiers</li>
                                <li><strong>Cookies:</strong> Session cookies for authentication and preferences</li>
                            </ul>
                        </div>
                    </div>
                </section>

                <section>
                    <h2 className="text-2xl font-semibold mb-4">3. How We Use Your Information</h2>
                    <div className="text-muted-foreground leading-relaxed">
                        <p className="mb-3">We use your information to:</p>
                        <ul className="list-disc pl-6 space-y-2">
                            <li>Provide, maintain, and improve the Service</li>
                            <li>Create and manage your account</li>
                            <li>Process your ratings, reviews, and other contributions</li>
                            <li>Send transactional emails (account verification, password resets, security alerts)</li>
                            <li>Respond to your inquiries and support requests</li>
                            <li>Detect and prevent fraud, abuse, and security issues</li>
                            <li>Analyze usage patterns to improve user experience</li>
                            <li>Comply with legal obligations</li>
                        </ul>
                    </div>
                </section>

                <section>
                    <h2 className="text-2xl font-semibold mb-4">4. Information Sharing</h2>
                    <div className="text-muted-foreground leading-relaxed space-y-3">
                        <p>
                            <strong className="text-foreground">We do not sell your personal data.</strong> We may
                            share your information only in the following circumstances:
                        </p>
                        <ul className="list-disc pl-6 space-y-2">
                            <li><strong>Public Content:</strong> Reviews, comments, and ratings are visible to other users</li>
                            <li><strong>Service Providers:</strong> Third-party vendors who assist in operating the Service (e.g., email delivery, hosting)</li>
                            <li><strong>Legal Requirements:</strong> When required by law or to protect our rights and safety</li>
                            <li><strong>Business Transfers:</strong> In connection with a merger, acquisition, or sale of assets</li>
                        </ul>
                    </div>
                </section>

                <section>
                    <h2 className="text-2xl font-semibold mb-4">5. Data Security</h2>
                    <p className="text-muted-foreground leading-relaxed">
                        We implement industry-standard security measures to protect your personal data, including:
                    </p>
                    <ul className="list-disc pl-6 space-y-2 text-muted-foreground mt-3">
                        <li>Encryption of data in transit (HTTPS/TLS)</li>
                        <li>Secure password hashing</li>
                        <li>Regular security audits and updates</li>
                        <li>Access controls and authentication</li>
                    </ul>
                    <p className="text-muted-foreground leading-relaxed mt-3">
                        However, no method of transmission over the Internet is 100% secure, and we cannot
                        guarantee absolute security.
                    </p>
                </section>

                <section>
                    <h2 className="text-2xl font-semibold mb-4">6. Data Retention</h2>
                    <p className="text-muted-foreground leading-relaxed">
                        We retain your personal data for as long as your account is active or as needed to provide
                        the Service. We may retain certain information as required by law or for legitimate business
                        purposes (e.g., resolving disputes, enforcing agreements). If you delete your account, we
                        will delete or anonymize your personal data within 30 days, except where retention is required.
                    </p>
                </section>

                <section>
                    <h2 className="text-2xl font-semibold mb-4">7. Your Rights</h2>
                    <div className="text-muted-foreground leading-relaxed">
                        <p className="mb-3">Depending on your jurisdiction, you may have the right to:</p>
                        <ul className="list-disc pl-6 space-y-2">
                            <li><strong>Access:</strong> Request a copy of your personal data</li>
                            <li><strong>Correction:</strong> Request correction of inaccurate data</li>
                            <li><strong>Deletion:</strong> Request deletion of your personal data</li>
                            <li><strong>Portability:</strong> Request transfer of your data to another service</li>
                            <li><strong>Objection:</strong> Object to certain processing of your data</li>
                            <li><strong>Withdrawal:</strong> Withdraw consent where processing is based on consent</li>
                        </ul>
                        <p className="mt-3">
                            To exercise these rights, contact us at{" "}
                            <a href="mailto:privacy@elmeg.xyz" className="text-primary hover:underline">
                                privacy@elmeg.xyz
                            </a>.
                        </p>
                    </div>
                </section>

                <section>
                    <h2 className="text-2xl font-semibold mb-4">8. Cookies</h2>
                    <div className="text-muted-foreground leading-relaxed">
                        <p className="mb-3">We use the following types of cookies:</p>
                        <ul className="list-disc pl-6 space-y-2">
                            <li><strong>Essential Cookies:</strong> Required for authentication and security</li>
                            <li><strong>Preference Cookies:</strong> Remember your settings (e.g., theme preference)</li>
                        </ul>
                        <p className="mt-3">
                            We do not use advertising or tracking cookies. You can control cookies through your
                            browser settings, though disabling essential cookies may affect Service functionality.
                        </p>
                    </div>
                </section>

                <section>
                    <h2 className="text-2xl font-semibold mb-4">9. Children's Privacy</h2>
                    <p className="text-muted-foreground leading-relaxed">
                        The Service is not intended for children under 13. We do not knowingly collect personal
                        data from children under 13. If you believe we have collected such data, please contact
                        us immediately, and we will take steps to delete it.
                    </p>
                </section>

                <section>
                    <h2 className="text-2xl font-semibold mb-4">10. International Data Transfers</h2>
                    <p className="text-muted-foreground leading-relaxed">
                        Your data may be processed in countries other than your own. We take appropriate
                        safeguards to ensure your data receives adequate protection in accordance with this
                        Privacy Policy and applicable law.
                    </p>
                </section>

                <section>
                    <h2 className="text-2xl font-semibold mb-4">11. Changes to This Policy</h2>
                    <p className="text-muted-foreground leading-relaxed">
                        We may update this Privacy Policy from time to time. We will notify you of material
                        changes via email or through the Service. Your continued use after such changes
                        constitutes acceptance of the updated policy.
                    </p>
                </section>

                <section>
                    <h2 className="text-2xl font-semibold mb-4">12. Contact Us</h2>
                    <div className="text-muted-foreground leading-relaxed">
                        <p>If you have questions about this Privacy Policy or our data practices, contact us at:</p>
                        <div className="mt-4 p-4 bg-muted/50 rounded-lg">
                            <p><strong className="text-foreground">Email:</strong>{" "}
                                <a href="mailto:privacy@elmeg.xyz" className="text-primary hover:underline">
                                    privacy@elmeg.xyz
                                </a>
                            </p>
                            <p className="mt-2"><strong className="text-foreground">General Support:</strong>{" "}
                                <a href="mailto:support@elmeg.xyz" className="text-primary hover:underline">
                                    support@elmeg.xyz
                                </a>
                            </p>
                        </div>
                    </div>
                </section>
            </div>
        </div>
    )
}
