import type { Metadata } from 'next';
import Link from 'next/link';
import { AlertTriangle, Mail, ShieldAlert } from 'lucide-react';
import { BrowsePageHero } from '@/components/layout/BrowsePageHero';
import { Button } from '@/components/ui/button';

export const metadata: Metadata = {
  title: 'Disclaimer',
  description:
    'Important information about eHandyHire as a marketplace platform and the independent relationship between workers, customers, and our company.',
};

const sections = [
  {
    title: 'Marketplace platform only',
    body: [
      'eHandyHire is an online marketplace that helps customers discover independent workers and post job opportunities across the Philippines.',
      'We provide tools to browse profiles, post jobs, receive quotations, and communicate through the platform. We do not perform the physical work ourselves.',
    ],
  },
  {
    title: 'Workers are independent — not our employees',
    body: [
      'Workers listed on eHandyHire are independent contractors or self-employed individuals. They are not employees, agents, partners, or representatives of eHandyHire.',
      'Any agreement, payment arrangement, schedule, or scope of work is strictly between the customer and the worker. eHandyHire is not a party to those arrangements.',
    ],
  },
  {
    title: 'No employment or agency relationship',
    body: [
      'Using eHandyHire does not create an employer–employee, principal–agent, joint venture, or franchise relationship between you and our company.',
      'We do not direct how workers perform their services, set their working hours, or guarantee their availability, pricing, or results.',
    ],
  },
  {
    title: 'Verification and ratings',
    body: [
      'Where offered, identity checks, profile reviews, or badges are intended to improve trust on the platform. They are not a guarantee of skill, safety, licensing, insurance, or suitability for a particular job.',
      'Customers are responsible for evaluating workers, asking questions, and deciding who to hire.',
    ],
  },
  {
    title: 'Your responsibility',
    body: [
      'You agree to use your own judgment before hiring, meeting, or allowing anyone into your home or property.',
      'You should confirm licenses, permits, or certifications when required for the type of work (for example electrical, plumbing, or construction-related services).',
      'Any dispute regarding quality of work, payment, damage, injury, delay, or non-performance must be resolved directly between the customer and the worker.',
    ],
  },
  {
    title: 'Limitation of liability',
    body: [
      'To the fullest extent permitted by applicable law, eHandyHire and its owners, officers, employees, and affiliates shall not be liable for any loss, injury, death, property damage, theft, fraud, or other harm arising from:',
    ],
    list: [
      'Services performed or not performed by a worker or customer',
      'Meetings, communications, or transactions on or off the platform',
      'Reliance on profile information, reviews, or quotations',
      'Acts or omissions of any user of the platform',
    ],
    footer:
      'Our total liability for any claim relating to the platform is limited to the amount you paid to eHandyHire for platform fees in the twelve (12) months before the claim, or zero if no such fees were paid.',
  },
  {
    title: 'Assumption of risk',
    body: [
      'You acknowledge that hiring independent service providers carries inherent risks. By using eHandyHire, you voluntarily assume those risks and release eHandyHire from claims arising from interactions with other users, except where liability cannot be excluded under Philippine law.',
    ],
  },
  {
    title: 'Reporting concerns',
    body: [
      'If you encounter suspicious activity, harassment, or a serious safety issue, please contact us so we can review the account and take appropriate platform action. Reporting does not make eHandyHire responsible for resolving private disputes or compensating parties.',
    ],
  },
  {
    title: 'Changes to this disclaimer',
    body: [
      'We may update this page from time to time. Continued use of eHandyHire after changes are posted constitutes acceptance of the updated disclaimer.',
      'Last updated: June 18, 2026.',
    ],
  },
];

export default function DisclaimerPage() {
  return (
    <div className="workers-directory">
      <BrowsePageHero
        variant="directory"
        leading={<ShieldAlert className="h-7 w-7" />}
        eyebrow="Legal notice"
        title="Disclaimer"
        description="Please read this carefully. eHandyHire connects customers with independent workers. We are not responsible for the work performed or agreements made between users."
        actions={[
          { href: '/contact', label: 'Contact us', icon: Mail, variant: 'accent' },
        ]}
      />

      <div className="page-container max-w-3xl">
        <div className="border border-[#e2ddd2] bg-[#fffdf9] px-4 py-4 flex gap-3 mb-8">
          <span className="flex h-10 w-10 shrink-0 items-center justify-center bg-[var(--home-ink)] text-white">
            <AlertTriangle className="h-5 w-5" />
          </span>
          <p className="text-sm text-slate-700 leading-relaxed pt-1">
            <strong className="font-semibold text-slate-900">Summary:</strong> Workers on
            eHandyHire are not employed by, affiliated with, or controlled by our company.
            eHandyHire is not liable for injuries, damages, disputes, or losses arising from
            services arranged through the platform.
          </p>
        </div>

        <div className="space-y-8">
          {sections.map((section) => (
            <section key={section.title} className="border-b border-[#e2ddd2] pb-8 last:border-0">
              <h2 className="home-display text-lg font-bold text-slate-900 mb-3">{section.title}</h2>
              <div className="space-y-3 text-sm text-slate-600 leading-relaxed">
                {section.body.map((paragraph) => (
                  <p key={paragraph.slice(0, 40)}>{paragraph}</p>
                ))}
                {'list' in section && section.list && (
                  <ul className="list-disc pl-5 space-y-1.5">
                    {section.list.map((item) => (
                      <li key={item}>{item}</li>
                    ))}
                  </ul>
                )}
                {'footer' in section && section.footer && <p>{section.footer}</p>}
              </div>
            </section>
          ))}
        </div>

        <div className="mt-10 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 border border-[#e2ddd2] bg-[#fffdf9] p-5">
          <p className="text-sm text-muted">
            Questions?{' '}
            <Link
              href="/contact"
              className="font-semibold text-[var(--home-amber)] hover:text-[var(--home-amber-soft)]"
            >
              Contact us
            </Link>
          </p>
          <Link href="/">
            <Button variant="outline" className="rounded-none border-[#d6d0c4]">
              Back to home
            </Button>
          </Link>
        </div>
      </div>
    </div>
  );
}
