import type { Metadata } from "next";
import { PageHero } from "@/components/site/page-hero";
import { getSettings } from "@/lib/queries";

export const metadata: Metadata = {
  title: "Privacy Policy",
  description: "Privacy policy for AL-HASAN ENGINEERING SERVICE (AHE Services) website.",
  alternates: { canonical: "/privacy-policy" },
};

export default async function PrivacyPage() {
  const settings = await getSettings();
  const company = settings?.companyName ?? "AL-HASAN ENGINEERING SERVICE";
  const email = settings?.email ?? "alhasanengineeringservice@gmail.com";

  return (
    <>
      <PageHero eyebrow="Legal" title="Privacy Policy" breadcrumbs={[{ label: "Privacy Policy" }]} />
      <section className="py-16 lg:py-24">
        <div className="container-mx max-w-3xl prose prose-lg">
          <p className="text-muted-foreground">Last updated: {new Date().toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric" })}</p>

          <h2 className="text-foreground">1. Introduction</h2>
          <p className="text-muted-foreground">{company} ("we", "us", "our") respects your privacy and is committed to protecting your personal data. This policy explains how we collect, use and safeguard information you provide through our website.</p>

          <h2 className="text-foreground">2. Information We Collect</h2>
          <p className="text-muted-foreground">We collect information you voluntarily provide when you contact us, request a quote or use our services, including:</p>
          <ul className="text-muted-foreground">
            <li>Name, phone number and email address</li>
            <li>Service requirements and project details</li>
            <li>Address and facility information (when relevant)</li>
            <li>Website usage data via cookies and analytics</li>
          </ul>

          <h2 className="text-foreground">3. How We Use Your Information</h2>
          <ul className="text-muted-foreground">
            <li>To respond to your inquiries and provide quotations</li>
            <li>To deliver and manage HVAC services and AMC contracts</li>
            <li>To send service updates, reminders and important notices</li>
            <li>To improve our website, services and customer experience</li>
            <li>To comply with legal and regulatory obligations</li>
          </ul>

          <h2 className="text-foreground">4. Information Sharing</h2>
          <p className="text-muted-foreground">We do not sell, trade or rent your personal information to third parties. We may share data with trusted partners who assist us in operating our business (e.g. equipment suppliers), under strict confidentiality agreements.</p>

          <h2 className="text-foreground">5. Data Security</h2>
          <p className="text-muted-foreground">We implement appropriate technical and organizational measures to protect your personal data against unauthorized access, alteration, disclosure or destruction.</p>

          <h2 className="text-foreground">6. Cookies</h2>
          <p className="text-muted-foreground">Our website uses cookies to enhance your browsing experience and analyze traffic. You can control cookies through your browser settings.</p>

          <h2 className="text-foreground">7. Your Rights</h2>
          <p className="text-muted-foreground">You have the right to access, correct or request deletion of your personal data. To exercise these rights, contact us at <a href={`mailto:${email}`} className="text-[var(--brand-royal)]">{email}</a>.</p>

          <h2 className="text-foreground">8. Contact Us</h2>
          <p className="text-muted-foreground">For privacy-related questions, please contact us at <a href={`mailto:${email}`} className="text-[var(--brand-royal)]">{email}</a> or call {settings?.phone ?? "0301-2435144"}.</p>
        </div>
      </section>
    </>
  );
}
