import type { Metadata } from 'next';

export const metadata: Metadata = {
  title: 'Privacy Policy — DashCaddy',
  description: 'DashCaddy privacy policy. We collect nothing. Your data never leaves your server.',
};

export default function PrivacyPage() {
  return (
    <div className="min-h-screen bg-surface-950 text-surface-100">
      <div className="mx-auto max-w-3xl px-4 sm:px-6 lg:px-8 py-20">
        <h1 className="text-4xl font-bold mb-8 text-white">Privacy Policy</h1>
        <p className="text-surface-400 mb-8">Last updated: August 2026</p>

        <div className="prose prose-invert max-w-none space-y-6 text-surface-300 leading-relaxed">
          <section>
            <h2 className="text-2xl font-semibold text-white mb-4">The Short Version</h2>
            <p className="text-lg">
              <strong className="text-brand-400">We collect nothing. We track nothing. Your data never leaves your server.</strong>
            </p>
            <p>
              DashCaddy is self-hosted software. It runs entirely on your hardware. We have no servers in the middle, 
              no databases storing your information, and no analytics watching what you do. We literally cannot see your data.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-semibold text-white mb-4">What We Don&apos;t Collect</h2>
            <ul className="space-y-2">
              <li>✅ No telemetry or usage analytics</li>
              <li>✅ No error reporting sent to us (error tracking is opt-in and disabled by default)</li>
              <li>✅ No tracking pixels, cookies, or fingerprinting</li>
              <li>✅ No account creation required (TOTP-based auth, stored locally)</li>
              <li>✅ No data sold, shared, or transmitted to third parties</li>
              <li>✅ No advertising networks</li>
              <li>✅ No &quot;phone home&quot; functionality</li>
            </ul>
          </section>

          <section>
            <h2 className="text-2xl font-semibold text-white mb-4">What Lives on Your Server</h2>
            <p>
              All of your data — service configurations, credentials, SSL certificates, DNS records, backups, 
              and logs — stays on your machine. DashCaddy stores this in a local data directory on your server. 
              It is never transmitted to us or any third party.
            </p>
            <p>
              If you uninstall DashCaddy, you can delete the entire data directory. Nothing remains on external systems 
              because nothing was ever sent there.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-semibold text-white mb-4">VM Sandboxing &amp; Isolation</h2>
            <p>
              DashCaddy creates a bounded virtual disk (WSL2 on Windows, Lima on macOS, loopback ext4 on Linux) 
              that physically cannot exceed the storage limit you choose. Uninstalling DashCaddy removes the entire 
              virtual machine and disk image. Zero data leakage.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-semibold text-white mb-4">License Activation (Premium Only)</h2>
            <p>
              If you purchase a Premium license, the license key is validated locally. The initial activation 
              optionally contacts our license server to verify the key, but ongoing operation works fully offline. 
              No usage data is transmitted during validation — only the license key itself.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-semibold text-white mb-4">Your California Privacy Rights (CCPA)</h2>
            <p>
              If you are a California resident, you have rights under the California Consumer Privacy Act (CCPA):
            </p>
            <ul className="space-y-2">
              <li><strong>Right to Know:</strong> You can request what personal information we collect about you. (Answer: none.)</li>
              <li><strong>Right to Delete:</strong> You can request deletion of your personal information. (There&apos;s nothing to delete — it&apos;s all on your server.)</li>
              <li><strong>Right to Opt-Out:</strong> You can opt out of the sale of your personal information. (We don&apos;t sell anything. There&apos;s nothing to opt out of.)</li>
              <li><strong>Right to Non-Discrimination:</strong> You will not be treated differently for exercising these rights.</li>
            </ul>
            <p className="mt-4">
              To exercise any of these rights, contact us at{' '}
              <a href="mailto:support@dashcaddy.net" className="text-brand-400 hover:text-brand-300 font-medium">
                support@dashcaddy.net
              </a>. We will respond within 30 days.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-semibold text-white mb-4">Children&apos;s Privacy</h2>
            <p>
              DashCaddy does not knowingly collect any information from children under 13. Since we collect no 
              information from anyone, this is inherently satisfied.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-semibold text-white mb-4">Third-Party Services</h2>
            <p>
              DashCaddy deploys third-party applications (Docker containers) at your direction. These applications 
              are governed by their own privacy policies. DashCaddy itself does not integrate with or transmit data 
              to any third-party service.
            </p>
            <p>
              For payments, we use Stripe. Stripe&apos;s privacy policy applies to payment processing. We never see 
              or store your credit card information.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-semibold text-white mb-4">Changes to This Policy</h2>
            <p>
              If we ever change our privacy practices, we&apos;ll update this page. But our core commitment won&apos;t change: 
              DashCaddy is self-hosted. Your data stays yours.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-semibold text-white mb-4">Contact</h2>
            <p>
              Questions about privacy? Email us at{' '}
              <a href="mailto:support@dashcaddy.net" className="text-brand-400 hover:text-brand-300 font-medium">
                support@dashcaddy.net
              </a>
            </p>
          </section>
        </div>
      </div>
    </div>
  );
}
