"use client";

import React, { useState } from "react";
import Image from "next/image";
import Link from "next/link";
import { FaDownload, FaEnvelope, FaChevronRight } from "react-icons/fa6";
import {
  LuLayers,
  LuShieldCheck,
  LuZap,
  LuFlame,
  LuCpu,
  LuActivity,
  LuFileSpreadsheet,
  LuGauge
} from "react-icons/lu";
import Breadcrumb from "@/components/Common/Breadcrumb";
interface CableLayer {
  layerNumber: string;
  title: string;
  description: string;
  highlight?: string;
}

export default function PolycabMvHtCableAlternativeDetail() {
  const [activeLayer, setActiveLayer] = useState<number>(0);

  const keySpecifications = [
    { label: "Standard Compliance", val: "IS 7098-P2 Certified", detail: "Bureau of Indian Standards validated" },
    { label: "Voltage Spectrum", val: "1.9/3.3kV to 19/33kV", detail: "Medium voltage power grid networks" },
    { label: "Core Layouts", val: "Single & 3-Core Systems", detail: "Compact sector/round configurations" },
    { label: "Thermal Maximum", val: "90°C Continuous Load", detail: "Short circuit ceiling threshold 250°C" }
  ];

  const structuralLayers: CableLayer[] = [
    {
      layerNumber: "01",
      title: "Conductor Core",
      description: "High conductivity, annealed plain stranded compacted aluminum or copper conductor produced in-house using state-of-the-art wire-drawing machinery.",
      highlight: "High Conductivity Metal"
    },
    {
      layerNumber: "02",
      title: "Conductor Screen",
      description: "An extruded layer of cross-linkable semi-conducting compound applied to eliminate sharp points on the conductor surface, completely nullifying the risk of electrical discharge at the conductor/insulation interface.",
      highlight: "Discharge Prevention"
    },
    {
      layerNumber: "03",
      title: "Thermoset Insulation",
      description: "In-house developed, high insulation resistance cross-linked polyethylene (XLPE) thermoset insulation compound designed for extreme electrical stress.",
      highlight: "Premium Grade XLPE"
    },
    {
      layerNumber: "04",
      title: "Non-Metallic Insulation Screen",
      description: "An extruded layer of cross-linkable semi-conducting compound, applied in an advanced simultaneous triple-extrusion process alongside the conductor screen and insulation. This entirely eliminates micro-voids during curing, vastly extending cable operational life.",
      highlight: "Triple Extrusion Process"
    },
    {
      layerNumber: "05",
      title: "Metallic Screen Matrix",
      description: "A helically applied pure copper tape screen engineered specifically to safely ground and carry high system fault currents during unexpected grid surges.",
      highlight: "Fault Current Protection"
    },
    {
      layerNumber: "06",
      title: "Laying Up & Fillers",
      description: "Insulated cores are precisely laid up together alongside custom, in-house developed fillers to structuralize and maintain the perfect circular profile of the multi-core bundle.",
      highlight: "Profile Uniformity"
    },
    {
      layerNumber: "07",
      title: "Inner Protective Sheath",
      description: "In-house formulated thermoplastic PVC or low-smoke halogen-free (LSZH) compound. Acts as a protective bedding layer that yields ultra-low emission of smoke and corrosive gasses under thermal duress.",
      highlight: "LSZH/PVC Shielding"
    },
    {
      layerNumber: "08",
      title: "Mechanical Wire Armor",
      description: "Robust Aluminum or Galvanized Steel Round Wire structural layer provides severe mechanical armor defense against external puncture shocks while doubling as a low-resistance return path for earth fault currents.",
      highlight: "Physical & Earth Fault Path"
    },
    {
      layerNumber: "09",
      title: "Outer Jacket Sheath",
      description: "Final barrier engineered with in-house developed thermoplastic PVC or advanced halogen-free compounds. Guarantees extreme resistance against mechanical abrasion, acid-alkali soils, moisture, and fire-induced toxic outgassing.",
      highlight: "Extreme Environmental Defense"
    }
  ];

  return (
    <>
      <Breadcrumb pageName="Polycab MV HT Power Cable" />
      <div className="min-h-screen bg-white text-slate-800 antialiased selection:bg-cyan-500/10 selection:text-cyan-800">


        <main className="container mx-auto px-6 py-12 lg:py-20 max-w-7xl xl:max-w-screen-xl 2xl:max-w-screen-2xl">

          {/* ─── DASHBOARD WORKSPACE GRIDLAYOUT ───────────────────── */}
          <div className="grid grid-cols-1 lg:grid-cols-12 gap-10 xl:gap-16 items-start">

            {/* LEFT AREA: PERSISTENT PROFILE & TECHNICAL QUICK-SPECS (STICKY) */}
            <div className="lg:col-span-4 lg:sticky lg:top-8 space-y-8">
              <div className="bg-slate-50 border border-slate-200 p-6 xl:p-8 rounded-3xl shadow-sm">
                <span className="inline-block rounded-lg bg-cyan-100 border border-cyan-200 px-3 py-1 text-[11px] font-bold uppercase tracking-wider text-cyan-800 mb-4">
                  IS 7098 Part II Compliant
                </span>

                <h1 className="text-2xl xl:text-3xl font-black text-slate-900 tracking-tight leading-tight">
                  Polycab MV HT Power Series
                </h1>
                <p className="text-sm text-slate-500 font-normal mt-2 leading-relaxed">
                  High-tension underground and outdoor layout assets engineered for grid distribution networks.
                </p>

                <div className="relative aspect-square bg-white border border-slate-200/80 rounded-2xl p-6 my-6 shadow-xs flex items-center justify-center overflow-hidden group">
                  <div className="absolute inset-0 bg-gradient-to-tr from-slate-50 to-transparent pointer-events-none" />
                  <Image
                    src="/images/polycab/LV-Power-Cable.png"
                    alt="Polycab IS 7098-P2 structural cross section view"
                    fill
                    priority
                    className="object-contain p-4 group-hover:scale-105 transition-transform duration-500"
                    sizes="(max-width: 1024px) 100vw, 400px"
                  />
                </div>

                <div className="space-y-3">
                  <Link
                    href="/contact"
                    className="flex items-center justify-center gap-2 bg-cyan-600 hover:bg-cyan-500 text-white font-bold text-xs uppercase tracking-wider p-4 rounded-xl w-full transition-all shadow-md shadow-cyan-600/10 active:scale-98"
                  >
                    <FaEnvelope className="w-3.5 h-3.5" /> Direct RFQ Tender Enquiry
                  </Link>
                  <Link
                    href="https://realswitchgears.com/assets/images/products/polycab-cable/mv-power-cable/pdf/MV-Power-Cable-IS.pdf"
                    target="_blank"
                    className="flex items-center justify-center gap-2 bg-white hover:bg-slate-50 text-slate-700 font-bold text-xs uppercase tracking-wider p-4 rounded-xl w-full border border-slate-200 transition-all shadow-xs"
                  >
                    <FaDownload className="w-3.5 h-3.5 text-cyan-600" /> Technical Data Sheet
                  </Link>
                </div>
              </div>

              {/* QUICK SPECS INLINE PILLS */}
              <div className="space-y-4">
                <h3 className="text-xs font-bold text-slate-400 uppercase tracking-widest flex items-center gap-2">
                  <LuGauge className="w-4 h-4 text-cyan-600" /> Operational Thresholds
                </h3>
                <div className="grid grid-cols-1 gap-3">
                  {keySpecifications.map((spec, index) => (
                    <div key={index} className="bg-white border border-slate-100 p-4 rounded-xl shadow-xs flex items-center justify-between gap-4 hover:border-slate-200 transition-all">
                      <div>
                        <span className="text-[10px] uppercase font-bold text-slate-400 block tracking-wider">{spec.label}</span>
                        <span className="text-xs font-normal text-slate-500 mt-0.5 block">{spec.detail}</span>
                      </div>
                      <span className="text-xs font-extrabold text-cyan-700 bg-slate-50 border border-slate-100 px-3 py-1.5 rounded-lg whitespace-nowrap">
                        {spec.val}
                      </span>
                    </div>
                  ))}
                </div>
              </div>
            </div>

            {/* RIGHT AREA: STRUCTURAL EXTRUSION EXPLORER PANEL */}
            <div className="lg:col-span-8 space-y-12">

              {/* INTRODUCTORY CONTEXT BAR */}
              <div className="bg-slate-50 border-l-4 border-cyan-500 p-6 rounded-r-2xl">
                <p className="text-slate-600 font-normal text-sm md:text-base leading-relaxed">
                  Polycab single-core and three-core medium voltage high tension power cables support transmission capabilities extending from <strong className="text-slate-900 font-semibold">1.9/3.3kV to 19/33kV</strong>. Engineered utilizing simultaneous triple-extrusion technology to neutralize curing faults and ensure permanent phase reliability.
                </p>
              </div>

              {/* HORIZONTAL INTERACTIVE LAYER MATRIX GRID */}
              <div className="space-y-6">
                <div className="flex flex-wrap items-end justify-between gap-4 border-b border-slate-200 pb-4">
                  <div className="flex items-center gap-3">
                    <div className="p-2 bg-slate-100 border border-slate-200 rounded-lg text-cyan-600">
                      <LuLayers className="w-5 h-5" />
                    </div>
                    <div>
                      <h2 className="text-lg font-bold text-slate-900 tracking-tight">Cable Architecture Matrix</h2>
                      <p className="text-xs text-slate-500">Select structural indexing node to inspect technical composition properties.</p>
                    </div>
                  </div>
                  <span className="text-xs font-bold text-slate-400 bg-slate-50 border border-slate-100 px-3 py-1 rounded-md">
                    9 Core Formulations
                  </span>
                </div>

                {/* NODE GRID BUTTONS */}
                <div className="grid grid-cols-3 sm:grid-cols-9 gap-2">
                  {structuralLayers.map((layer, idx) => (
                    <button
                      key={idx}
                      onClick={() => setActiveLayer(idx)}
                      className={`p-3 rounded-xl border text-center transition-all flex flex-col items-center justify-center relative ${activeLayer === idx
                        ? "bg-cyan-600 border-cyan-600 text-white shadow-md font-bold scale-[1.02]"
                        : "bg-white border-slate-200 text-slate-700 hover:bg-slate-50 hover:border-slate-300"
                        }`}
                    >
                      <span className={`text-[10px] block font-mono font-bold uppercase ${activeLayer === idx ? "text-cyan-200" : "text-slate-400"}`}>
                        LYR
                      </span>
                      <span className="text-sm font-black tracking-tight mt-0.5">
                        {layer.layerNumber}
                      </span>
                      {activeLayer === idx && (
                        <span className="absolute -bottom-1 left-1/2 -translate-x-1/2 w-2 h-2 bg-cyan-600 rotate-45 rounded-xs" />
                      )}
                    </button>
                  ))}
                </div>

                {/* DYNAMIC FOCUS HOVERBOARD */}
                <div className="bg-slate-50 border border-slate-200/80 rounded-2xl p-6 md:p-8 transition-all relative overflow-hidden">
                  <div className="absolute top-0 right-0 w-32 h-32 bg-cyan-600/[0.02] rounded-full blur-2xl pointer-events-none" />

                  <div className="flex flex-wrap items-start justify-between gap-4 border-b border-slate-200/60 pb-4 mb-4">
                    <div>
                      <span className="text-[10px] font-bold text-cyan-600 uppercase tracking-widest block mb-0.5">Selected Layer Specification</span>
                      <h4 className="text-base md:text-lg font-bold text-slate-900 tracking-tight">
                        {structuralLayers[activeLayer].title}
                      </h4>
                    </div>
                    <span className="bg-white border border-slate-200 rounded-lg px-3 py-1 text-xs font-mono font-bold text-slate-400 shadow-xs">
                      Index ref: 7098-0{activeLayer + 1}
                    </span>
                  </div>

                  <p className="text-xs md:text-sm text-slate-600 font-normal leading-relaxed min-h-[72px]">
                    {structuralLayers[activeLayer].description}
                  </p>

                  <div className="mt-6 pt-4 border-t border-slate-200/60 flex flex-wrap items-center justify-between gap-4 text-xs font-medium">
                    <div className="inline-flex items-center gap-2 text-slate-500">
                      <LuShieldCheck className="w-4 h-4 text-cyan-600" />
                      <span>Technical Attribute:</span>
                      <span className="text-cyan-700 font-bold bg-cyan-50 px-2.5 py-1 rounded-md border border-cyan-100">
                        {structuralLayers[activeLayer].highlight}
                      </span>
                    </div>
                    <span className="text-[11px] font-bold text-slate-400 uppercase tracking-wider">
                      In-House Certified Process
                    </span>
                  </div>
                </div>
              </div>

              {/* ─── DATA GRID COMPLIANCE REASSURANCES ───────────────── */}
              <div className="space-y-6">
                <h3 className="text-xs font-bold text-slate-400 uppercase tracking-widest flex items-center gap-2 border-b border-slate-100 pb-3">
                  <LuFileSpreadsheet className="w-4 h-4 text-cyan-600" /> Core Engineering Parameters
                </h3>

                <div className="grid grid-cols-1 md:grid-cols-3 gap-6">

                  <div className="bg-white border border-slate-200/80 rounded-2xl p-6 shadow-xs group hover:border-cyan-500/30 transition-colors">
                    <div className="p-2.5 bg-slate-50 border border-slate-100 text-cyan-600 rounded-xl w-fit mb-4 group-hover:bg-cyan-500 group-hover:text-white transition-all duration-300">
                      <LuFlame className="w-5 h-5" />
                    </div>
                    <h4 className="text-sm font-bold text-slate-900 tracking-tight mb-1">Halogen-Free Safety Options</h4>
                    <p className="text-xs text-slate-500 leading-relaxed font-normal">
                      Available with HFFR formulations ensuring non-corrosive outgassing metrics and limited smoke opacity parameters during sudden thermal spikes.
                    </p>
                  </div>

                  <div className="bg-white border border-slate-200/80 rounded-2xl p-6 shadow-xs group hover:border-cyan-500/30 transition-colors">
                    <div className="p-2.5 bg-slate-50 border border-slate-100 text-cyan-600 rounded-xl w-fit mb-4 group-hover:bg-cyan-500 group-hover:text-white transition-all duration-300">
                      <LuZap className="w-5 h-5" />
                    </div>
                    <h4 className="text-sm font-bold text-slate-900 tracking-tight mb-1">Triple-Extrusion Curing</h4>
                    <p className="text-xs text-slate-500 leading-relaxed font-normal">
                      Conductor shield, cross-linked core insulation, and non-metallic protective screens applied concurrently to prevent dangerous micro-void voids.
                    </p>
                  </div>

                  <div className="bg-white border border-slate-200/80 rounded-2xl p-6 shadow-xs group hover:border-cyan-500/30 transition-colors">
                    <div className="p-2.5 bg-slate-50 border border-slate-100 text-cyan-600 rounded-xl w-fit mb-4 group-hover:bg-cyan-500 group-hover:text-white transition-all duration-300">
                      <LuActivity className="w-5 h-5" />
                    </div>
                    <h4 className="text-sm font-bold text-slate-900 tracking-tight mb-1">Fault Path Grounding</h4>
                    <p className="text-xs text-slate-500 leading-relaxed font-normal">
                      Engineered copper shielding matrices combined with heavy physical wire armor configurations provide clear zero-hazard grounding loops.
                    </p>
                  </div>

                </div>
              </div>

              {/* BOTTOM TENDER / ARCHITECTURE CTA BLOCK */}
              <div className="bg-slate-50 border border-slate-200 rounded-2xl p-6 md:p-8 flex flex-wrap items-center justify-between gap-6">
                <div className="space-y-1 max-w-md">
                  <h4 className="text-sm font-bold text-slate-900 tracking-tight flex items-center gap-2">
                    <LuCpu className="w-4 h-4 text-cyan-600" /> Need Project Custom Specifications?
                  </h4>
                  <p className="text-xs text-slate-500 leading-relaxed">
                    Request specialized armor layers, mechanical cores, or customized bulk rate estimates from our local engineering advisory help desks.
                  </p>
                </div>
                <div className="flex items-center gap-3">
                  <Link
                    href="/contact"
                    className="bg-slate-900 hover:bg-slate-800 text-white font-bold text-xs uppercase tracking-wider px-5 py-3 rounded-lg shadow-xs transition-colors flex items-center gap-1.5"
                  >
                    Request Quote <FaChevronRight className="w-2.5 h-2.5" />
                  </Link>
                </div>
              </div>

            </div>

          </div>

        </main>
      </div>
    </>
  );
}