import { Link } from "react-router-dom";
import { useTranslation } from "react-i18next";
import { useForceLanguage } from "@/hooks/useForceLanguage";
import { ArrowRight, CheckCircle2 } from "lucide-react";
import { Layout } from "@/components/layout/Layout";
import { Section, SectionHeader } from "@/components/ui/Section";
import { SEOHead } from "@/components/SEOHead";

import heroImage from "@/assets/solutions/hologram-pyramid-retail.jpg";
import retailImage from "@/assets/solutions/invisible-screen-retail.webp";

const CALENDLY = "https://calendly.com/sutekistudios/strategic-project-discussion";

interface HologramRetailProps {
  /** Route language. Swedish route is /hologram-retail, English is /en/hologram-retail. */
  lang?: "sv" | "en";
}

export default function HologramRetail({ lang = "sv" }: HologramRetailProps) {
  const { t } = useTranslation();
  useForceLanguage(lang);
  const isSv = lang === "sv";
  const contactPath = isSv ? "/kontakt" : "/contact";
  const primaryCta = isSv ? "Få ett konkret förslag" : "Get a tailored proposal";
  const secondaryCta = isSv ? "Boka ett samtal" : "Book a call";

  return (
    <Layout>
      <SEOHead
        title={t("hologramRetail.metaTitle")}
        description={t("hologramRetail.metaDescription")}
        ogImage="/og/hologram.jpg"
        forceLang={lang}
        hreflangOverrides={{ sv: "/hologram-retail", en: "/en/hologram-retail", xDefault: "/hologram-retail" }}
      />

      <section className="min-h-[50vh] sm:min-h-[60vh] flex items-end relative overflow-hidden" data-hero="true">
        <div className="absolute inset-0 bg-cover bg-center bg-no-repeat" style={{ backgroundImage: `url(${heroImage})` }} />
        <div className="absolute inset-0" style={{ background: "linear-gradient(to top, rgba(8,12,20,0.92) 0%, rgba(8,12,20,0.40) 50%, rgba(8,12,20,0.15) 100%)" }} />
        <div className="container mx-auto px-5 sm:px-6 lg:px-8 relative z-10 pb-12 sm:pb-20 pt-28 sm:pt-40">
          <div className="max-w-3xl">
            <p className="hero-eyebrow mb-4 animate-fade-up text-xs sm:text-sm">RETAIL</p>
            <h1 className="display mb-4 sm:mb-6 hero-text-white animate-fade-up text-3xl sm:text-4xl md:text-5xl">
              {t("hologramRetail.hero.title")}
            </h1>
            <p className="text-sm sm:text-base lg:text-lg hero-text-body mb-6 sm:mb-8 max-w-xl animate-fade-up-delay-1 leading-relaxed">
              {t("hologramRetail.hero.description")}
            </p>
            <div className="flex flex-col sm:flex-row gap-3 sm:gap-4">
              <Link to={contactPath} className="btn-white inline-flex items-center justify-center gap-2 text-sm sm:text-base px-5 sm:px-6 py-3">
                {primaryCta} <ArrowRight className="h-4 w-4" />
              </Link>
              <a href={CALENDLY} target="_blank" rel="noopener noreferrer" className="btn-outline inline-flex items-center justify-center gap-2 text-sm sm:text-base px-5 sm:px-6 py-3" style={{ color: "#fff", borderColor: "rgba(255,255,255,0.25)" }}>
                {secondaryCta}
              </a>
            </div>
          </div>
        </div>
      </section>

      <Section className="section-white">
        <div className="grid lg:grid-cols-2 gap-6 sm:gap-12 items-center">
          <div>
            <h2 className="text-xl sm:text-2xl md:text-3xl font-semibold mb-4 text-foreground">{t("hologramRetail.intro.title")}</h2>
            <p className="text-muted-foreground text-sm sm:text-base leading-relaxed mb-6">{t("hologramRetail.intro.text")}</p>
            <ul className="space-y-2 text-muted-foreground text-sm mb-8">
              {["windowDisplays", "flagshipStores", "productPresentations", "popupRetail"].map((key) => (
                <li key={key} className="flex items-center gap-2">
                  <CheckCircle2 className="h-4 w-4 text-accent flex-shrink-0" />
                  {t(`hologramRetail.useCases.${key}`)}
                </li>
              ))}
            </ul>
            <Link to={contactPath} className="btn-primary inline-flex items-center gap-2 text-sm px-5 py-2.5">
              {primaryCta} <ArrowRight className="h-4 w-4" />
            </Link>
          </div>
          <div className="aspect-video rounded-xl overflow-hidden enterprise-card">
            <img src={retailImage} alt={isSv ? "Hologramdisplay i butiksmiljö" : "Hologram display in a retail store"} loading="lazy" decoding="async" className="w-full h-full object-cover" />
          </div>
        </div>
      </Section>

      <section className="section-dark py-[var(--space-section)]" data-theme="dark">
        <div className="container mx-auto px-5 sm:px-6 lg:px-8 text-center">
          <h2 className="mb-4 text-xl sm:text-2xl md:text-3xl">{t("hologramRetail.finalCta.title")}</h2>
          <p className="text-sm sm:text-base mb-8" style={{ color: "rgba(226,232,240,0.7)" }}>{t("hologramRetail.finalCta.description")}</p>
          <div className="flex flex-col sm:flex-row gap-3 sm:gap-4 justify-center">
            <Link to={contactPath} className="btn-white inline-flex items-center justify-center gap-2 text-sm sm:text-base px-5 sm:px-6 py-3">
              {primaryCta} <ArrowRight className="h-4 w-4 text-foreground" />
            </Link>
            <a href={CALENDLY} target="_blank" rel="noopener noreferrer" className="btn-outline inline-flex items-center justify-center gap-2 text-sm sm:text-base px-5 sm:px-6 py-3" style={{ color: "#fff", borderColor: "rgba(255,255,255,0.25)" }}>
              {t("hologramRetail.cta")}
            </a>
          </div>
          <p className="mt-3 text-xs sm:text-sm" style={{ color: "rgba(226,232,240,0.5)" }}>
            {isSv ? "Svar inom 24 timmar." : "We reply within 24 hours."}
          </p>
        </div>
      </section>
    </Layout>
  );
}
