"use client";

import Link from "next/link";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarLayoutFloatingOverlay from "@/components/navbar/NavbarLayoutFloatingOverlay/NavbarLayoutFloatingOverlay";
import HeroBillboardTestimonial from "@/components/sections/hero/HeroBillboardTestimonial";
import AboutMetric from "@/components/sections/about/AboutMetric";
import FeatureCardNine from "@/components/sections/feature/FeatureCardNine";
import MetricCardEleven from "@/components/sections/metrics/MetricCardEleven";
import ProductCardThree from "@/components/sections/product/ProductCardThree";
import PricingCardThree from "@/components/sections/pricing/PricingCardThree";
import ContactText from "@/components/sections/contact/ContactText";
import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal";
import { Zap, Award, Brain, Gauge, Leaf, Sparkles } from "lucide-react";

export default function HomePage() {
  return (
    <ThemeProvider
      defaultButtonVariant="hover-magnetic"
      defaultTextAnimation="background-highlight"
      borderRadius="soft"
      contentWidth="small"
      sizing="largeSizeMediumTitles"
      background="blurBottom"
      cardStyle="inset"
      primaryButtonStyle="flat"
      secondaryButtonStyle="radial-glow"
      headingFontWeight="extrabold"
    >
      {/* Navbar */}
      <div id="nav" data-section="nav">
        <NavbarLayoutFloatingOverlay
          brandName="BatchMind AI"
          navItems={[
            { name: "Features", id: "features" },
            { name: "How It Works", id: "how-it-works" },
            { name: "Demo", id: "demo" },
            { name: "Login", id: "login" },
          ]}
          button={{ text: "Launch Dashboard", href: "/dashboard" }}
          className="fixed top-4 left-4 right-4 z-50"
          buttonClassName="bg-[#00BFA5] text-[#0F172A] font-semibold rounded-lg px-6 py-2 hover:brightness-110 transition-all duration-200"
        />
      </div>

      {/* Hero Section */}
      <div id="hero" data-section="hero">
        <HeroBillboardTestimonial
          title="Every Batch. Optimized. Explained. Improved."
          description="AI-driven multi-objective optimization for energy, quality, and carbon management in manufacturing."
          tag="Smart Manufacturing Platform"
          tagAnimation="slide-up"
          background={{ variant: "downward-rays-animated-grid" }}
          imageSrc="https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AP0AjJmV3m6mh1sukO97SYkjcn/a-dark-industrial-manufacturing-facility-1772479137748-3d84082e.png"
          imageAlt="BatchMind AI Manufacturing Control Room"
          mediaAnimation="slide-up"
          testimonials={[
            {
              name: "Operator Yash B.",
              handle: "Production Line Lead",
              testimonial: "BatchMind AI reduced our energy consumption by 12.8% while maintaining quality standards. The AI explanations helped us optimize faster.",
              rating: 5,
              imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AP0AjJmV3m6mh1sukO97SYkjcn/professional-headshot-of-a-manufacturing-1772479137166-fab899ed.png",
              imageAlt: "Operator Yash B.",
            },
            {
              name: "Operations Manager",
              handle: "Manufacturing Excellence",
              testimonial: "The Golden Signature modes transformed how we balance energy, quality, and sustainability. Highly recommend for any manufacturer.",
              rating: 5,
              imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AP0AjJmV3m6mh1sukO97SYkjcn/professional-headshot-of-a-manufacturing-1772479137079-ba356ada.png",
              imageAlt: "Operations Manager",
            },
          ]}
          testimonialRotationInterval={5000}
          useInvertedBackground={false}
          buttons={[
            { text: "Launch Dashboard", href: "/dashboard" },
            { text: "Watch Demo", href: "/demo" },
          ]}
          buttonAnimation="slide-up"
          ariaLabel="BatchMind AI Hero Section"
        />
      </div>

      {/* Metrics Section */}
      <div id="metrics" data-section="metrics">
        <AboutMetric
          title="Proven Results from Real-World Manufacturing Optimization"
          useInvertedBackground={false}
          metricsAnimation="slide-up"
          metrics={[
            { icon: Zap, label: "Average Energy Saved per Batch", value: "12.8%" },
            { icon: Award, label: "Golden Signature Modes", value: "3" },
            { icon: Brain, label: "Prediction Accuracy", value: ">90%" },
            { icon: Gauge, label: "Batch Optimization Time", value: "<5 min" },
          ]}
          ariaLabel="Key Metrics Section"
        />
      </div>

      {/* Features Section */}
      <div id="features" data-section="features">
        <FeatureCardNine
          title="Intelligent Manufacturing Optimization"
          description="Harness AI-driven insights to optimize every aspect of your manufacturing process with explainable recommendations."
          tag="How It Works"
          tagAnimation="slide-up"
          showStepNumbers={true}
          animationType="scale-rotate"
          textboxLayout="default"
          useInvertedBackground={false}
          features={[
            {
              id: 1,
              title: "Multi-Target Prediction",
              description: "Our AI simultaneously predicts and optimizes energy consumption, quality scores, and carbon emissions across batch parameters.",
              phoneOne: {
                imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AP0AjJmV3m6mh1sukO97SYkjcn/abstract-illustration-of-ai-powered-mult-1772479136604-aff491de.png",
                imageAlt: "AI Prediction System",
              },
              phoneTwo: {
                imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AP0AjJmV3m6mh1sukO97SYkjcn/real-time-batch-monitoring-interface-sho-1772479138124-2b115611.png?_wi=1",
                imageAlt: "Batch Monitoring",
              },
            },
            {
              id: 2,
              title: "Golden Signature Engine",
              description: "Three optimized operating modes (ECO, QUALITY, BALANCED) that learn from your facility's unique patterns and constraints.",
              phoneOne: {
                imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AP0AjJmV3m6mh1sukO97SYkjcn/golden-signature-engine-visualization-sh-1772479138733-b5593d65.png?_wi=1",
                imageAlt: "Golden Signature Engine",
              },
              phoneTwo: {
                imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AP0AjJmV3m6mh1sukO97SYkjcn/advanced-industrial-saas-dashboard-inter-1772479139028-807f53a6.png?_wi=1",
                imageAlt: "Dashboard Interface",
              },
            },
            {
              id: 3,
              title: "RAG-Powered Fault Guidance",
              description: "Explainable AI detects anomalies, retrieves historical patterns, and recommends corrective actions with maintenance references.",
              phoneOne: {
                imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AP0AjJmV3m6mh1sukO97SYkjcn/rag-powered-fault-guidance-system-visual-1772479138197-07d35feb.png?_wi=1",
                imageAlt: "RAG Guidance System",
              },
              phoneTwo: {
                imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AP0AjJmV3m6mh1sukO97SYkjcn/top-down-schematic-diagram-of-manufactur-1772479137455-01b744bb.png?_wi=1",
                imageAlt: "Machine Blueprint",
              },
            },
          ]}
          ariaLabel="Feature Showcase Section"
        />
      </div>

      {/* Dashboard Showcase Section */}
      <div id="dashboard-showcase" data-section="dashboard-showcase">
        <MetricCardEleven
          title="Real-Time Operator Dashboard"
          description="Monitor batch performance, machine health, and sustainability metrics in one unified interface."
          animationType="slide-up"
          textboxLayout="default"
          useInvertedBackground={false}
          metrics={[
            {
              id: "1",
              value: "91.4%",
              title: "Quality Score",
              description: "Current batch performance vs Golden Signature",
              imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AP0AjJmV3m6mh1sukO97SYkjcn/real-time-batch-monitoring-interface-sho-1772479138124-2b115611.png?_wi=2",
              imageAlt: "Quality Score Display",
            },
            {
              id: "2",
              value: "78.4",
              title: "Sustainability Score",
              description: "Carbon footprint and energy efficiency combined",
              imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AP0AjJmV3m6mh1sukO97SYkjcn/monthly-carbon-budget-tracker-showing-ho-1772479137486-8a27a3ff.png?_wi=1",
              imageAlt: "Sustainability Tracker",
            },
          ]}
          ariaLabel="Dashboard Showcase Metrics"
        />
      </div>

      {/* KPI Cards Section */}
      <div id="kpi-cards" data-section="kpi-cards">
        <ProductCardThree
          title="Key Performance Indicators"
          description="Track critical batch metrics at a glance with live updates and trend indicators."
          gridVariant="four-items-2x2-equal-grid"
          animationType="slide-up"
          textboxLayout="default"
          useInvertedBackground={false}
          products={[
            {
              id: "1",
              name: "Quality Score",
              price: "91.4%",
              imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AP0AjJmV3m6mh1sukO97SYkjcn/real-time-batch-monitoring-interface-sho-1772479138124-2b115611.png?_wi=3",
              imageAlt: "Quality metrics display",
            },
            {
              id: "2",
              name: "Energy Consumption",
              price: "312 kWh",
              imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AP0AjJmV3m6mh1sukO97SYkjcn/advanced-industrial-saas-dashboard-inter-1772479139028-807f53a6.png?_wi=2",
              imageAlt: "Energy usage chart",
            },
            {
              id: "3",
              name: "Yield Percentage",
              price: "88.3%",
              imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AP0AjJmV3m6mh1sukO97SYkjcn/real-time-batch-monitoring-interface-sho-1772479138124-2b115611.png?_wi=4",
              imageAlt: "Yield indicator",
            },
            {
              id: "4",
              name: "Sustainability",
              price: "78.4 pts",
              imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AP0AjJmV3m6mh1sukO97SYkjcn/monthly-carbon-budget-tracker-showing-ho-1772479137486-8a27a3ff.png?_wi=2",
              imageAlt: "Carbon budget tracker",
            },
          ]}
          ariaLabel="KPI Cards Section"
        />
      </div>

      {/* Golden Signatures Section */}
      <div id="golden-signatures-section" data-section="golden-signatures-section">
        <PricingCardThree
          title="Golden Signature Modes"
          description="Three optimized operating modes tailored to your manufacturing priorities."
          tag="Operating Modes"
          tagAnimation="slide-up"
          animationType="slide-up"
          textboxLayout="default"
          useInvertedBackground={false}
          plans={[
            {
              id: "eco",
              badge: "Most Deployed",
              badgeIcon: Leaf,
              price: "312 kWh",
              name: "ECO Mode",
              buttons: [
                { text: "Activate", href: "#" },
                { text: "View History", href: "#" },
              ],
              features: [
                "Temperature: 183°C",
                "Belt Speed: 2.3 m/s",
                "Hold Time Ph.1: 12 min",
                "Energy: 312 kWh ↓",
                "CO₂: 145 kg ↓",
                "Quality: 91% ✓",
                "Updated 3 times",
                "Last: 2 hours ago",
              ],
            },
            {
              id: "quality",
              price: "287 kWh",
              name: "QUALITY Mode",
              buttons: [
                { text: "Activate", href: "#" },
                { text: "View History", href: "#" },
              ],
              features: [
                "Temperature: 185°C",
                "Belt Speed: 2.1 m/s",
                "Hold Time Ph.1: 14 min",
                "Energy: 287 kWh",
                "CO₂: 138 kg",
                "Quality: 94% ↑",
                "Updated 2 times",
                "Last: 4 hours ago",
              ],
            },
            {
              id: "balanced",
              price: "299 kWh",
              name: "BALANCED Mode",
              buttons: [
                { text: "Activate", href: "#" },
                { text: "View History", href: "#" },
              ],
              features: [
                "Temperature: 184°C",
                "Belt Speed: 2.2 m/s",
                "Hold Time Ph.1: 13 min",
                "Energy: 299 kWh",
                "CO₂: 142 kg",
                "Quality: 92% ✓",
                "Updated 3 times",
                "Last: 1 hour ago",
              ],
            },
          ]}
          ariaLabel="Golden Signatures Section"
        />
      </div>

      {/* CTA Section */}
      <div id="cta-section" data-section="cta-section">
        <ContactText
          text="Ready to optimize your manufacturing process? Experience BatchMind AI's intelligent optimization in action today."
          animationType="entrance-slide"
          background={{ variant: "downward-rays-static-grid" }}
          useInvertedBackground={false}
          buttons={[
            { text: "Schedule Demo", href: "/demo" },
            { text: "Contact Sales", href: "/contact" },
          ]}
          ariaLabel="Call to Action Section"
        />
      </div>

      {/* Footer */}
      <div id="footer" data-section="footer">
        <FooterLogoReveal
          logoText="BatchMind AI"
          leftLink={{ text: "Privacy Policy", href: "/privacy" }}
          rightLink={{ text: "Terms of Service", href: "/terms" }}
          ariaLabel="Site footer"
        />
      </div>
    </ThemeProvider>
  );
}