"use client";

import Link from "next/link";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarLayoutFloatingOverlay from "@/components/navbar/NavbarLayoutFloatingOverlay/NavbarLayoutFloatingOverlay";
import ContactSplitForm from "@/components/sections/contact/ContactSplitForm";
import FaqBase from "@/components/sections/faq/FaqBase";
import FooterMedia from "@/components/sections/footer/FooterMedia";

export default function ContactPage() {
  const navItems = [
    { name: "Home", id: "/" },
    { name: "Services", id: "/services" },
    { name: "Service Areas", id: "/service-areas" },
    { name: "About", id: "/about" },
    { name: "Contact", id: "/contact" },
  ];

  const handleNavClick = (id: string) => {
    if (id.startsWith("/")) {
      window.location.href = id;
    }
  };

  const handleContactSubmit = (data: Record<string, string>) => {
    console.log("Form submitted:", data);
    alert("Thank you for your request! We'll contact you within 1 hour.");
  };

  return (
    <ThemeProvider
      defaultButtonVariant="directional-hover"
      defaultTextAnimation="entrance-slide"
      borderRadius="soft"
      contentWidth="mediumLarge"
      sizing="large"
      background="none"
      cardStyle="layered-gradient"
      primaryButtonStyle="diagonal-gradient"
      secondaryButtonStyle="radial-glow"
      headingFontWeight="medium"
    >
      <div id="nav" data-section="nav">
        <NavbarLayoutFloatingOverlay
          brandName="ProServe"
          navItems={navItems}
          button={{
            text: "Get a Quote",
            href: "/contact",
          }}
        />
      </div>

      <div id="contact" data-section="contact">
        <ContactSplitForm
          title="Get Your Free Estimate Today"
          description="Fill out the form or call (555) 123-4567 for immediate assistance. Our team responds within 1 hour for emergency requests."
          inputs={[
            {
              name: "fullName",
              type: "text",
              placeholder: "Your Full Name",
              required: true,
            },
            {
              name: "phone",
              type: "tel",
              placeholder: "Phone Number",
              required: true,
            },
            {
              name: "email",
              type: "email",
              placeholder: "Email Address",
              required: true,
            },
            {
              name: "serviceType",
              type: "text",
              placeholder: "Service Needed (HVAC, Plumbing, Electrical)",
              required: true,
            },
          ]}
          textarea={{
            name: "description",
            placeholder: "Describe your issue or service request...",
            rows: 5,
            required: true,
          }}
          imageSrc="http://img.b2bpic.net/free-photo/black-businessman-assisting-clients_482257-121939.jpg"
          imageAlt="Customer service team ready to help"
          mediaAnimation="opacity"
          mediaPosition="right"
          buttonText="Request Free Estimate"
          useInvertedBackground={false}
          onSubmit={handleContactSubmit}
        />
      </div>

      <div id="contact-faq" data-section="contact-faq">
        <FaqBase
          title="Contact & Support"
          description="Find answers to questions about contacting us, scheduling services, and what to expect."
          faqs={[
            {
              id: "1",
              title: "What are your business hours?",
              content:
                "We're open Monday-Friday 8:00 AM - 6:00 PM and Saturday 9:00 AM - 4:00 PM. Emergency services are available 24/7.",
            },
            {
              id: "2",
              title: "How quickly can you respond to emergencies?",
              content:
                "We aim to arrive within 1 hour for emergency calls. Call (555) 123-4567 to speak with our emergency dispatcher immediately.",
            },
            {
              id: "3",
              title: "Can I request a specific technician?",
              content:
                "Yes! If you've worked with a technician you'd like to work with again, just mention them when scheduling your appointment.",
            },
            {
              id: "4",
              title: "What if I need to reschedule?",
              content:
                "Simply call us or use our online rescheduling tool. We offer flexible time windows to work with your schedule.",
            },
            {
              id: "5",
              title: "Do you serve my area?",
              content:
                "We service the greater metro area and surrounding communities within 30 miles. Visit our Service Areas page or contact us to confirm coverage for your location.",
            },
            {
              id: "6",
              title: "How can I get a free estimate?",
              content:
                "Use the form above, call (555) 123-4567, or visit any of our service pages to request an estimate. We provide free consultations with no obligation.",
            },
          ]}
          textboxLayout="default"
          useInvertedBackground={false}
          faqsAnimation="slide-up"
        />
      </div>

      <div id="footer" data-section="footer">
        <FooterMedia
          imageSrc="http://img.b2bpic.net/free-vector/dark-polygonal-background_23-2148122780.jpg"
          imageAlt="Professional services background"
          logoText="ProServe"
          copyrightText="© 2025 ProServe. All rights reserved. | Licensed & Insured"
          columns={[
            {
              title: "Services",
              items: [
                { label: "HVAC Services", href: "/services" },
                { label: "Plumbing Solutions", href: "/services" },
                { label: "Electrical Work", href: "/services" },
                { label: "Emergency Service", href: "/contact" },
              ],
            },
            {
              title: "Company",
              items: [
                { label: "About Us", href: "/about" },
                { label: "Service Areas", href: "/service-areas" },
                { label: "Contact", href: "/contact" },
                { label: "Reviews", href: "/" },
              ],
            },
            {
              title: "Legal",
              items: [
                { label: "Privacy Policy", href: "/" },
                { label: "Terms of Service", href: "/" },
                { label: "License Information", href: "/" },
                { label: "Insurance Verification", href: "/" },
              ],
            },
          ]}
        />
      </div>
    </ThemeProvider>
  );
}