"use client";

import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
import HeroLogo from '@/components/sections/hero/HeroLogo';
import FeatureCardMedia from '@/components/sections/feature/FeatureCardMedia';
import TestimonialAboutCard from '@/components/sections/about/TestimonialAboutCard';
import TestimonialCardFifteen from '@/components/sections/testimonial/TestimonialCardFifteen';
import FaqSplitText from '@/components/sections/faq/FaqSplitText';
import ContactSplitForm from '@/components/sections/contact/ContactSplitForm';
import FooterCard from '@/components/sections/footer/FooterCard';
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import { ShieldCheck, Facebook, Instagram, Twitter } from "lucide-react";

const assetMap = [
  {"id":"hero-gutters","url":"http://img.b2bpic.net/free-photo/close-up-ventilation-system_23-2149388996.jpg","alt":"modern house with clean gutters florida"},
  {"id":"seamless-gutters","url":"http://img.b2bpic.net/free-photo/carpenter-measures-wood-with-angle-tool-makes-notes_169016-12894.jpg","alt":"seamless aluminum gutter installation close up"},
  {"id":"gutter-repair","url":"http://img.b2bpic.net/free-photo/windows-building_1122-873.jpg","alt":"technician repairing damaged rain gutter"},
  {"id":"gutter-guards","url":"http://img.b2bpic.net/free-photo/closeup-roof-house-made-wooden-tiles_169016-24989.jpg","alt":"gutter leaf guard system installation"},
  {"id":"gutter-cleaning","url":"http://img.b2bpic.net/free-photo/man-servant-caring-garden_23-2149530840.jpg","alt":"professional gutter cleaning service ladder"},
  {"id":"about-team","url":"http://img.b2bpic.net/free-photo/woman-measuring-wood-planks_23-2148836015.jpg","alt":"professional team working on gutters"},
  {"id":"testimonial-1","url":"http://img.b2bpic.net/free-photo/blissful-girl-expressing-happiness-drinking-coffee-her-cozy-kitchen_197531-6718.jpg","alt":"smiling woman homeowner portrait review"},
  {"id":"testimonial-2","url":"http://img.b2bpic.net/free-photo/front-view-businessman-holding-his-hand-out_23-2148308624.jpg","alt":"man contractor smiling review"},
  {"id":"testimonial-3","url":"http://img.b2bpic.net/free-photo/expressive-young-girl-posing_176474-96343.jpg","alt":"woman property manager happy feedback"},
  {"id":"testimonial-4","url":"http://img.b2bpic.net/free-photo/african-student-passed-exams-having-fun-with-university-mates-international-office-workers-discussing-about-new-company-goals_197531-3749.jpg","alt":"man small business owner testimonial"},
  {"id":"contact-gutters","url":"http://img.b2bpic.net/free-photo/old-building-with-windows-railing_23-2148252727.jpg","alt":"modern house exterior clean gutters"},
  {"id":"facebook-icon","url":"http://img.b2bpic.net/free-vector/social-media-logo-collection_23-2148092202.jpg","alt":"facebook social media icon"},
  {"id":"instagram-icon","url":"http://img.b2bpic.net/free-vector/social-media-logo-collection_23-2148071107.jpg","alt":"instagram social media icon"},
  {"id":"twitter-icon","url":"http://img.b2bpic.net/free-vector/abstract-company-logo-template-with-tagline_23-2148802638.jpg","alt":"twitter social media icon"}
];

const getAssetUrl = (id) => assetMap.find(asset => asset.id === id)?.url || null;
const getAssetAlt = (id, fallback) => assetMap.find(asset => asset.id === id)?.alt || fallback;

