import type { Metadata } from "next";
import { JsonLd } from "@/components/json-ld";
import {
  ServiceLanding,
  type ServiceCapability,
  type ServiceStep,
  type ServiceUseCase,
} from "@/components/service-landing";
import { IndustryVoiceShowcase } from "@/components/industries/industry-voice-showcase";
import type { FAQ } from "@/content/solutions";
import { site, ogBase, twitterBase } from "@/content/site";

const DESCRIPTION =
  "Done-for-you AI voice agents that answer, qualify and book calls 24/7 — human-sounding, sub-350ms latency, and integrated with your telephony and CRM.";

export const metadata: Metadata = {
  title: "AI Voice Agents for Business — Done-for-You Calling",
  description: DESCRIPTION,
  keywords: [
    "ai voice agent services for businesses",
    "best ai lead generation agencies with automated ai voice qualification",
    "contact center automation",
    "ai receptionist",
    "ai answering service",
    "automated phone system",
    "ai ivr",
    "cold calling ai",
    "inbound call center software",
    "conversational ai assistant",
    "voice AI platform",
    "Bland AI alternative",
    "Retell AI agency",
  ],
  alternates: { canonical: "/voice-ai" },
  openGraph: {
    ...ogBase,
    title: "AI Voice Agents for Business",
    description: DESCRIPTION,
    url: "/voice-ai",
  },
  twitter: {
    ...twitterBase,
    title: "AI Voice Agents for Business",
    description: DESCRIPTION,
  },
};

const CAPABILITIES: ServiceCapability[] = [
  {
    icon: "PhoneCall",
    title: "Answer every inbound call",
    body: "Human-sounding agents pick up on the first ring, 24/7 — no hold music, no missed callers, no voicemail dead-ends.",
  },
  {
    icon: "Send",
    title: "Make outbound calls",
    body: "Follow up leads, confirm appointments and re-engage cold contacts with natural, on-script outbound calls.",
  },
  {
    icon: "Users",
    title: "Qualify leads in real time",
    body: "The agent asks the right questions, captures intent and budget, and routes hot leads to your team with full context.",
  },
  {
    icon: "Calendar",
    title: "Book & reschedule appointments",
    body: "Check live availability, then book, reschedule or cancel — synced straight into your calendar or CRM.",
  },
  {
    icon: "Repeat",
    title: "Route and hand off",
    body: "Warm-transfer to the right human when it matters, with the full conversation summary attached.",
  },
  {
    icon: "Languages",
    title: "Speak your customer's language",
    body: "Natural conversations across US, UK and Indian English, Hindi and more, with real-time code-switching.",
  },
];

const STEPS: ServiceStep[] = [
  {
    title: "Call comes in",
    body: "The agent answers inbound calls instantly — or dials out for follow-ups — 24/7, with no hold time.",
  },
  {
    title: "Understands & converses",
    body: "It grasps intent in natural, real-time conversation, handling interruptions like a person.",
  },
  {
    title: "Qualifies & books",
    body: "It captures the details, qualifies the caller and books, reschedules or updates your CRM live.",
  },
  {
    title: "Hands off & follows up",
    body: "It warm-transfers to your team with a full summary when needed, then follows up automatically.",
  },
];

const USE_CASES: ServiceUseCase[] = [
  {
    tag: "Inbound",
    title: "AI receptionist & customer service",
    body: "Answer FAQs, triage requests and resolve routine calls without hold times — a 24/7 virtual receptionist for your front desk.",
  },
  {
    tag: "Outbound",
    title: "Lead qualification",
    body: "Call new leads within seconds, qualify budget, timeline and intent, and pass the hot ones to sales.",
  },
  {
    tag: "Scheduling",
    title: "AI appointment scheduling",
    body: "Book, confirm and remind against your live calendar — the agent manages scheduling end to end.",
  },
  {
    tag: "After-hours",
    title: "After-hours & overflow cover",
    body: "Cover nights, weekends and call spikes so no opportunity ever goes to voicemail.",
  },
];

