"use client";

import { Container } from "@/components/container";
import { Breadcrumbs } from "@/components/breadcrumbs";
import {
  Accordion,
  AccordionContent,
  AccordionItem,
  AccordionTrigger,
} from "@/components/ui/accordion";
import { FileText, ShieldAlert } from "lucide-react";

interface TermSection {
  id: string;
  title: string;
  content: string;
}

const TERM_SECTIONS: TermSection[] = [
  {
    id: "service-description",
    title: "Service Description",
    content:
      "Quto provides AI calling solution services. While we strive for accuracy in the output of our services, the actual quality and accuracy of the output may vary based on the limitations of our technology.",
  },
  {
    id: "user-eligibility",
    title: "User Eligibility",
    content:
      "The User certifies that they are at least 18 years of age or have the consent of a parent or legal guardian to use this website.",
  },
  {
    id: "limitation-of-liability",
    title: "Limitation of Liability",
    content:
      "Quto will not be responsible for any damage suffered by users from the use of the services on this site. This includes, but is not limited to, loss of data, interruption of service, or inaccuracies in the service output.",
  },
  {
    id: "pricing-and-availability",
    title: "Pricing and Availability",
    content:
      "Prices and availability of our services are subject to change without prior notice.",
  },
  {
    id: "order-cancellation",
    title: "Order Cancellation",
    content:
      "Quto reserves the right to refuse or cancel any order for services listed at an incorrect price or under incorrect terms. In such a case, any payment made will be refunded.",
  },
  {
    id: "user-responsibility",
    title: "User Responsibility",
    content:
      "Users are responsible for providing accurate and complete information required for the service. Quto is not liable for errors or delays resulting from incorrect information provided by the user. Furthermore, Quto is not responsible for the content of the call generated via the website, and all responsibility for the call content generated lies with the user.",
  },
  {
    id: "fraudulent-activity",
    title: "Fraudulent Activity",
    content:
      "Users are responsible for maintaining the confidentiality of their account and password and for restricting access to their computer. Users agree to accept responsibility for all activities that occur under their account or password. Any illegal deed done using the website's services will be punishable as deemed fit by international law.",
  },
  {
    id: "jurisdiction",
    title: "Jurisdiction",
    content:
      "This agreement shall be governed by the laws of India, and any dispute arising out of or in connection with this agreement shall be subject to the exclusive jurisdiction of the courts in Delhi, India.",
  },
  {
    id: "contact-information",
    title: "Contact Information & Official Address",
    content:
      "For any questions or notices regarding these Terms, please contact us at quto.official@gmail.com or by mail at our official address: GF-880, Gautam Marg, opp. Kurki House, Rani Sati Nagar, Nirman Nagar, Jaipur, Rajasthan 302019, India.",
  },
];

export function TermsView() {
  return (
    <div className="page-top-space pb-12 md:pb-20">
      <Container className="mx-auto w-full max-w-6xl px-5 md:px-8">
        <Breadcrumbs
          items={[{ label: "Terms and Conditions" }]}
          className="mb-8"
        />

        {/* Header Section */}
        <div className="max-w-3xl">
          <div className="inline-flex items-center gap-2 rounded-full border border-primary/20 bg-primary/10 px-3.5 py-1 text-xs font-semibold text-primary">
            <FileText className="size-3.5" />
            <span>Master Service Agreement</span>
          </div>

          <h1 className="mt-4 font-display text-3xl font-bold tracking-tight text-foreground md:text-5xl md:leading-tight">
            Terms and Conditions
          </h1>

          <p className="mt-3 text-sm font-medium text-muted-foreground md:text-base">
            Last updated: Dec 19, 2024
          </p>

          <p className="mt-6 text-base leading-relaxed text-muted-foreground md:text-lg">
            Welcome to Quto, an AI calling solution platform operated and managed by <strong>Quto AI</strong>, having its registered office address at <strong>GF-880, Gautam Marg, opp. Kurki House, Rani Sati Nagar, Nirman Nagar, Jaipur, Rajasthan 302019</strong>. By using the services offered at www.qutoai.com, you agree to these terms and conditions. Please note that Quto reserves the right to modify these terms at any time, so we encourage you to review them regularly.
          </p>
        </div>

        {/* Accordion List */}
        <div className="mt-12">
          <Accordion
            type="single"
            collapsible
            defaultValue="service-description"
            className="w-full space-y-4"
          >
            {TERM_SECTIONS.map((section) => (
              <AccordionItem
                key={section.id}
                value={section.id}
                className="rounded-2xl border border-border/80 bg-card px-6 py-2 shadow-xs transition-colors hover:border-foreground/30"
              >
                <AccordionTrigger className="text-left font-display text-lg font-semibold text-foreground hover:no-underline hover:text-primary">
                  {section.title}
                </AccordionTrigger>
                <AccordionContent className="pt-2 pb-4 text-base leading-relaxed text-muted-foreground">
                  {section.content}
                </AccordionContent>
              </AccordionItem>
            ))}
          </Accordion>
        </div>

        {/* Note on Law & Enforcement */}
        <div className="mt-12 flex items-start gap-4 rounded-2xl border border-border/80 bg-muted/40 p-6">
          <ShieldAlert className="size-5 shrink-0 text-primary" />
          <div className="text-sm text-muted-foreground">
            <p className="font-medium text-foreground">
              Statutory Electronic Record
            </p>
            <p className="mt-1">
              These terms are an electronic record generated by a computer system in terms of the Information Technology Act, 2000 and do not require any physical or digital signatures.
            </p>
          </div>
        </div>
      </Container>
    </div>
  );
}
