import type { Metadata } from 'next';
import Link from 'next/link';
import { social } from '@/lib/metadata';
import { Reveal } from '@/components/reveal';

const DESCRIPTION = 'The terms on which the United Economic Forum website is made available.';

export const metadata: Metadata = {
  title: 'Terms of Use',
  description: DESCRIPTION,
  ...social('Terms of Use', DESCRIPTION, '/terms'),
};

/**
 * DRAFT — pending legal sign-off.
 *
 * Written to sit alongside /privacy so the pair covers what a site collecting
 * personal data needs. Deliberately narrow: these are terms for *using the
 * website*, not membership terms and not the UEF Angels engagement terms.
 * Both of those are separate documents UEF has to supply.
 *
 * The governing-law jurisdiction was confirmed by UEF on 28 August 2026: the
 * laws of India, with the courts at Chennai holding jurisdiction.
 */

const UPDATED = '28 August 2026';

function Section({ title, children }: { title: string; children: React.ReactNode }) {
  return (
    <Reveal>
      <section className="mb-12">
        <h2 className="text-2xl font-serif font-semibold mb-4 text-balance">{title}</h2>
        <div className="space-y-4 text-foreground/75 leading-relaxed">{children}</div>
      </section>
    </Reveal>
  );
}

export default function Terms() {
  return (
    <div className="flex flex-col min-h-screen bg-background">
      <section className="bg-muted border-b border-border pt-40 pb-16">
        <div className="container mx-auto px-6 md:px-12 max-w-3xl">
        <Reveal>
          <p className="text-xs font-bold tracking-widest uppercase text-primary mb-4">Legal</p>
          <h1 className="text-4xl md:text-5xl font-serif font-semibold mb-5 text-balance">Terms of Use</h1>
          <p className="text-sm text-foreground/50">Last updated: {UPDATED}</p>
        </Reveal>
        </div>
      </section>

      <div className="container mx-auto px-6 md:px-12 max-w-3xl py-16 md:py-20">
        <p className="text-lg text-foreground/80 leading-relaxed mb-14 pb-14 border-b border-border">
          These terms govern your use of the United Economic Forum website. By using the site, you accept them. If you
          do not accept them, please do not use the site.
        </p>

        <Section title="About this site">
          <p>
            This website is operated by the United Economic Forum, with its Secretariat at No 4, Buhari Towers, 7th
            Floor, Moores Road, Chennai - 600 006, Tamil Nadu, India. It exists to describe UEF, its initiatives and its
            events, and to let you get in touch with us.
          </p>
        </Section>

        <Section title="Using the site">
          <p>You may read, share and reference the content here. You may not:</p>
          <ul className="list-disc pl-6 space-y-2">
            <li>use the site for any unlawful purpose, or to send false or misleading information;</li>
            <li>attempt to gain unauthorised access to the site, its servers or any connected system;</li>
            <li>interfere with the site&rsquo;s operation, or collect data from it by automated means without our
              permission;</li>
            <li>reproduce our branding or present yourself as representing UEF without our written consent.</li>
          </ul>
        </Section>

        <Section title="Enquiries you send us">
          <p>
            When you submit the contact or membership form, you confirm the information you give is accurate and yours
            to share. We handle what you send in line with our{' '}
            <Link href="/privacy" className="text-primary hover:underline">
              Privacy Policy
            </Link>
            .
          </p>
          <p>
            Submitting a membership enquiry is not an application, and it does not create membership. All enquiries are
            subject to UEF review and approval.
          </p>
        </Section>

        <Section title="Information on this site">
          <p>
            We take care to keep the site accurate and current, but content is provided for general information. Figures,
            dates and programme details may change, and nothing here is professional, financial or legal advice.
          </p>
          <p>
            Pages describing UEF Angels carry their own risk disclosure. Please read it before acting on anything
            described there.
          </p>
        </Section>

        <Section title="Other people&rsquo;s content and sites">
          <p>
            Some pages embed content from third parties, including Instagram and Google Maps, and some links lead to
            sites we do not control. We are not responsible for their content, availability or practices, and a link is
            not an endorsement.
          </p>
        </Section>

        <Section title="Our content">
          <p>
            The text, design, logos and images on this site belong to UEF or are used with permission. You may not
            reproduce them commercially without our written consent.
          </p>
        </Section>

        <Section title="Availability">
          <p>
            We aim to keep the site available, but we do not guarantee uninterrupted access. We may change, suspend or
            withdraw any part of it without notice.
          </p>
        </Section>

        <Section title="Changes to these terms">
          <p>
            We may update these terms from time to time. The date at the top of this page shows when they were last
            revised, and continued use of the site means you accept the current version.
          </p>
        </Section>

        <Section title="Governing law">
          <p>
            These terms are governed by the laws of India, and the courts at Chennai, Tamil Nadu shall have jurisdiction
            over any dispute arising from them.
          </p>
        </Section>

        <Section title="Contact">
          <p>
            Questions about these terms can go to{' '}
            <a href="mailto:info@unitedeconomicforum.com" className="text-primary hover:underline">
              info@unitedeconomicforum.com
            </a>{' '}
            or through our{' '}
            <Link href="/contact" className="text-primary hover:underline">
              contact page
            </Link>
            .
          </p>
        </Section>
      </div>
    </div>
  );
}
