"use client";

import Link from "next/link";
import { Container } from "@/components/container";
import { Breadcrumbs } from "@/components/breadcrumbs";
import {
  Accordion,
  AccordionContent,
  AccordionItem,
  AccordionTrigger,
} from "@/components/ui/accordion";
import { Shield, ShieldCheck, Lock } from "lucide-react";

export function PrivacyView() {
  return (
    <div className="py-12 md:py-20">
      <Container className="mx-auto w-full max-w-6xl px-5 md:px-8">
        <Breadcrumbs
          items={[{ label: "Privacy Policy" }]}
          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">
            <Shield className="size-3.5" />
            <span>Data Protection &amp; Privacy Standards</span>
          </div>

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

          <p className="mt-3 text-sm font-medium text-muted-foreground md:text-base">
            Last updated: July 11, 2026
          </p>

          <div className="mt-6 space-y-4 text-base leading-relaxed text-muted-foreground">
            <p>
              This privacy policy (&quot;<strong>Policy</strong>&quot;) explains how Company collects, processes, stores, and/or shares any personal data and/or other information from or about the users (&quot;<strong>You</strong>&quot; or &quot;<strong>Your</strong>&quot;) via Your access on the web-based platform <span className="font-semibold text-foreground">www.qutoai.com</span> (&quot;<strong>Website</strong>&quot;) or via other means, operated and managed by <strong>Quto AI</strong> (&quot;<strong>Company</strong>&quot; or &quot;<strong>We</strong>&quot;), having its official registered office address at <strong>GF-880, Gautam Marg, opp. Kurki House, Rani Sati Nagar, Nirman Nagar, Jaipur, Rajasthan 302019</strong>.
            </p>
            <p>
              By accessing and/or using the Website, You consent to the collection, storage, disclosure, and other uses of Your information as per this Policy. You must be at least of legal age i.e. 18 years old to access the Website.
            </p>
            <p>
              These terms are an electronic record in terms of the Information Technology Act, 2000 (including rules made thereunder) and other laws as applicable. The terms are published in accordance with Rule 3(1)(a) of the Information Technology (Intermediary Guidelines and Digital Media Ethics Code) Rules, 2021.
            </p>
            <p>
              This Policy is a part of and should be read in conjunction with our{" "}
              <Link
                href="/terms"
                className="font-medium text-primary underline decoration-primary/40 underline-offset-4 hover:decoration-primary"
              >
                Terms of Service
              </Link>
              . Company provides enterprise-ready AI voice agents for automated inbound and outbound phone calls assisting in lead qualification and customer interactions (&quot;<strong>Services</strong>&quot;).
            </p>
          </div>
        </div>

        {/* Policy Sections Accordion */}
        <div className="mt-12">
          <Accordion
            type="single"
            collapsible
            defaultValue="type-of-info"
            className="w-full space-y-4"
          >
            {/* 1. Changes to the Policy */}
            <AccordionItem
              value="changes"
              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">
                Changes to the Policy
              </AccordionTrigger>
              <AccordionContent className="pt-2 pb-4 text-base leading-relaxed text-muted-foreground">
                We review and update this Policy from time to time. When We do, We will note the date of the version on the Policy and post it on this Website. You can know when We last updated this Policy by checking the &quot;Last Updated&quot; date at the top of this Policy.
              </AccordionContent>
            </AccordionItem>

            {/* 2. Type of Personal Information Collected */}
            <AccordionItem
              value="type-of-info"
              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">
                Type of Personal Information Collected
              </AccordionTrigger>
              <AccordionContent className="pt-2 pb-6 text-base leading-relaxed text-muted-foreground space-y-6">
                <p>
                  In general, You can access and browse through the Website without revealing any information about yourself. However, in the event You desire to make use of certain features of the Website, You will be required to provide the following information:
                </p>

                {/* Visitors Table */}
                <div>
                  <h4 className="text-sm font-bold text-foreground uppercase tracking-wide">
                    1. Website Visitors
                  </h4>
                  <div className="mt-3 overflow-hidden rounded-xl border border-border">
                    <table className="w-full text-left text-sm">
                      <thead className="bg-muted/60 text-xs font-semibold uppercase text-foreground">
                        <tr>
                          <th className="px-4 py-3 border-b border-border">Data Collected</th>
                          <th className="px-4 py-3 border-b border-border">Purpose &amp; Usage</th>
                        </tr>
                      </thead>
                      <tbody className="divide-y divide-border">
                        <tr className="bg-card">
                          <td className="px-4 py-3 font-medium text-foreground align-top w-1/3">
                            Cookies and Log Data
                          </td>
                          <td className="px-4 py-3 text-muted-foreground">
                            We use this information to analyse and identify your behaviour and enhance the interactions you have with the Website.
                          </td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
                </div>

                {/* Registered Users Table */}
                <div>
                  <h4 className="text-sm font-bold text-foreground uppercase tracking-wide">
                    2. Registered Enterprise Users
                  </h4>
                  <div className="mt-3 overflow-hidden rounded-xl border border-border">
                    <table className="w-full text-left text-sm">
                      <thead className="bg-muted/60 text-xs font-semibold uppercase text-foreground">
                        <tr>
                          <th className="px-4 py-3 border-b border-border">Data Collected</th>
                          <th className="px-4 py-3 border-b border-border">Purpose &amp; Usage</th>
                        </tr>
                      </thead>
                      <tbody className="divide-y divide-border">
                        <tr className="bg-card">
                          <td className="px-4 py-3 font-medium text-foreground align-top w-1/3">
                            Personal Information
                          </td>
                          <td className="px-4 py-3 text-muted-foreground">
                            Contact details such as your name, work email address, and phone number when setting up an account.
                          </td>
                        </tr>
                        <tr className="bg-card">
                          <td className="px-4 py-3 font-medium text-foreground align-top">
                            Speech-to-Text &amp; Voice Input
                          </td>
                          <td className="px-4 py-3 text-muted-foreground">
                            We process any text, prompt, or audio content you input to generate natural audio responses and refine conversational capabilities.
                          </td>
                        </tr>
                        <tr className="bg-card">
                          <td className="px-4 py-3 font-medium text-foreground align-top">
                            Telephony &amp; Calling Data
                          </td>
                          <td className="px-4 py-3 text-muted-foreground">
                            Names, dialed numbers, encrypted call recordings, transcripts, latency metrics, and conversation analytics.
                          </td>
                        </tr>
                        <tr className="bg-card">
                          <td className="px-4 py-3 font-medium text-foreground align-top">
                            Payment Details
                          </td>
                          <td className="px-4 py-3 text-muted-foreground">
                            Payment processors process billing addresses, card info, or banking details to facilitate secure payments for subscriptions and credit top-ups.
                          </td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
                </div>

                {/* Purposes */}
                <div className="space-y-4 pt-2">
                  <h4 className="text-sm font-bold text-foreground uppercase tracking-wide">
                    3. Specific Processing Purposes
                  </h4>
                  <ul className="space-y-3 text-sm">
                    <li>
                      <strong>Personalize User Experience:</strong> Adapting user interface, tailored analytics dashboards, and workflow recommendations.
                    </li>
                    <li>
                      <strong>AI Model Refinement:</strong> Anonymized, de-identified telemetry is used to improve speech synthesis models. <em>Google Workspace API data is strictly excluded from all training.</em>
                    </li>
                    <li>
                      <strong>Communication:</strong> Service incident alerts, security updates, scheduled reports, and customer support.
                    </li>
                    <li>
                      <strong>Regulatory Adherence:</strong> Compliance with the Information Technology Act, 2000, DPDP Act, and law enforcement requests under valid judicial order.
                    </li>
                  </ul>
                </div>
              </AccordionContent>
            </AccordionItem>

            {/* 3. Data Anonymization */}
            <AccordionItem
              value="data-anonymization"
              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">
                Data Anonymization
              </AccordionTrigger>
              <AccordionContent className="pt-2 pb-4 text-base leading-relaxed text-muted-foreground">
                We may anonymize and/or de-identify data or information collected through the Website. This includes pseudonymization, data aggregation, and differential privacy to protect user identity while researching conversational quality. This does not apply to data received from Google Workspace APIs, which is governed strictly by the Google Workspace APIs section.
              </AccordionContent>
            </AccordionItem>

            {/* 4. Consent Mechanism */}
            <AccordionItem
              value="consent-mechanism"
              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">
                Consent Mechanism
              </AccordionTrigger>
              <AccordionContent className="pt-2 pb-4 text-base leading-relaxed text-muted-foreground">
                By using our Services, You consent to the collection and use of Your data as described in this Policy. You have the right to revoke consent at any time by contacting our Grievance Officer or deleting your account.
              </AccordionContent>
            </AccordionItem>

            {/* 5. Cookies */}
            <AccordionItem
              value="cookies"
              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">
                Cookies
              </AccordionTrigger>
              <AccordionContent className="pt-2 pb-4 text-base leading-relaxed text-muted-foreground">
                We employ cookies and similar session technologies to recognize your device, maintain active sessions, and understand usage patterns. You can manage or block cookies through your browser settings, though certain interactive features may be impaired.
              </AccordionContent>
            </AccordionItem>

            {/* 6. Your Rights and Choices */}
            <AccordionItem
              value="rights"
              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">
                Your Rights and Choices
              </AccordionTrigger>
              <AccordionContent className="pt-2 pb-4 text-base leading-relaxed text-muted-foreground">
                <p>Under applicable Indian and global data protection laws, You have the right to:</p>
                <ul className="mt-3 list-disc pl-6 space-y-1.5 text-sm">
                  <li>Request access to your stored personal data and call records.</li>
                  <li>Rectification of inaccurate, obsolete, or incomplete information.</li>
                  <li>Erasure of personal data, call audio, or contact lists.</li>
                  <li>Withdraw consent for future telemetry or communication processing.</li>
                  <li>Opt-out of model evaluation and training loops.</li>
                  <li>Unsubscribe from marketing announcements and newsletters.</li>
                </ul>
              </AccordionContent>
            </AccordionItem>

            {/* 7. Security Practices */}
            <AccordionItem
              value="security"
              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">
                Security of Personal Information and Data Protection Practices
              </AccordionTrigger>
              <AccordionContent className="pt-2 pb-4 text-base leading-relaxed text-muted-foreground space-y-3">
                <p>
                  Company takes all reasonable, state-of-the-art steps to ensure that personal data is protected against misuse, loss, unauthorized access, modification, and disclosure.
                </p>
                <p>
                  We maintain strict compliance with the following international information security and privacy frameworks:
                </p>
                <div className="flex flex-wrap items-center gap-3 pt-2">
                  <div className="flex items-center gap-2 rounded-xl border border-border bg-muted/40 px-3.5 py-1.5 text-xs font-semibold text-foreground">
                    <ShieldCheck className="size-4 text-foreground" />
                    <span>ISO 27001 Certified</span>
                  </div>
                  <div className="flex items-center gap-2 rounded-xl border border-border bg-muted/40 px-3.5 py-1.5 text-xs font-semibold text-foreground">
                    <ShieldCheck className="size-4 text-foreground" />
                    <span>SOC 2 Type II Certified (AICPA)</span>
                  </div>
                  <div className="flex items-center gap-2 rounded-xl border border-border bg-muted/40 px-3.5 py-1.5 text-xs font-semibold text-foreground">
                    <Lock className="size-4 text-foreground" />
                    <span>End-to-End TLS 1.3 &amp; AES-256 Encryption</span>
                  </div>
                </div>
              </AccordionContent>
            </AccordionItem>

            {/* 8. External Links */}
            <AccordionItem
              value="external-links"
              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">
                External Links
              </AccordionTrigger>
              <AccordionContent className="pt-2 pb-4 text-base leading-relaxed text-muted-foreground">
                The Website may contain links to third-party platforms. Company does not control and assumes no responsibility for third-party privacy practices or external website content.
              </AccordionContent>
            </AccordionItem>

            {/* 9. Data Sharing & Cross-Border Transfers */}
            <AccordionItem
              value="data-sharing"
              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">
                Data Sharing &amp; Cross-Border Transfers
              </AccordionTrigger>
              <AccordionContent className="pt-2 pb-4 text-base leading-relaxed text-muted-foreground space-y-3">
                <p>
                  We share data with verified third-party vendors strictly for service delivery:
                </p>
                <ul className="list-disc pl-6 space-y-1 text-sm">
                  <li>Payment processors for billing fulfillment.</li>
                  <li>Inference models (OpenAI, Gemini) for dialogue understanding.</li>
                  <li>Licensed telecommunications carriers for inbound and outbound call routing.</li>
                  <li>Google for user authentication and Google Workspace integrations.</li>
                </ul>
                <p className="text-sm">
                  Where data is transferred across international borders, we ensure standard contractual clauses and Indian statutory requirements are satisfied.
                </p>
              </AccordionContent>
            </AccordionItem>

            {/* 10. Google User Data and Workspace APIs */}
            <AccordionItem
              value="google-apis"
              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">
                Google User Data and Google Workspace APIs
              </AccordionTrigger>
              <AccordionContent className="pt-2 pb-4 text-base leading-relaxed text-muted-foreground space-y-3">
                <p>
                  Certain features allow you to connect your Google account (e.g. reading/updating selected Google Sheets or scheduling events on Google Calendar).
                </p>
                <p>
                  Our handling of data received from Google Workspace APIs complies with the{" "}
                  <a
                    href="https://developers.google.com/terms/api-services-user-data-policy"
                    target="_blank"
                    rel="noopener noreferrer"
                    className="font-medium text-primary underline"
                  >
                    Google API Services User Data Policy
                  </a>
                  , including the Limited Use requirements.
                </p>
                <p className="font-medium text-foreground">
                  In particular, Google Workspace API data is NEVER used to train, develop, or improve generalized artificial intelligence or machine learning models.
                </p>
                <p className="text-sm">
                  You can revoke permissions at any time via your{" "}
                  <a
                    href="https://myaccount.google.com/permissions"
                    target="_blank"
                    rel="noopener noreferrer"
                    className="font-medium text-primary underline"
                  >
                    Google Account security settings
                  </a>
                  .
                </p>
              </AccordionContent>
            </AccordionItem>

            {/* 11. Data Retention Policy */}
            <AccordionItem
              value="retention"
              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">
                Data Retention Policy
              </AccordionTrigger>
              <AccordionContent className="pt-2 pb-4 text-base leading-relaxed text-muted-foreground">
                We retain personal data only as long as necessary to fulfill the purposes outlined in this Policy, comply with tax/statutory requirements, and resolve customer disputes. After the retention period, data is securely erased or irreversibly pseudonymized.
              </AccordionContent>
            </AccordionItem>

            {/* 12. Grievance Officer */}
            <AccordionItem
              value="grievance"
              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">
                Grievance Mechanism &amp; Data Protection Officer Contact
              </AccordionTrigger>
              <AccordionContent className="pt-2 pb-4 text-base leading-relaxed text-muted-foreground space-y-2">
                <p>
                  To lodge a data protection grievance or exercise statutory rights, please visit our dedicated{" "}
                  <Link
                    href="/contact"
                    className="font-semibold text-primary underline"
                  >
                    Grievance Officer Page
                  </Link>
                  .
                </p>
                <p className="text-sm">
                  Officer: our <strong>Data Protection Officer</strong> (
                  <a href="mailto:quto.official@gmail.com" className="underline">
                    quto.official@gmail.com
                  </a>
                  ). Registered Office Address: GF-880, Gautam Marg, opp. Kurki House, Rani Sati Nagar, Nirman Nagar, Jaipur, Rajasthan 302019. Complaints acknowledged within 48 hours and resolved within 15 days.
                </p>
              </AccordionContent>
            </AccordionItem>
          </Accordion>
        </div>
      </Container>
    </div>
  );
}
