"use client";

import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
import HeroSplitKpi from '@/components/sections/hero/HeroSplitKpi';
import TestimonialAboutCard from '@/components/sections/about/TestimonialAboutCard';
import FeatureCardTwentyEight from '@/components/sections/feature/FeatureCardTwentyEight';
import MetricCardSeven from '@/components/sections/metrics/MetricCardSeven';
import TestimonialCardSixteen from '@/components/sections/testimonial/TestimonialCardSixteen';
import TeamCardEleven from '@/components/sections/team/TeamCardEleven';
import SocialProofOne from '@/components/sections/socialProof/SocialProofOne';
import ContactSplitForm from '@/components/sections/contact/ContactSplitForm';
import FooterCard from '@/components/sections/footer/FooterCard';
import { ShieldCheck, Facebook, Instagram, Twitter, Youtube } from "lucide-react";

export default function LandingPage() {
  const assetMap = {
    "hero-video": "http://img.b2bpic.net/free-photo/physical-activity-stats-around-person_23-2150163373.jpg",    "hero-video-fallback": "http://img.b2bpic.net/free-photo/people-training-together-outdoors_23-2150765116.jpg",    "avatar-1": "http://img.b2bpic.net/free-photo/portrait-smiling-fitness-woman-with-towel-resting_171337-6262.jpg",    "avatar-2": "http://img.b2bpic.net/free-photo/beautiful-girl-is-engaged-gym_1157-24073.jpg",    "avatar-3": "http://img.b2bpic.net/free-photo/young-woman-sportswear-beach_273609-5367.jpg",    "avatar-4": "http://img.b2bpic.net/free-photo/smiling-fitness-girl_23-2148017347.jpg",    "about-image": "http://img.b2bpic.net/free-photo/medium-shot-women-training-together_23-2149267034.jpg",    "testimonial-1": "http://img.b2bpic.net/free-photo/attractive-athletic-girl-standing-near-gym-equipment-healthy-lifestyle_78826-3376.jpg",    "testimonial-2": "http://img.b2bpic.net/free-photo/medium-shot-business-woman-pointing-camera-smiling_1098-20747.jpg",    "testimonial-3": "http://img.b2bpic.net/free-photo/confident-female-boxer-closeup-portrait_107420-65025.jpg",    "testimonial-4": "http://img.b2bpic.net/free-photo/front-view-young-female-rejoicing-pink_179666-2155.jpg",    "testimonial-5": "http://img.b2bpic.net/free-photo/low-angle-smiley-woman-with-headphones-gym_23-2148419813.jpg",    "team-1": "http://img.b2bpic.net/free-photo/handsome-man-dressed-black-sportswear-baseball-cap-lifts-dumbbell_613910-5628.jpg",    "team-2": "http://img.b2bpic.net/free-photo/medium-shot-fit-woman-gym_23-2149445949.jpg",    "team-3": "http://img.b2bpic.net/free-photo/happy-young-brunette-doing-some-bicep-curls-with-dumbbells-smiling-gym_662251-1165.jpg",    "team-4": "http://img.b2bpic.net/free-photo/picture-attractive-woman-smiling-camera-with-phone_197531-33785.jpg",    "contact-image": "http://img.b2bpic.net/free-photo/defocused-running-machine_1203-366.jpg"
  };

  const resolveAsset = (id) => {
    const asset = assetMap[id.replace('asset://', '')];
    if (asset) return asset;
    // Fallback if not found, pick a generic image or first available if specified
    return "https://webuild-dev.s3.eu-north-1.amazonaws.com/default/no-image.jpg?id=fallback";
  };

  return (
    <ThemeProvider
      defaultButtonVariant="hover-magnetic"
      defaultTextAnimation="background-highlight"
      borderRadius="rounded"
      contentWidth="small"
      sizing="largeSizeMediumTitles"
      background="circleGradient"
      cardStyle="inset"
      primaryButtonStyle="gradient"
      secondaryButtonStyle="layered"
      headingFontWeight="light"
    >
      <div id="nav" data-section="nav" >
        <NavbarStyleFullscreen
          brandName="D9 FITNESS"
          navItems={[
            { name: "Home", id: "#hero" },
            { name: "About", id: "#about" },
            { name: "Programs", id: "#features" },
            { name: "Success", id: "#testimonials" },
            { name: "Team", id: "#team" },
            { name: "Contact", id: "#contact" }
          ]}
          button={{ text: "WhatsApp Now", href: "https://wa.me/XXXXXXXXXX" }}
        />
      </div>
      <div id="hero" data-section="hero" >
        <HeroSplitKpi
          title="Built Different Built D9"
          description="Welcome to Shahpur Jats transformation powerhouse Seven years of turning beginners into believers and dreams into results Not just a gym—a family that builds strength, confidence, and unstoppable mindset."
          background={{"variant":"plain"}}
          kpis={[
            { value: "7+", label: "Years Expertise" },
            { value: "1000s", label: "Transformed" },
            { value: "1", label: "Community" }
          ]}
          enableKpiAnimation={false}
          buttons={[
            { text: "WhatsApp Now", href: "https://wa.me/XXXXXXXXXX" }
          ]}
          avatars={[
            { src: resolveAsset("asset://avatar-1"), alt: "Happy gym member" },
            { src: resolveAsset("asset://avatar-2"), alt: "Smiling trainer" },
            { src: resolveAsset("asset://avatar-3"), alt: "Motivated athlete" },
            { src: resolveAsset("asset://avatar-4"), alt: "Confident woman" }
          ]}
          avatarText="Join our thriving community!"
          videoSrc={resolveAsset("asset://hero-video")}
          imageSrc={resolveAsset("asset://hero-video-fallback")}
          imageAlt="Dynamic gym environment with members exercising"
          mediaAnimation="none"
        />
      </div>
      <div id="about" data-section="about" >
        <TestimonialAboutCard
          tag="Our Story"
          title="7 Years of Unrivaled Transformation"
          description="At D9 Fitness, we've dedicated seven years to perfecting the art of personal transformation. More than just a gym, we're a supportive family committed to building not just muscle, but unwavering confidence and an unstoppable mindset."
          subdescription="From ambitious beginners taking their first step, to elite athletes chasing specific goals, and women seeking holistic well-being – our tailored approach ensures every member achieves their unique vision of success."
          icon={ShieldCheck}
          imageSrc={resolveAsset("asset://about-image")}
          imageAlt="Personal trainer helping a client with weights"
          mediaAnimation="none"
          useInvertedBackground={true}
        />
      </div>
      <div id="features" data-section="features" >
        <FeatureCardTwentyEight
          title="Programs Designed for Your Success"
          description="Whether you're starting fresh, aiming for elite performance, or seeking holistic wellness, D9 Fitness has a program tailored just for you. Discover a path that fits your goals and transforms your potential."
          features={[
            { id: "beginner", title: "Ambitious Beginners", subtitle: "Supportive Start", category: "Foundation", value: "Guidance" },
            { id: "athlete", title: "Serious Athletes & Police Aspirants", subtitle: "Elite Performance", category: "Advanced", value: "Mastery" },
            { id: "women", title: "Women Seeking Confidence", subtitle: "Holistic Wellness", category: "Empowerment", value: "Growth" }
          ]}
          animationType="slide-up"
          textboxLayout="default"
          useInvertedBackground={false}
        />
      </div>
      <div id="metrics" data-section="metrics" >
        <MetricCardSeven
          title="Impact & Results That Speak Volumes"
          description="Our commitment to transformation is reflected in the tangible success of our members. Join the ranks of individuals who have achieved their fitness aspirations with D9 Fitness."
          metrics={[
            { id: "years", value: "7+", title: "Years Expertise", items: ["Established Trust", "Proven Methods"] },
            { id: "transformed", value: "1000s", title: "Lives Transformed", items: ["Visible Results", "Personal Journeys"] },
            { id: "rating", value: "5-Star", title: "Community Rating", items: ["Unmatched Support", "Family Environment"] }
          ]}
          animationType="slide-up"
          textboxLayout="default"
          useInvertedBackground={true}
        />
      </div>
      <div id="testimonials" data-section="testimonials" >
        <TestimonialCardSixteen
          title="Real Stories, Real Results"
          description="Hear directly from our members who have experienced life-changing transformations and found a true fitness family at D9. Their journeys are our greatest motivation."
          kpiItems={[
            { value: "98%", label: "Satisfaction" },
            { value: "7 YRS", label: "Experience" },
            { value: "1 Community", label: "Stronger Together" }
          ]}
          testimonials={[
            { id: "1", name: "Sarah Johnson", role: "Beginner Program", company: "Shahpur Jat", rating: 5, imageSrc: resolveAsset("asset://testimonial-1"), imageAlt: "Sarah Johnson, happy gym member" },
            { id: "2", name: "Michael Chen", role: "Police Aspirant", company: "Shahpur Jat", rating: 5, imageSrc: resolveAsset("asset://testimonial-2"), imageAlt: "Michael Chen, motivated athlete" },
            { id: "3", name: "Emily Rodriguez", role: "Women's Wellness", company: "Shahpur Jat", rating: 5, imageSrc: resolveAsset("asset://testimonial-3"), imageAlt: "Emily Rodriguez, confident woman" },
            { id: "4", name: "David Kim", role: "Strength Training", company: "Shahpur Jat", rating: 5, imageSrc: resolveAsset("asset://testimonial-4"), imageAlt: "David Kim, satisfied client" },
            { id: "5", name: "Priya Sharma", role: "Yoga & Zumba", company: "Shahpur Jat", rating: 5, imageSrc: resolveAsset("asset://testimonial-5"), imageAlt: "Priya Sharma, energetic gym member" }
          ]}
          animationType="slide-up"
          textboxLayout="default"
          useInvertedBackground={false}
        />
      </div>
      <div id="team" data-section="team" >
        <TeamCardEleven
          title="Meet Your Expert Coaches"
          description="Our highly qualified and passionate trainers are dedicated to guiding you every step of the way. With diverse expertise and a shared commitment to your success, they are the heart of D9 Fitness."
          groups={[
            { id: "core-team", groupTitle: "D9 Fitness Team", members: [
              { id: "trainer-1", title: "Rajesh Kumar", subtitle: "Head Trainer & Strength Coach", detail: "7+ years experience in strength & conditioning, specializing in police aspirant training.", imageSrc: resolveAsset("asset://team-1"), imageAlt: "Rajesh Kumar, Head Trainer" },
              { id: "trainer-2", title: "Neha Singh", subtitle: "Fitness & Wellness Specialist", detail: "Expert in women's fitness, weight management, yoga, and Zumba.", imageSrc: resolveAsset("asset://team-2"), imageAlt: "Neha Singh, Fitness Specialist" },
              { id: "trainer-3", title: "Amit Sharma", subtitle: "Beginner Program Lead", detail: "Dedicated to making fitness accessible and enjoyable for new gym members.", imageSrc: resolveAsset("asset://team-3"), imageAlt: "Amit Sharma, Beginner Program Lead" },
              { id: "trainer-4", title: "Pooja Gupta", subtitle: "Holistic Wellness Coach", detail: "Focuses on mental well-being, nutrition counseling, and personalized fitness plans.", imageSrc: resolveAsset("asset://team-4"), imageAlt: "Pooja Gupta, Holistic Wellness Coach" }
            ] }
          ]}
          animationType="slide-up"
          textboxLayout="default"
          useInvertedBackground={true}
        />
      </div>
      <div id="social-proof" data-section="social-proof" >
        <SocialProofOne
          title="Trusted by the Shahpur Jat Community"
          description="Our reputation for excellence is built on years of delivering exceptional results and fostering a welcoming environment. We are proud to be the preferred choice for fitness enthusiasts in Shahpur Jat."
          names={[
            "Local Businesses",            "Community Groups",            "Sports Clubs",            "Health Partners",            "Education Institutes",            "Wellness Brands",            "Youth Organizations"
          ]}
          textboxLayout="default"
          useInvertedBackground={false}
        />
      </div>
      <div id="contact" data-section="contact" >
        <ContactSplitForm
          title="Ready to Start Your Transformation?"
          description="Get in touch with us today to learn more about our programs, schedule a gym visit, or connect with a trainer. Your journey to a stronger, more confident you begins here."
          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", required: true }
          ]}
          textarea={{ name: "message", placeholder: "Tell us about your fitness goals...", rows: 4, required: false }}
          buttonText="Send Message"
          imageSrc={resolveAsset("asset://contact-image")}
          imageAlt="Modern gym interior with equipment"
          mediaAnimation="none"
          useInvertedBackground={true}
        />
      </div>
      <div id="footer" data-section="footer" >
        <FooterCard
          logoText="D9 FITNESS"
          copyrightText="© 2024 D9 Fitness. All rights reserved."
          socialLinks={[
            { icon: Facebook, href: "https://facebook.com/d9fitness", ariaLabel: "Facebook" },
            { icon: Instagram, href: "https://instagram.com/d9fitness", ariaLabel: "Instagram" },
            { icon: Twitter, href: "https://twitter.com/d9fitness", ariaLabel: "Twitter" },
            { icon: Youtube, href: "https://youtube.com/d9fitness", ariaLabel: "YouTube" }
          ]}
        />
      </div>
    </ThemeProvider>
  );
}
