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";

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

import heroImage from "@/assets/solutions/hologram-dell-event.jpg";
import eventImage from "@/assets/cases/easyfairs-hewo.jpg";

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

export default function HologramEvents({ lang = "sv" }: HologramEventsProps) {
  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("hologramEvents.metaTitle")}
        description={t("hologramEvents.metaDescription")}
        ogImage="/og/hologram.jpg"
        forceLang={lang}
        hreflangOverrides={{ sv: "/hologram-events", en: "/en/hologram-events", xDefault: "/hologram-events" }}
      />

      {/* Hero */}
      <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">
              {isSv ? "EVENTS & MÄSSOR" : "EVENTS & TRADE SHOWS"}
            </p>
            <h1 className="display mb-4 sm:mb-6 hero-text-white animate-fade-up text-3xl sm:text-4xl md:text-5xl">
              {t("hologramEvents.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("hologramEvents.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>

      {/* Intro + Use Cases */}
      <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("hologramEvents.intro.title")}
            </h2>
            <p className="text-muted-foreground text-sm sm:text-base leading-relaxed mb-6">
              {t("hologramEvents.intro.text")}
            </p>
            <ul className="space-y-2 text-muted-foreground text-sm mb-8">
              {["tradeShows", "conferences", "festivals", "brandActivations"].map((key) => (
                <li key={key} className="flex items-center gap-2">
                  <CheckCircle2 className="h-4 w-4 text-accent flex-shrink-0" />
                  {t(`hologramEvents.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={eventImage}
              alt={isSv ? "Hologramdisplay på mässa" : "Hologram display at a trade show"}
              loading="lazy"
              decoding="async"
              className="w-full h-full object-cover"
            />
          </div>
        </div>
      </Section>

      {/* CTA */}
      <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("hologramEvents.finalCta.title")}</h2>
          <p className="text-sm sm:text-base mb-8" style={{ color: "rgba(226,232,240,0.7)" }}>
            {t("hologramEvents.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("hologramEvents.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>
  );
}