export default function LandingPage() {
  return (
    <ThemeProvider
      defaultButtonVariant={"shift-hover"}
      defaultTextAnimation={"entrance-slide"}
      borderRadius={"pill"}
      contentWidth={"compact"}
      sizing={"largeSizeMediumTitles"}
      background={"aurora"}
      cardStyle={"soft-shadow"}
      primaryButtonStyle={"primary-glow"}
      secondaryButtonStyle={"layered"}
      headingFontWeight={"medium"}
    >
      <div id="nav" data-section="nav">
        <NavbarStyleCentered
          brandName={"Florida Precision Gutters"}
          navItems={[
            { name: "Home", id: "home" },
            { name: "Services", id: "services" },
            { name: "About Us", id: "about" },
            { name: "Testimonials", id: "testimonials" },
            { name: "FAQs", id: "faq" },
            { name: "Contact", id: "contact" }
          ]}
          button={{
            text: "Get a Free Quote",            href: "#contact"
          }}
        />
      </div>
      <div id="hero" data-section="hero">
        <HeroLogo
          logoText={"Florida Precision Gutters"}
          description={"Your Trusted Partner for Flawless Gutter Installation and Repair. Protecting Your Home, Enhancing Its Value."}
          buttons={[
            { text: "Get a Free Quote", href: "#contact" },
            { text: "Explore Services", href: "#services" }
          ]}
          buttonAnimation={"slide-up"}
          imageSrc={getAssetUrl("hero-gutters")}
          mediaAnimation={"opacity"}
          showDimOverlay={true}
          ariaLabel={"Hero section"}
        />
      </div>
      <div id="services" data-section="services">
        <FeatureCardMedia
          title={"Our Premium Gutter Solutions"}
          description={"From seamless installation to meticulous repairs, we offer comprehensive services tailored to protect your home."}
          features={[
            {
              id: "seamless-installation",              title: "Seamless Gutter Installation",              description: "Custom-fitted, high-quality seamless gutters that offer superior protection and aesthetic appeal.",              tag: "Installation",              imageSrc: getAssetUrl("seamless-gutters")
            },
            {
              id: "gutter-repair",              title: "Gutter Repair & Maintenance",              description: "Expert repair services to fix leaks, sagging, and damage, ensuring your gutters function perfectly.",              tag: "Maintenance",              imageSrc: getAssetUrl("gutter-repair")
            },
            {
              id: "gutter-guards",              title: "Gutter Guard Systems",              description: "Install durable gutter guards to prevent clogs, reduce maintenance, and extend the life of your gutters.",              tag: "Protection",              imageSrc: getAssetUrl("gutter-guards")
            },
            {
              id: "gutter-cleaning",              title: "Professional Gutter Cleaning",              description: "Thorough cleaning to remove debris, leaves, and blockages, ensuring optimal water flow and preventing damage.",              tag: "Cleaning",              imageSrc: getAssetUrl("gutter-cleaning")
            }
          ]}
          animationType={"slide-up"}
          textboxLayout={"default"}
          useInvertedBackground={false}
          ariaLabel={"Features section"}
        />
      </div>
      <div id="about" data-section="about">
        <TestimonialAboutCard
          tag={"About Us"}
          tagAnimation={"opacity"}
          title={"Dedicated to Quality & Reliability"}
          description={"Florida Precision Gutters is committed to providing top-tier gutter services with a focus on durability and customer satisfaction."}
          subdescription={"We use only the highest quality materials and employ experienced professionals to ensure every project exceeds expectations. Your home's protection is our priority."}
          icon={ShieldCheck}
          imageSrc={getAssetUrl("about-team")}
          mediaAnimation={"slide-up"}
          useInvertedBackground={true}
          ariaLabel={"About section"}
        />
      </div>
      <div id="testimonials" data-section="testimonials">
        <TestimonialCardFifteen
          testimonial={"Florida Precision Gutters did an outstanding job on our seamless gutter installation. The team was professional, efficient, and the results are fantastic. Our home looks great and is now fully protected!"}
          rating={5}
          author={"Marcus R., Homeowner"}
          avatars={[
            { src: getAssetUrl("testimonial-1"), alt: getAssetAlt("testimonial-1", "Sarah Johnson") },
            { src: getAssetUrl("testimonial-2"), alt: getAssetAlt("testimonial-2", "Michael Chen") },
            { src: getAssetUrl("testimonial-3"), alt: getAssetAlt("testimonial-3", "Emily Rodriguez") },
            { src: getAssetUrl("testimonial-4"), alt: getAssetAlt("testimonial-4", "David Kim") }
          ]}
          ratingAnimation={"blur-reveal"}
          avatarsAnimation={"slide-up"}
          useInvertedBackground={false}
          ariaLabel={"Testimonial section"}
        />
      </div>
      <div id="faq" data-section="faq">
        <FaqSplitText
          sideTitle={"Common Questions"}
          faqs={[
            {
              id: "faq-1",              title: "Why are gutters important for my home?",              content: "Gutters protect your home's foundation, landscaping, and siding by diverting rainwater away. Without proper gutters, water can cause erosion, basement flooding, and structural damage."
            },
            {
              id: "faq-2",              title: "What types of gutters do you install?",              content: "We specialize in seamless aluminum gutters, custom-fabricated on-site to perfectly fit your home. We also offer various color options to match your exterior."
            },
            {
              id: "faq-3",              title: "How often should I clean my gutters?",              content: "Generally, gutters should be cleaned at least twice a year, typically in spring and fall. Homes surrounded by many trees may require more frequent cleaning. Gutter guards can significantly reduce this frequency."
            },
            {
              id: "faq-4",              title: "Do you offer gutter repair services?",              content: "Yes, we provide comprehensive gutter repair services, including fixing leaks, re-pitching sagging sections, replacing damaged components, and addressing any issues to restore functionality."
            }
          ]}
          faqsAnimation={"slide-up"}
          textPosition={"left"}
          useInvertedBackground={true}
          ariaLabel={"FAQ section"}
        />
      </div>
      <div id="contact" data-section="contact">
        <ContactSplitForm
          title={"Get Your Free Gutter Quote"}
          description={"Fill out the form below and our team will get back to you promptly with a personalized estimate."}
          inputs={[
            { name: "name", type: "text", placeholder: "Your Name", required: true },
            { name: "email", type: "email", placeholder: "Your Email", required: true },
            { name: "phone", type: "tel", placeholder: "Your Phone Number" }
          ]}
          textarea={{
            name: "message",            placeholder: "Tell us about your project...",            rows: 4
          }}
          useInvertedBackground={false}
          imageSrc={getAssetUrl("contact-gutters")}
          mediaAnimation={"slide-up"}
          mediaPosition={"right"}
          buttonText={"Request a Quote"}
          ariaLabel={"Contact section"}
        />
      </div>
      <div id="footer" data-section="footer">
        <FooterCard
          logoText={"Florida Precision Gutters"}
          copyrightText={"© 2024 Florida Precision Gutters. All rights reserved."}
          socialLinks={[
            { icon: Facebook, href: "#", ariaLabel: "Facebook" },
            { icon: Instagram, href: "#", ariaLabel: "Instagram" },
            { icon: Twitter, href: "#", ariaLabel: "Twitter" }
          ]}
          ariaLabel={"Site footer"}
        />
      </div>
    </ThemeProvider>
  );
}
