import { jsx, jsxs } from "react/jsx-runtime";
import { Link, useLocation } from "@tanstack/react-router";
import { MapPin, Instagram, Radio, MessageCircle, X, Menu, Building2, ShoppingBag, BriefcaseBusiness, ShieldAlert } from "lucide-react";
import { u as useSiteSettings } from "./useSiteSettings-7O51JHh5.js";
import { l as logo } from "./logo-DIdLvJAL.js";
import { useState, useRef, useEffect } from "react";
import { T as ThemeToggle } from "./ThemeToggle-FQS9vN6L.js";
function Footer() {
  const { settings } = useSiteSettings();
  return /* @__PURE__ */ jsx("footer", { className: "border-t border-border bg-card/30 backdrop-blur-md pt-12 pb-8 mt-10", children: /* @__PURE__ */ jsxs("div", { className: "section-container", children: [
    /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-4 gap-8 mb-10", children: [
      /* @__PURE__ */ jsxs("div", { className: "md:col-span-2", children: [
        /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-2 mb-4", children: [
          /* @__PURE__ */ jsx("span", { className: "grid h-10 w-10 shrink-0 place-items-center overflow-hidden", children: /* @__PURE__ */ jsx("img", { src: logo, alt: "Pergam Store", className: "h-full w-full object-contain drop-shadow-sm" }) }),
          /* @__PURE__ */ jsxs("span", { className: "font-display text-xl font-bold", children: [
            "Pergam",
            /* @__PURE__ */ jsx("span", { className: "text-primary", children: "Store" })
          ] })
        ] }),
        /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground leading-relaxed max-w-sm", children: "Premium game marketplace terpercaya. Tempat terbaik untuk rental akun, stock akun Free Fire & Mobile Legends, dan layanan game lainnya." }),
        /* @__PURE__ */ jsxs("address", { className: "mt-5 flex max-w-md gap-3 text-sm not-italic leading-relaxed text-muted-foreground", children: [
          /* @__PURE__ */ jsx(MapPin, { className: "mt-0.5 h-4 w-4 shrink-0 text-primary" }),
          /* @__PURE__ */ jsxs("span", { children: [
            /* @__PURE__ */ jsx("span", { className: "block font-semibold text-foreground", children: "PT PERGAM STORE SENTOSA" }),
            /* @__PURE__ */ jsx("span", { className: "block", children: "Songgom, KAB Brebes, Jawa Tengah." })
          ] })
        ] })
      ] }),
      /* @__PURE__ */ jsxs("div", { children: [
        /* @__PURE__ */ jsx("h4", { className: "font-bold text-foreground mb-4", children: "Navigasi" }),
        /* @__PURE__ */ jsxs("ul", { className: "space-y-2 text-sm text-muted-foreground", children: [
          /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/", className: "hover:text-primary transition-colors", children: "Home" }) }),
          /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/tentang", className: "hover:text-primary transition-colors", children: "Tentang Perusahaan" }) }),
          /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/produk", className: "hover:text-primary transition-colors", children: "Katalog Produk" }) }),
          /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/layanan", className: "hover:text-primary transition-colors", children: "Layanan Kami" }) }),
          /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/lapor", className: "hover:text-primary transition-colors", children: "Laporan" }) }),
          /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", { href: "/#contact", className: "hover:text-primary transition-colors", children: "Kontak" }) })
        ] })
      ] }),
      /* @__PURE__ */ jsxs("div", { children: [
        /* @__PURE__ */ jsx("h4", { className: "font-bold text-foreground mb-4", children: "Sosial Media" }),
        /* @__PURE__ */ jsxs("ul", { className: "space-y-2 text-sm text-muted-foreground", children: [
          settings.instagramUrl && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("a", { href: settings.instagramUrl, target: "_blank", rel: "noreferrer", className: "flex items-center gap-2 hover:text-primary transition-colors", children: [
            /* @__PURE__ */ jsx(Instagram, { className: "w-4 h-4" }),
            " Instagram"
          ] }) }),
          settings.tiktokUrl && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("a", { href: settings.tiktokUrl, target: "_blank", rel: "noreferrer", className: "flex items-center gap-2 hover:text-primary transition-colors", children: [
            /* @__PURE__ */ jsx(Radio, { className: "w-4 h-4" }),
            " TikTok"
          ] }) }),
          settings.whatsappChannelUrl && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("a", { href: settings.whatsappChannelUrl, target: "_blank", rel: "noreferrer", className: "flex items-center gap-2 hover:text-primary transition-colors", children: [
            /* @__PURE__ */ jsx(MessageCircle, { className: "w-4 h-4" }),
            " Saluran WhatsApp"
          ] }) })
        ] })
      ] })
    ] }),
    /* @__PURE__ */ jsxs("div", { className: "pt-8 border-t border-border flex flex-col md:flex-row items-center justify-between gap-4", children: [
      /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground font-semibold", children: [
        "© ",
        (/* @__PURE__ */ new Date()).getFullYear(),
        " Pergam Store. All rights reserved."
      ] }),
      /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: "Premium game marketplace for mobile-first users." })
    ] })
  ] }) });
}
const navItems = [
  { to: "/", label: "Home" },
  { to: "/produk", label: "Produk" },
  { to: "/layanan", label: "Layanan" },
  { to: "/lapor", label: "Laporan" },
  { to: "/tentang", label: "Tentang" }
];
const sectionLinks = [
  { href: "/#contact", label: "Kontak" }
];
function Navbar() {
  const [scrolled, setScrolled] = useState(false);
  const [hidden, setHidden] = useState(false);
  const [open, setOpen] = useState(false);
  const lastScrollY = useRef(0);
  const location = useLocation();
  useEffect(() => {
    const onScroll = () => {
      const currentScrollY = window.scrollY;
      const scrollingDown = currentScrollY > lastScrollY.current + 8;
      const scrollingUp = currentScrollY < lastScrollY.current - 8;
      setScrolled(currentScrollY > 12);
      if (open || currentScrollY < 80 || scrollingUp) {
        setHidden(false);
      } else if (scrollingDown) {
        setHidden(true);
      }
      lastScrollY.current = currentScrollY;
    };
    onScroll();
    window.addEventListener("scroll", onScroll, { passive: true });
    return () => window.removeEventListener("scroll", onScroll);
  }, [open]);
  useEffect(() => {
    setOpen(false);
    setHidden(false);
  }, [location.pathname]);
  return /* @__PURE__ */ jsxs(
    "header",
    {
      className: `fixed inset-x-0 top-0 z-50 px-3 pt-3 transition-all duration-300 ${hidden ? "-translate-y-full opacity-0" : "translate-y-0 opacity-100"}`,
      children: [
        /* @__PURE__ */ jsxs(
          "nav",
          {
            className: `mx-auto flex h-14 max-w-7xl items-center justify-between rounded-2xl border px-3 transition-all duration-300 md:h-16 md:px-4 ${scrolled ? "border-border bg-card/82 shadow-card backdrop-blur-2xl" : "border-transparent bg-card/54 backdrop-blur-xl"}`,
            children: [
              /* @__PURE__ */ jsxs(Link, { to: "/", className: "group flex min-w-0 items-center gap-2.5", children: [
                /* @__PURE__ */ jsx("span", { className: "grid h-10 w-10 shrink-0 place-items-center overflow-hidden transition group-hover:scale-105", children: /* @__PURE__ */ jsx("img", { src: logo, alt: "Pergam Store", className: "h-full w-full object-contain drop-shadow-sm" }) }),
                /* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
                  /* @__PURE__ */ jsxs("span", { className: "block font-display text-base font-bold leading-none text-foreground", children: [
                    "Pergam",
                    /* @__PURE__ */ jsx("span", { className: "text-primary", children: "Store" })
                  ] }),
                  /* @__PURE__ */ jsx("span", { className: "hidden text-[10px] font-semibold uppercase tracking-[0.16em] text-muted-foreground sm:block", children: "Premium Marketplace" })
                ] })
              ] }),
              /* @__PURE__ */ jsxs("div", { className: "hidden items-center gap-1 rounded-full border border-border bg-background/45 p-1 md:flex", children: [
                navItems.map((item) => {
                  const active = location.pathname === item.to;
                  return /* @__PURE__ */ jsx(
                    Link,
                    {
                      to: item.to,
                      className: `rounded-full px-4 py-2 text-sm font-semibold transition ${active ? "bg-primary text-primary-foreground shadow-glow-sm" : "text-muted-foreground hover:bg-card hover:text-foreground"}`,
                      children: item.label
                    },
                    item.to
                  );
                }),
                sectionLinks.map((item) => /* @__PURE__ */ jsx(
                  "a",
                  {
                    href: item.href,
                    className: "rounded-full px-4 py-2 text-sm font-semibold text-muted-foreground transition hover:bg-card hover:text-foreground",
                    children: item.label
                  },
                  item.href
                ))
              ] }),
              /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
                /* @__PURE__ */ jsx(ThemeToggle, {}),
                /* @__PURE__ */ jsx(
                  "a",
                  {
                    href: "/#contact",
                    className: "btn-primary hidden h-10 min-h-10 px-4 text-sm md:inline-flex",
                    children: "Order"
                  }
                ),
                /* @__PURE__ */ jsx(
                  "button",
                  {
                    type: "button",
                    "aria-label": open ? "Tutup menu" : "Buka menu",
                    onClick: () => {
                      setHidden(false);
                      setOpen((value) => !value);
                    },
                    className: "grid h-10 w-10 place-items-center rounded-full border border-border bg-card/80 text-foreground backdrop-blur-xl transition hover:border-primary/40 md:hidden",
                    children: open ? /* @__PURE__ */ jsx(X, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx(Menu, { className: "h-5 w-5" })
                  }
                )
              ] })
            ]
          }
        ),
        /* @__PURE__ */ jsx(
          "div",
          {
            className: `mx-auto mt-2 max-w-7xl overflow-hidden rounded-3xl border border-border bg-card/92 shadow-card backdrop-blur-2xl transition-all duration-300 md:hidden ${open ? "max-h-96 opacity-100" : "max-h-0 border-transparent opacity-0"}`,
            children: /* @__PURE__ */ jsxs("div", { className: "grid gap-2 p-3", children: [
              navItems.map((item) => {
                const active = location.pathname === item.to;
                return /* @__PURE__ */ jsxs(
                  Link,
                  {
                    to: item.to,
                    className: `flex items-center justify-between rounded-2xl px-4 py-3 text-sm font-bold transition ${active ? "bg-primary text-primary-foreground" : "bg-background/45 text-foreground hover:bg-primary/10"}`,
                    children: [
                      item.label,
                      item.to === "/tentang" && /* @__PURE__ */ jsx(Building2, { className: "h-4 w-4 opacity-75" }),
                      item.to === "/produk" && /* @__PURE__ */ jsx(ShoppingBag, { className: "h-4 w-4 opacity-75" }),
                      item.to === "/layanan" && /* @__PURE__ */ jsx(BriefcaseBusiness, { className: "h-4 w-4 opacity-75" }),
                      item.to === "/lapor" && /* @__PURE__ */ jsx(ShieldAlert, { className: "h-4 w-4 opacity-75" })
                    ]
                  },
                  item.to
                );
              }),
              sectionLinks.map((item) => /* @__PURE__ */ jsx(
                "a",
                {
                  href: item.href,
                  className: "rounded-2xl bg-background/45 px-4 py-3 text-sm font-bold text-foreground transition hover:bg-primary/10",
                  children: item.label
                },
                item.href
              )),
              /* @__PURE__ */ jsx("a", { href: "/#contact", className: "btn-primary mt-1 w-full", children: "Order Sekarang" })
            ] })
          }
        )
      ]
    }
  );
}
export {
  Footer as F,
  Navbar as N
};
