"use client";

import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleCentered from "@/components/navbar/NavbarStyleCentered/NavbarStyleCentered";
import ProductCardTwo from "@/components/sections/product/ProductCardTwo";
import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal";
import Link from "next/link";
import { Award } from "lucide-react";

export default function ShopPage() {
  const navItems = [
    { name: "Home", id: "/" },
    { name: "Shop", id: "/shop" },
    { name: "About", id: "/about" },
    { name: "Reviews", id: "/testimonials" },
    { name: "Contact", id: "/contact" },
  ];

  const handleNavClick = (id: string) => {
    if (id === "/") {
      window.location.href = "/";
    } else if (id.startsWith("/")) {
      window.location.href = id;
    } else if (id.startsWith("http")) {
      window.open(id, "_blank");
    } else {
      const element = document.getElementById(id);
      if (element) {
        element.scrollIntoView({ behavior: "smooth" });
      }
    }
  };

  return (
    <ThemeProvider
      defaultButtonVariant="bounce-effect"
      defaultTextAnimation="background-highlight"
      borderRadius="rounded"
      contentWidth="mediumSmall"
      sizing="mediumLargeSizeMediumTitles"
      background="fluid"
      cardStyle="gradient-radial"
      primaryButtonStyle="primary-glow"
      secondaryButtonStyle="solid"
      headingFontWeight="light"
    >
      <div id="nav" data-section="nav">
        <NavbarStyleCentered
          navItems={navItems}
          button={{ text: "Shop Now", href: "/shop" }}
          brandName="StyleHub"
        />
      </div>

      <div id="all-products" data-section="all-products">
        <ProductCardTwo
          title="Shop All Collections"
          description="Browse our complete range of premium fashion and apparel for every occasion"
          tag="Complete Collection"
          tagIcon={Award}
          textboxLayout="default"
          useInvertedBackground={false}
          animationType="slide-up"
          gridVariant="three-columns-all-equal-width"
          products={[
            {
              id: "1",
              brand: "StyleHub Premium",
              name: "Classic Casual Shirt",
              price: "$89.99",
              rating: 5,
              reviewCount: "2.4k",
              imageSrc: "http://img.b2bpic.net/free-photo/portrait-handsome-smiling-stylish-hipster-lambersexual-modelmodern-man-dressed-white-shirt-fashion-male-posing-street-background-sunglasses-outdoors-sunset_158538-20630.jpg?_wi=2",
              imageAlt: "Classic casual shirt",
            },
            {
              id: "2",
              brand: "StyleHub Essentials",
              name: "Blue Denim Jacket",
              price: "$129.99",
              rating: 5,
              reviewCount: "1.8k",
              imageSrc: "http://img.b2bpic.net/free-photo/woman-model-demonstrating-winter-cloths_1303-16967.jpg?_wi=2",
              imageAlt: "Blue denim jacket",
            },
            {
              id: "3",
              brand: "StyleHub Sport",
              name: "Premium Sneakers",
              price: "$149.99",
              rating: 5,
              reviewCount: "3.2k",
              imageSrc: "http://img.b2bpic.net/free-photo/shoes-sand_23-2147647050.jpg?_wi=2",
              imageAlt: "Premium sneakers",
            },
            {
              id: "4",
              brand: "StyleHub Couture",
              name: "Elegant Evening Dress",
              price: "$199.99",
              rating: 5,
              reviewCount: "1.5k",
              imageSrc: "http://img.b2bpic.net/free-photo/attractive-woman-evening-dress-combing-hair_176420-17845.jpg?_wi=2",
              imageAlt: "Elegant evening dress",
            },
            {
              id: "5",
              brand: "StyleHub Comfort",
              name: "Cozy Knit Sweater",
              price: "$79.99",
              rating: 5,
              reviewCount: "2.9k",
              imageSrc: "http://img.b2bpic.net/free-photo/close-up-sensual-blond-girl-knitted-sweater-emotionally-posing-outdoor_574295-4018.jpg?_wi=2",
              imageAlt: "Cozy knit sweater",
            },
            {
              id: "6",
              brand: "StyleHub Classic",
              name: "Dark Denim Jeans",
              price: "$99.99",
              rating: 5,
              reviewCount: "2.1k",
              imageSrc: "http://img.b2bpic.net/free-photo/spring-wardrobe-switch-top-view_23-2150264140.jpg?_wi=2",
              imageAlt: "Dark denim jeans",
            },
          ]}
        />
      </div>

      <div id="featured-new-arrivals" data-section="featured-new-arrivals">
        <ProductCardTwo
          title="New Arrivals"
          description="Discover the latest additions to our StyleHub collection"
          tag="Fresh Stock"
          tagIcon={Award}
          textboxLayout="default"
          useInvertedBackground={false}
          animationType="slide-up"
          gridVariant="three-columns-all-equal-width"
          products={[
            {
              id: "7",
              brand: "StyleHub Limited",
              name: "Vintage Leather Jacket",
              price: "$189.99",
              rating: 5,
              reviewCount: "1.2k",
              imageSrc: "http://img.b2bpic.net/free-photo/woman-model-demonstrating-winter-cloths_1303-16967.jpg?_wi=3",
              imageAlt: "Vintage leather jacket",
            },
            {
              id: "8",
              brand: "StyleHub Modern",
              name: "Minimalist Cotton Tee",
              price: "$49.99",
              rating: 5,
              reviewCount: "980",
              imageSrc: "http://img.b2bpic.net/free-photo/portrait-handsome-smiling-stylish-hipster-lambersexual-modelmodern-man-dressed-white-shirt-fashion-male-posing-street-background-sunglasses-outdoors-sunset_158538-20630.jpg?_wi=3",
              imageAlt: "Minimalist cotton tee",
            },
            {
              id: "9",
              brand: "StyleHub Trend",
              name: "Cargo Pants",
              price: "$119.99",
              rating: 5,
              reviewCount: "1.1k",
              imageSrc: "http://img.b2bpic.net/free-photo/spring-wardrobe-switch-top-view_23-2150264140.jpg?_wi=3",
              imageAlt: "Cargo pants",
            },
          ]}
        />
      </div>

      <div id="footer" data-section="footer">
        <FooterLogoReveal
          logoText="StyleHub"
          leftLink={{ text: "Privacy Policy", href: "#privacy" }}
          rightLink={{ text: "Terms of Service", href: "#terms" }}
        />
      </div>
    </ThemeProvider>
  );
}