const FAQS: FAQ[] = [
  {
    q: "How much do AI voice agents cost?",
    a: "Pricing is scoped to your usage — call volume, inbound vs outbound, integrations and languages — rather than a fixed per-seat licence, and because it's done-for-you the setup is included. Share your use case on a quick call and we'll give you a clear quote.",
  },
  {
    q: "Do the voice agents actually sound human?",
    a: "Yes. Quto uses low-latency streaming voice with natural turn-taking — typically around sub-350ms responses — so the agent handles interruptions and back-and-forth without the robotic pauses of an old IVR.",
  },
  {
    q: "Can it handle both inbound and outbound calls?",
    a: "Yes. The same agent can answer inbound calls (reception, support, bookings) and make outbound calls (lead follow-up, reminders, re-engagement).",
  },
  {
    q: "Will it integrate with my phone system and CRM?",
    a: "Yes. Quto connects to common telephony such as Twilio and to your CRM, calendar and tools via standard APIs, so calls, bookings and notes stay in sync — no rip-and-replace.",
  },
  {
    q: "What languages and accents does it support?",
    a: "Natural conversations across US, UK and Indian English, Hindi and other major languages, with real-time code-switching to match how your customers actually speak.",
  },
  {
    q: "Is this done-for-you, or do I build it myself?",
    a: "Done-for-you. We design, build, train and deploy the agent with you, then hand you a dashboard to monitor transcripts, outcomes and hand-offs.",
  },
  {
    q: "How quickly can a voice agent go live?",
    a: "It depends on scope, but a focused first use case — like inbound booking or lead qualification — can go live quickly. Book a call and we'll map a realistic timeline for yours.",
  },
];

export default function VoiceAiPage() {
  const serviceSchema = {
    "@context": "https://schema.org",
    "@type": "Service",
    name: "AI Voice Agents",
    serviceType: "AI voice agent development and deployment",
    description: DESCRIPTION,
    provider: { "@type": "Organization", name: site.name, url: site.url },
    areaServed: ["US", "GB", "AU", "IN"],
    audience: { "@type": "Audience", audienceType: "Businesses" },
    url: `${site.url}/voice-ai`,
  };

  const breadcrumbSchema = {
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    itemListElement: [
      { "@type": "ListItem", position: 1, name: "Home", item: site.url },
      { "@type": "ListItem", position: 2, name: "AI Voice Agents", item: `${site.url}/voice-ai` },
    ],
  };

  const faqSchema = {
    "@context": "https://schema.org",
    "@type": "FAQPage",
    mainEntity: FAQS.map((faq) => ({
      "@type": "Question",
      name: faq.q,
      acceptedAnswer: {
        "@type": "Answer",
        text: faq.a,
      },
    })),
  };

  return (
    <>
      <JsonLd data={[serviceSchema, breadcrumbSchema, faqSchema]} />
      <ServiceLanding
        breadcrumbLabel="Voice AI"
        eyebrow="AI Voice Agents"
        h1={
          <>
            AI voice agents that answer, qualify and{" "}
            <span className="font-extrabold text-gradient-brand">book — 24/7</span>
          </>
        }
        sub="Quto builds and runs done-for-you AI voice agents for inbound and outbound calls — so every caller is answered in seconds, qualified, booked and followed up, without adding headcount."
        primaryCtaLabel="Book a call"
        heroVisual={
          <IndustryVoiceShowcase
            callTitle="Inbound booking call"
            callSubtitle="Streaming voice agent"
            durationSeconds={28}
          />
        }
        capabilitiesTitle={
          <>
            What Quto <span className="text-gradient-brand font-extrabold">voice agents</span> do
          </>
        }
        capabilitiesLead="One agent for the whole call — from hello to booked, with a clean handoff whenever a human is needed."
        capabilities={CAPABILITIES}
        stepsTitle={
          <>
            How a <span className="text-gradient-brand font-extrabold">voice call</span> flows
          </>
        }
        steps={STEPS}
        useCasesTitle={
          <>
            Built for real <span className="text-gradient-brand font-extrabold">calling</span> workflows
          </>
        }
        useCases={USE_CASES}
        pricingTitle={
          <>
            Straightforward, <span className="text-gradient-brand font-extrabold">done-for-you</span> pricing
          </>
        }
        pricingBody="Quto is a done-for-you service, not a self-serve tool — so pricing is scoped to what you actually run: call volume, inbound vs outbound, the integrations you need and the languages you support. No per-seat licences, no long build queues. Tell us your use case and we'll put a clear number in front of you."
        faqsTitle={
          <>
            AI voice agents, <span className="text-gradient-brand font-extrabold">answered</span>
          </>
        }
        faqs={FAQS}
        relatedLinks={[
          { label: "WhatsApp AI automation", href: "/whatsapp-ai" },
          { label: "AI agents for healthcare", href: "/industries/healthcare" },
          { label: "AI agents for automobile", href: "/industries/automobile" },
          { label: "AI agents for real estate", href: "/industries/real-estate" },
          { label: "All industries", href: "/industries" },
        ]}
        ctaTitle={
          <>
            Ready to put a <span className="font-extrabold text-gradient-brand">voice agent</span> on your calls?
          </>
        }
        ctaDescription="Book a 20-minute call — we'll map your inbound and outbound calls and show you exactly how a voice agent would handle them."
      />
    </>
  );
}
