import { useTranslation } from "react-i18next";
import { ArrowRight, CheckCircle2 } from "lucide-react";
import { Layout } from "@/components/layout/Layout";
import { Section, SectionHeader } from "@/components/ui/Section";
import { SEO } from "@/components/SEO";
import { RelatedCases } from "@/components/RelatedCases";
import { useForceLanguage } from "@/hooks/useForceLanguage";
import {
  Table, TableBody, TableCell, TableHead, TableHeader, TableRow,
} from "@/components/ui/table";

import hologramPyramidHeroVideo from "@/assets/solutions/hologram-pyramid-hero.mp4";
import hologramPyramidAxeVideo from "@/assets/solutions/hologram-pyramid-axe.mp4";
import hologramPyramidCompactImg from "@/assets/solutions/hologram-pyramid-compact.png";
import hologramPyramidXlImg from "@/assets/solutions/hologram-pyramid-xl.png";
import hologramPyramidLindtVideo from "@/assets/solutions/hologram-pyramid-lindt.mp4";

interface SolutionHologramPyramidProps { forceLang?: "sv" | "en"; seoOverride?: React.ReactNode; }

export default function SolutionHologramPyramid({ forceLang, seoOverride }: SolutionHologramPyramidProps) {
  const { t } = useTranslation();
  useForceLanguage(forceLang);

  const compactSpecs = [
    t("hologramPyramid.models.compact.specs.size"),
    t("hologramPyramid.models.compact.specs.screen"),
    t("hologramPyramid.models.compact.specs.resolution"),
  ];
  const compactAudio = [
    t("hologramPyramid.models.compact.audio.speakers"),
    t("hologramPyramid.models.compact.audio.power"),
  ];
  const xlSpecs = [
    t("hologramPyramid.models.xl.specs.size"),
    t("hologramPyramid.models.xl.specs.screen"),
    t("hologramPyramid.models.xl.specs.resolution"),
  ];
  const xlBuild = [
    t("hologramPyramid.models.xl.build.housing"),
    t("hologramPyramid.models.xl.build.inputs"),
  ];
  const whyReasons = [
    t("hologramPyramid.why.attention"),
    t("hologramPyramid.why.noScreens"),
    t("hologramPyramid.why.noConstraints"),
  ];

  return (
    <Layout>
      {seoOverride || (
        <SEO
          title="3D Hologrampyramid – Produktpresentation i hologram | Suteki Studios"
          description="Hologrampyramiden visar produkter som svävande 3D-hologram från alla vinklar. Perfekt för mässor, showroom och butiksdisplayer."
          lang="sv"
          canonicalUrl="https://sutekistudios.com/3d-hologram"
          alternateSv="https://sutekistudios.com/3d-hologram"
          alternateEn="https://sutekistudios.com/en/3d-hologram"
        />
      )}

      {/* ═══ HERO ═══ */}
      <section className="min-h-[85vh] flex items-end relative overflow-hidden" data-hero="true">
        <div className="absolute inset-0">
          <video src={hologramPyramidHeroVideo} autoPlay loop muted playsInline className="absolute inset-0 w-full h-full object-cover" />
        </div>
        <div className="absolute inset-0" style={{ background: 'linear-gradient(to top, rgba(8,12,20,0.95) 0%, rgba(8,12,20,0.50) 40%, rgba(8,12,20,0.25) 100%)' }} />
        <div className="container mx-auto px-6 lg:px-8 relative z-10 pb-20 pt-40">
          <div className="max-w-3xl">
            <p className="hero-eyebrow mb-5 animate-fade-up">{t("hologramPyramid.eyebrow")}</p>
            <h1 className="display mb-6 animate-fade-up" style={{ color: '#FFFFFF' }}>{t("hologramPyramid.title")}</h1>
            <p className="text-lg md:text-xl mb-10 leading-relaxed animate-fade-up-delay-1" style={{ color: '#CBD5E1' }}>{t("hologramPyramid.intro")}</p>
            <a href="https://calendly.com/sutekistudios/strategic-project-discussion" target="_blank" rel="noopener noreferrer" className="btn-white inline-flex items-center gap-2 animate-fade-up-delay-2">
              {t("hologramPyramid.cta")} <ArrowRight className="h-4 w-4" style={{ color: '#0B1220' }} />
            </a>
          </div>
        </div>
      </section>

      {/* ═══ MODEL: COMPACT ═══ */}
      <Section className="section-white">
        <div className="grid lg:grid-cols-2 gap-14 items-center">
          <div className="aspect-video rounded-2xl overflow-hidden image-card">
            <video src={hologramPyramidAxeVideo} autoPlay loop muted playsInline className="w-full h-full object-cover" />
          </div>
          <div>
            <p className="eyebrow mb-3">{t("hologramPyramid.models.compact.eyebrow")}</p>
            <h2 className="mb-4 text-foreground">{t("hologramPyramid.models.compact.title")}</h2>
            <p className="text-muted-foreground leading-relaxed mb-6">{t("hologramPyramid.models.compact.description")}</p>
            <h3 className="font-semibold mb-3 text-foreground">{t("hologramPyramid.models.compact.dimensionsTitle")}</h3>
            <ul className="space-y-2 mb-6">
              {compactSpecs.map((s, i) => (
                <li key={i} className="flex items-start gap-3">
                  <CheckCircle2 className="h-4 w-4 flex-shrink-0 mt-0.5" style={{ color: '#2563EB' }} />
                  <span className="text-muted-foreground">{s}</span>
                </li>
              ))}
            </ul>
            <h3 className="font-semibold mb-3 text-foreground">{t("hologramPyramid.models.compact.audioTitle")}</h3>
            <ul className="space-y-2 mb-6">
              {compactAudio.map((s, i) => (
                <li key={i} className="flex items-start gap-3">
                  <CheckCircle2 className="h-4 w-4 flex-shrink-0 mt-0.5" style={{ color: '#2563EB' }} />
                  <span className="text-muted-foreground">{s}</span>
                </li>
              ))}
            </ul>
            <h3 className="font-semibold mb-2 text-foreground">{t("hologramPyramid.models.compact.suitedTitle")}</h3>
            <p className="text-muted-foreground">{t("hologramPyramid.models.compact.suitedFor")}</p>
          </div>
        </div>
      </Section>

      {/* ═══ MODEL: XL ═══ */}
      <Section className="section-beige">
        <div className="grid lg:grid-cols-2 gap-14 items-center">
          <div className="lg:order-2 aspect-video rounded-2xl overflow-hidden image-card">
            <video src={hologramPyramidLindtVideo} autoPlay loop muted playsInline className="w-full h-full object-cover" />
          </div>
          <div className="lg:order-1">
            <p className="eyebrow mb-3">{t("hologramPyramid.models.xl.eyebrow")}</p>
            <h2 className="mb-4 text-foreground">{t("hologramPyramid.models.xl.title")}</h2>
            <p className="text-muted-foreground leading-relaxed mb-6">{t("hologramPyramid.models.xl.description")}</p>
            <h3 className="font-semibold mb-3 text-foreground">{t("hologramPyramid.models.xl.dimensionsTitle")}</h3>
            <ul className="space-y-2 mb-6">
              {xlSpecs.map((s, i) => (
                <li key={i} className="flex items-start gap-3">
                  <CheckCircle2 className="h-4 w-4 flex-shrink-0 mt-0.5" style={{ color: '#2563EB' }} />
                  <span className="text-muted-foreground">{s}</span>
                </li>
              ))}
            </ul>
            <h3 className="font-semibold mb-3 text-foreground">{t("hologramPyramid.models.xl.buildTitle")}</h3>
            <ul className="space-y-2 mb-6">
              {xlBuild.map((s, i) => (
                <li key={i} className="flex items-start gap-3">
                  <CheckCircle2 className="h-4 w-4 flex-shrink-0 mt-0.5" style={{ color: '#2563EB' }} />
                  <span className="text-muted-foreground">{s}</span>
                </li>
              ))}
            </ul>
            <h3 className="font-semibold mb-2 text-foreground">{t("hologramPyramid.models.xl.suitedTitle")}</h3>
            <p className="text-muted-foreground">{t("hologramPyramid.models.xl.suitedFor")}</p>
          </div>
        </div>
      </Section>

      {/* ═══ VIDEOS ═══ */}
      <section className="relative overflow-hidden" data-theme="dark">
        <div className="absolute inset-0" style={{ background: 'hsl(222 57% 10%)' }} />
        <div className="container mx-auto px-6 lg:px-8 relative z-10 py-[var(--space-section)]">
          <SectionHeader title={t("hologramPyramid.videos.title")} subtitle={t("hologramPyramid.videos.description")} tone="dark" />
          <div className="grid md:grid-cols-3 gap-6">
            {[
              "https://player.vimeo.com/video/171711731?muted=1&loop=1&title=0&byline=0&portrait=0",
              "https://player.vimeo.com/video/184578568?muted=1&loop=1&title=0&byline=0&portrait=0",
              "https://www.youtube.com/embed/9Uv9ZvVHyGA?autoplay=0&loop=1&muted=1&rel=0&modestbranding=1&playsinline=1",
            ].map((src, i) => (
              <div key={i} className="aspect-video rounded-2xl overflow-hidden border border-white/10">
                <iframe src={src} className="w-full h-full" allow="autoplay; fullscreen; picture-in-picture; encrypted-media" allowFullScreen title={`3D Hologram Pyramid ${i + 1}`} />
              </div>
            ))}
          </div>
          <div className="grid md:grid-cols-3 gap-6 mt-6">
            {[
              "https://www.youtube.com/embed/ktFBgnBwz-c?autoplay=0&loop=1&muted=1&rel=0&modestbranding=1&playsinline=1",
              "https://www.youtube.com/embed/pDewxd0FVvo?autoplay=0&loop=1&muted=1&rel=0&modestbranding=1&playsinline=1",
              "https://www.youtube.com/embed/9nr2YAY-F-w?autoplay=0&loop=1&muted=1&rel=0&modestbranding=1&playsinline=1",
            ].map((src, i) => (
              <div key={i} className="aspect-video rounded-2xl overflow-hidden border border-white/10">
                <iframe src={src} className="w-full h-full" allow="autoplay; fullscreen; picture-in-picture; encrypted-media" allowFullScreen title={`3D Hologram Pyramid ${i + 4}`} />
              </div>
            ))}
          </div>
        </div>
      </section>

      {/* ═══ COMPARISON TABLE ═══ */}
      <Section className="section-white">
        <SectionHeader eyebrow="Jämförelse" title={t("hologramPyramid.comparison.title")} />
        <div className="enterprise-card overflow-hidden max-w-4xl">
          <Table>
            <TableHeader>
              <TableRow>
                <TableHead className="text-foreground font-semibold">{t("hologramPyramid.comparison.feature")}</TableHead>
                <TableHead className="text-foreground font-semibold">{t("hologramPyramid.comparison.compact")}</TableHead>
                <TableHead className="text-foreground font-semibold">{t("hologramPyramid.comparison.xl")}</TableHead>
              </TableRow>
            </TableHeader>
            <TableBody>
              <TableRow>
                <TableCell></TableCell>
                <TableCell className="py-4"><img src={hologramPyramidCompactImg} alt="Compact model" className="w-full max-w-[200px] h-auto object-contain" /></TableCell>
                <TableCell className="py-4"><img src={hologramPyramidXlImg} alt="XL model" className="w-full max-w-[200px] h-auto object-contain" /></TableCell>
              </TableRow>
              {[
                { label: "physicalSize", compact: "560 × 342 × 420 mm", xl: "1035 × 550 × 685 mm" },
                { label: "screenSize", compact: '23" (16:9)', xl: '43" (16:9)' },
                { label: "resolution", compact: "Full HD (1920 × 1080)", xl: "4K UHD (3840 × 2160)" },
                { label: "audio", compact: "2 × 10W speakers", xl: "2 × 10W speakers" },
                { label: "power", compact: "Max 50W", xl: "Typical 75W" },
              ].map((row) => (
                <TableRow key={row.label}>
                  <TableCell className="font-medium text-foreground">{t(`hologramPyramid.comparison.rows.${row.label}`)}</TableCell>
                  <TableCell className="text-muted-foreground">{row.compact}</TableCell>
                  <TableCell className="text-muted-foreground">{row.xl}</TableCell>
                </TableRow>
              ))}
              {["visualImpact", "typicalUse", "audienceDistance", "build", "bestSuited"].map((key) => (
                <TableRow key={key}>
                  <TableCell className="font-medium text-foreground">{t(`hologramPyramid.comparison.rows.${key}`)}</TableCell>
                  <TableCell className="text-muted-foreground">{t(`hologramPyramid.comparison.values.${key === "visualImpact" ? "closeRange" : key === "typicalUse" ? "counters" : key === "audienceDistance" ? "nearInteraction" : key === "build" ? "compactBuild" : "retailSmaller"}`)}</TableCell>
                  <TableCell className="text-muted-foreground">{t(`hologramPyramid.comparison.values.${key === "visualImpact" ? "longRange" : key === "typicalUse" ? "expos" : key === "audienceDistance" ? "visibleDistance" : key === "build" ? "robustBuild" : "highTraffic"}`)}</TableCell>
                </TableRow>
              ))}
            </TableBody>
          </Table>
        </div>
      </Section>
      <Section className="section-beige">
        <SectionHeader title={t("hologramPyramid.why.title")} />
        <ul className="space-y-4 max-w-3xl">
          {whyReasons.map((reason, i) => (
            <li key={i} className="flex items-start gap-3">
              <CheckCircle2 className="h-5 w-5 flex-shrink-0 mt-0.5" style={{ color: '#2563EB' }} />
              <span className="text-muted-foreground leading-relaxed">{reason}</span>
            </li>
          ))}
        </ul>
      </Section>

      <RelatedCases category="3D Hologram" maxCases={3} />

      {/* ═══ CTA ═══ */}
      <Section className="section-white">
        <div className="max-w-2xl mx-auto text-center">
          <h2 className="mb-4 text-foreground">{t("hologramPyramid.ctaSection.title")}</h2>
          <p className="text-muted-foreground mb-8 leading-relaxed">{t("hologramPyramid.ctaSection.description")}</p>
          <a href="https://calendly.com/sutekistudios/strategic-project-discussion" target="_blank" rel="noopener noreferrer" className="btn-primary inline-flex items-center gap-2">
            {t("hologramPyramid.ctaSection.button")}
          </a>
        </div>
      </Section>
    </Layout>
  );
}
