"use client";

import ReactLenis from "lenis/react";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarLayoutFloatingInline from "@/components/navbar/NavbarLayoutFloatingInline";
import ContactCTA from "@/components/sections/contact/ContactCTA";
import ContactSplitForm from "@/components/sections/contact/ContactSplitForm";
import FooterMedia from "@/components/sections/footer/FooterMedia";
import { Phone, MessageCircle, Mail } from "lucide-react";

export default function ContactPage() {
  const handleSubmit = (data: Record<string, string>) => {
    console.log("Form submitted:", data);
    // Handle form submission logic here (e.g., send to API)
    alert("Your request has been sent! We will get back to you shortly.");
  };

  return (
    <ThemeProvider
      defaultButtonVariant="directional-hover"
      defaultTextAnimation="entrance-slide"
      borderRadius="soft"
      contentWidth="medium"
      sizing="medium"
      background="aurora"
      cardStyle="glass-elevated"
      primaryButtonStyle="gradient"
      secondaryButtonStyle="glass"
      headingFontWeight="semibold"
    >
      <ReactLenis root>
        <div id="nav" data-section="nav">
          <NavbarLayoutFloatingInline
            brandName="AirPro HVAC"
            navItems={[
              { name: "Services", id: "services" },
              { name: "About", id: "about" },
              { name: "Testimonials", id: "testimonials" },
              { name: "Contact", id: "/contact" }
            ]}
            button={{ text: "Get a Quote", href: "/contact" }}
            animateOnLoad={false}
          />
        </div>

        <div id="contact-details" data-section="contact-details">
          <ContactCTA
            tag="Reach Out"
            tagIcon={Phone}
            title="Connect with AirPro HVAC"
            description="We are available via WhatsApp, phone, or email to answer your questions and schedule service."
            buttons={[
              { text: "WhatsApp Us", href: "https://wa.me/15559876543" },
              { text: "Call Us: (555) 987-6543", href: "tel:5559876543" },
              { text: "Email Us", href: "mailto:info@airprohvac.com" }
            ]}
            background={{ variant: "plain" }}
            useInvertedBackground={false}
          />
        </div>

        <div id="quote-form" data-section="quote-form">
          <ContactSplitForm
            title="Request a Free Quote"
            description="Fill out the form below with your details and service needs. We'll get back to you within 24 hours. Our main office is located at 123 Climate Control Way, Austin, TX 78701."
            inputs={[
              { name: "name", type: "text", placeholder: "Your Name", required: true },
              { name: "email", type: "email", placeholder: "Your Email", required: true },
              { name: "phone", type: "tel", placeholder: "Phone Number", required: false }
            ]}
            textarea={{
              name: "message",              placeholder: "Tell us about your HVAC needs",              rows: 5,
              required: true
            }}
            imageSrc="https://webuild-dev.s3.eu-north-1.amazonaws.com/default/templates/hvac/img-10.jpg?_wi=2" 
            imageAlt="AirPro HVAC office location"
            mediaPosition="right"
            buttonText="Send Request"
            onSubmit={handleSubmit}
            useInvertedBackground={true}
          />
        </div>

        <div id="footer" data-section="footer">
          <FooterMedia
            logoText="AirPro HVAC"
            imageSrc="https://webuild-dev.s3.eu-north-1.amazonaws.com/default/templates/hvac/img-10.jpg?_wi=3"
            imageAlt="HVAC technician inspecting equipment"
            columns={[
              {
                title: "Services",                items: [
                  { label: "AC Installation", href: "/" },
                  { label: "Heating Systems", href: "/" },
                  { label: "Maintenance Plans", href: "/" },
                  { label: "Emergency Repairs", href: "/" },
                ],
              },
              {
                title: "Company",                items: [
                  { label: "About Us", href: "/" },
                  { label: "Testimonials", href: "/" },
                  { label: "FAQ", href: "/" },
                  { label: "Contact", href: "/contact" },
                ],
              },
              {
                title: "Contact",                items: [
                  { label: "(555) 987-6543", href: "tel:5559876543" },
                  { label: "info@airprohvac.com", href: "mailto:info@airprohvac.com" },
                  { label: "123 Climate Control Way, Austin, TX 78701", href: "https://maps.google.com/?q=123 Climate Control Way, Austin, TX 78701" },
                  { label: "WhatsApp", href: "https://wa.me/15559876543" }
                ],
              },
            ]}
            copyrightText="© 2026 | AirPro HVAC. NAFDAC Reg. No. A1-100273L."
          />
        </div>
      </ReactLenis>
    </ThemeProvider>
  );
}
