import React from "react";
import type { Metadata } from "next";
import LegalDocument, { ContactLink, type LegalSection } from "@/components/sections/LegalDocument";

export const metadata: Metadata = {
  title: "Terms of Service – Doormile",
  description:
    "The Terms of Service governing your access to and use of the Doormile website and related services.",
};

const sections: LegalSection[] = [
  {
    heading: "Acceptance of Terms",
    blocks: [
      {
        type: "p",
        text: "By accessing this website, you acknowledge that you have read, understood, and agreed to these Terms of Service and all applicable laws and regulations.",
      },
    ],
  },
  {
    heading: "Permitted Use",
    blocks: [
      {
        type: "p",
        text: "You agree to use the website and services only for lawful purposes and in accordance with these terms.",
      },
      { type: "p", text: "You agree not to:" },
      {
        type: "ul",
        items: [
          "Violate applicable laws or regulations",
          "Attempt unauthorized access to systems or networks",
          "Interfere with website functionality or security",
          "Distribute malicious software or harmful code",
          "Misrepresent your identity or organization",
          "Use website content without authorization",
        ],
      },
    ],
  },
  {
    heading: "Intellectual Property Rights",
    blocks: [
      {
        type: "p",
        text: "All content, technology, software, graphics, trademarks, logos, text, designs, and other materials available on this website are the property of Doormile or its licensors and are protected by applicable intellectual property laws.",
      },
    ],
  },
  {
    heading: "User Submissions",
    blocks: [
      {
        type: "p",
        text: "Any information submitted through forms, inquiries, or communications must be accurate and lawful. Users are responsible for the content they submit.",
      },
    ],
  },
  {
    heading: "Service Availability",
    blocks: [
      {
        type: "p",
        text: "While we strive to maintain uninterrupted access, we do not guarantee that the website or services will always be available, secure, or error-free.",
      },
    ],
  },
  {
    heading: "Disclaimer of Warranties",
    blocks: [
      {
        type: "p",
        text: 'The website and services are provided on an "as is" and "as available" basis without warranties of any kind, whether express or implied.',
      },
    ],
  },
  {
    heading: "Limitation of Liability",
    blocks: [
      {
        type: "p",
        text: "To the maximum extent permitted by law, Doormile shall not be liable for any indirect, incidental, special, consequential, or punitive damages arising from or related to the use of the website or services.",
      },
    ],
  },
  {
    heading: "Indemnification",
    blocks: [
      {
        type: "p",
        text: "Users agree to indemnify and hold harmless Doormile, its employees, partners, and affiliates from claims arising from misuse of the website or violation of these terms.",
      },
    ],
  },
  {
    heading: "Modifications",
    blocks: [
      {
        type: "p",
        text: "We reserve the right to update or modify these Terms of Service at any time. Continued use of the website following updates constitutes acceptance of the revised terms.",
      },
    ],
  },
  {
    heading: "Governing Law",
    blocks: [
      {
        type: "p",
        text: "These Terms shall be governed by and interpreted in accordance with applicable laws and regulations in the jurisdictions where Doormile conducts business.",
      },
    ],
  },
  {
    heading: "Contact Us",
    blocks: [
      {
        type: "p",
        text: <>Questions regarding these Terms of Service may be submitted through our <ContactLink />.</>,
      },
    ],
  },
];

export default function TermsOfServicePage() {
  return (
    <div className="content-wrapper content-wrapper-may-contain-elementor-code content-wrapper-sidebar-position-none">
      <div className="content">
        <div className="content-inner">
          <LegalDocument
            title="Terms of Service"
            lastUpdated="June 2026"
            intro="These Terms of Service govern your access to and use of the Doormile website and related services. By accessing or using our website, you agree to comply with these terms."
            sections={sections}
          />
        </div>
      </div>
    </div>
  );
}
