import type { ReactNode } from 'react';
import { PageHero } from '../components/ui/SectionHeading';
import { FadeIn } from '../components/ui/Motion';
import { SITE } from '../data/content';

function LegalLayout({ title, children }: { title: string; children: ReactNode }) {
  return (
    <>
      <PageHero title={title} />
      <section className="px-4 py-16">
        <FadeIn>
          <div className="prose-custom mx-auto max-w-3xl space-y-4 text-muted leading-relaxed">
            {children}
          </div>
        </FadeIn>
      </section>
    </>
  );
}

export function DisclaimerPage() {
  return (
    <LegalLayout title="Disclaimer">
      <p>
        Information on this website is general in nature and does not constitute professional advice.{' '}
        {SITE.name} recommends speaking with our team or qualified professionals before making decisions
        about NDIS supports.
      </p>
      <p>
        While we strive to keep content accurate and up to date, we do not warrant that the site is free
        from errors or omissions.
      </p>
    </LegalLayout>
  );
}

export function PrivacyPage() {
  return (
    <LegalLayout title="Privacy Policy">
      <p>
        {SITE.name} respects your privacy. Personal information collected through contact forms or
        consultations is used only to respond to enquiries and deliver services you request.
      </p>
      <p>
        We do not sell personal information. Data is stored securely and retained in line with applicable
        Australian privacy legislation. You may request access to or correction of your information by
        contacting {SITE.email}.
      </p>
    </LegalLayout>
  );
}

export function TermsPage() {
  return (
    <LegalLayout title="Terms of Use">
      <p>
        By using this website you agree to these terms. Content is owned by {SITE.name} unless otherwise
        stated. You may not reproduce material for commercial purposes without written permission.
      </p>
      <p>
        Links to third-party sites are provided for convenience; we are not responsible for their content
        or practices.
      </p>
    </LegalLayout>
  );
}

export function NotFoundPage() {
  return (
    <section className="flex flex-col items-center justify-center px-4 py-32 text-center">
      <h1 className="font-[family-name:var(--font-display)] text-6xl font-bold text-primary">404</h1>
      <p className="mt-4 text-muted">This page could not be found.</p>
      <a href="/" className="mt-8 text-primary font-semibold hover:underline">
        Return home
      </a>
    </section>
  );
}
