"use client";

import React, { useState } from "react";
import Image from "next/image";
import Link from "next/link";
import { FaDownload, FaEnvelope, FaChevronRight, FaArrowRight } from "react-icons/fa6";
import {
  LuShieldCheck,
  LuFlameKindling,
  LuLayers,
  LuSparkles,
  LuActivity,
  LuGauge
} from "react-icons/lu";
import Breadcrumb from "@/components/Common/Breadcrumb";
// Next.js SEO Metadata Configuration
// export const metadata = {
//   title: "Polycab BS 7835 Armored LSZH MV Cables | XLPE Power Cable",
//   description: "Explore Polycab XLPE insulated round wire armored LSZH medium voltage power cables conforming to BS 7835. Available from 6.6kV up to 33kV configurations.",
//   keywords: ["Polycab BS 7835", "LSZH Armored Cable", "Medium Voltage Cable", "Low Smoke Zero Halogen", "SWA Cable", "Tri-Rated MV Power"],
// };

interface CableLayer {
  id: string;
  layerName: string;
  materialSpec: string;
  technicalAdvantage: string;
}

export default function PolycabBs7835CableDetail() {
  const [activeLayerId, setActiveLayerId] = useState<string>("layer-1");

  const quickSpecGrid = [
    { label: "Standard Metric", val: "BS 7835 Standard" },
    { label: "Voltage Range", val: "6.6kV up to 33kV" },
    { label: "Core Layouts", val: "Single & Three Core" },
    { label: "Thermal Rating", val: "90°C Continuous / 250°C Max" }
  ];

  const structuralBlueprint: CableLayer[] = [
    {
      id: "layer-1",
      layerName: "1. Core Conductor",
      materialSpec: "High Conductivity Stranded Compacted Copper or Aluminium",
      technicalAdvantage: "Manufactured in-house using state-of-the-art drawing machinery to guarantee excellent electrical conductance and minimal geometric tolerance variances."
    },
    {
      id: "layer-2",
      layerName: "2. Conductor Screen",
      materialSpec: "Extruded Semi-Conducting Compound",
      technicalAdvantage: "Provides a smooth, continuous interface grid to eliminate localized electrostatic field concentrations between the conductor boundary and insulation."
    },
    {
      id: "layer-3",
      layerName: "3. High-Grade Insulation",
      materialSpec: "High Insulation Resistance XLPE or EPR Compound",
      technicalAdvantage: "Cross-linked Polyethylene (XLPE) or Ethylene Propylene Rubber (EPR) insulation engineered to deliver high dielectric parameters and sustained thermal resilience."
    },
    {
      id: "layer-4",
      layerName: "4. Insulation Screen Matrix",
      materialSpec: "Semi-Conducting Layer wrapped with Copper Tape Screen",
      technicalAdvantage: "Combines an extruded semi-conducting bed followed by a premium metallic copper tape wrap to safely transition ground fault circuits."
    },
    {
      id: "layer-5",
      layerName: "5. Protective Inner Covering",
      materialSpec: "Extruded Low Smoke Zero Halogen (LSZH) Compound",
      technicalAdvantage: "Applied precisely between the insulation screen and armoring matrix to serve as an internal fire barrier layer that eliminates acid gas emission hazards."
    },
    {
      id: "layer-6",
      layerName: "6. Tensile Mechanical Armor",
      materialSpec: "Galvanized Round Steel Wire or Aluminum Wire",
      technicalAdvantage: "Defends the absolute core structure against rigorous multi-directional pulling stresses and high crushing impacts encountered in deep excavations."
    },
    {
      id: "layer-7",
      layerName: "7. Toughened External Sheath",
      materialSpec: "In-House Formulated LSZH Compound Jacket",
      technicalAdvantage: "Engineered in-house to protect structural runs from severe climate fluctuations, chemical abrasions, and mechanical wear."
    }
  ];

  return (
    <>
      <Breadcrumb pageName="Polycab MV HT Power Cable" />
      <div className="min-h-screen bg-white text-slate-800 py-16 lg:py-24 xl:py-32 selection:bg-cyan-100 selection:text-cyan-950">
        {/* Max width restricted at 2xl for pristine ultra-wide presentation */}
        <div className="container mx-auto px-4 max-w-7xl xl:max-w-[1440px] 2xl:max-w-[1600px]">

          {/* ─── HERO PRESENTATION HEADER SECTION ──────────────── */}
          <div className="grid grid-cols-1 lg:grid-cols-12 xl:gap-16 2xl:gap-24 items-center mb-24 xl:mb-32">

            {/* Left Column: Interactive Asset Showcase */}
            <div className="lg:col-span-5 flex justify-center order-2 lg:order-1">
              <div className="relative w-full max-w-[420px] xl:max-w-[520px] 2xl:max-w-[600px] aspect-square rounded-3xl overflow-hidden bg-slate-50 border border-slate-100 p-8 shadow-md group">
                <div className="relative w-full h-full">
                  <Image
                    src="/images/polycab/MV-Power-Cable-BS_7835.png"
                    alt="Polycab BS 7835 XLPE insulated round wire armored LSZH medium voltage power cable"
                    fill
                    priority
                    className="object-contain group-hover:scale-105 transition-transform duration-500"
                    sizes="(max-width: 768px) 100vw, (max-width: 1280px) 420px, 600px"
                  />
                </div>
              </div>
            </div>

            {/* Right Column: Core Technical Narrative */}
            <div className="lg:col-span-7 space-y-6 xl:space-y-8 order-1 lg:order-2">
              <span className="inline-flex items-center gap-1.5 rounded-full bg-cyan-50 px-4 py-1.5 text-xs font-bold tracking-wider text-cyan-700 uppercase border border-cyan-200">
                Low Smoke Zero Halogen Range
              </span>

              <h1 className="text-3xl md:text-4xl xl:text-5xl 2xl:text-6xl font-black tracking-tight text-slate-900 leading-tight">
                Polycab BS 7835 Armored Cables <br />
                <span className="text-cyan-500 font-extrabold text-xl md:text-2xl xl:text-3xl block mt-2 xl:mt-4">
                  XLPE Insulated LSZH Medium Voltage Series
                </span>
              </h1>

              <div className="space-y-4 xl:space-y-6 text-slate-600 text-sm md:text-base xl:text-lg leading-relaxed font-medium">
                <p>
                  Polycab’s medium voltage armored power cables strictly follow the structural and safety requirements outlined by the <strong className="text-slate-900">BS 7835 standard</strong>. They are engineered to provide stable grid performance across major industrial voltage grades:
                  <strong className="text-slate-900"> 3.8/6.6 (7.2) kV, 6.35/11 (12) kV, 8.7/15 (17.5) kV, 12.7/22 (24) kV, and 19/33 (36) kV</strong>.
                </p>
                <p>
                  These high-tension distributions are designed specifically to secure high-density operations, where <strong className="text-slate-900">low smoke production and low halogen evolution</strong> are mission-critical during fire events. They are ideal for placement across municipal power networks, direct underground installations, or enclosed structural cable ducts.
                </p>
                <p>
                  Available in <strong className="text-slate-900">single and three-core formations</strong>, they deliver a baseline continuous operating threshold of <strong className="text-slate-900">90°C</strong> and are certified to handle peak internal short-circuit spikes up to <strong className="text-slate-900">250°C</strong>.
                </p>
              </div>

              {/* Parameter Cards Summary Layout */}
              <div className="grid grid-cols-2 sm:grid-cols-4 gap-4 bg-slate-50 border border-slate-100 p-5 rounded-2xl shadow-xs">
                {quickSpecGrid.map((spec, index) => (
                  <div key={index} className="bg-white border border-slate-200/60 p-4 rounded-xl text-center flex flex-col justify-center shadow-xs">
                    <span className="text-[10px] xl:text-xs text-slate-400 font-bold uppercase tracking-wider block mb-1">
                      {spec.label}
                    </span>
                    <span className="text-xs xl:text-sm font-black text-slate-900 leading-snug">
                      {spec.val}
                    </span>
                  </div>
                ))}
              </div>

              {/* Direct Document CTA Anchors */}
              <div className="flex flex-wrap gap-4 pt-2">
                <Link
                  href="https://realswitchgears.com/assets/images/products/polycab-cable/mv-power-cable/pdf/MV-Power-Cable-BS_7870-4_10-20.pdf"
                  target="_blank"
                  className="inline-flex items-center gap-2 bg-slate-900 hover:bg-slate-800 text-white text-xs xl:text-sm font-bold px-6 py-4 rounded-xl transition-all group"
                >
                  <FaDownload className="w-3.5 h-3.5 group-hover:translate-y-0.5 transition-transform" />
                  Download BS 7835 PDF
                </Link>
                <Link
                  href="/contact"
                  className="inline-flex items-center gap-2 bg-cyan-500 hover:bg-cyan-600 text-white text-xs xl:text-sm font-bold px-6 py-4 rounded-xl transition-all shadow-sm"
                >
                  Send Enquiry <FaEnvelope className="w-3.5 h-3.5" />
                </Link>
              </div>
            </div>

          </div>

          {/* ─── INTERACTIVE LAYER SPECS COMPONENT GRID ─────────── */}
          <div className="mb-24 xl:mb-32">
            <div className="flex items-center gap-4 mb-10 border-b border-slate-100 pb-6">
              <div className="p-3 bg-cyan-50 border border-cyan-100 text-cyan-600 rounded-xl">
                <LuLayers className="w-6 h-6" />
              </div>
              <div>
                <h2 className="text-xl xl:text-2xl font-black text-slate-900">Internal Structural Profile Blueprint</h2>
                <p className="text-xs xl:text-sm text-slate-500 font-medium mt-1">
                  Select a cross-sectional material zone below to audit its specific engineering values and environmental shield ratings.
                </p>
              </div>
            </div>

            <div className="grid grid-cols-1 lg:grid-cols-12 gap-8 xl:gap-12 items-start">

              {/* Left Controller Panel Stack */}
              <div className="lg:col-span-5 space-y-2.5">
                {structuralBlueprint.map((layer) => (
                  <button
                    key={layer.id}
                    onClick={() => setActiveLayerId(layer.id)}
                    className={`w-full text-left p-4 rounded-xl border text-xs xl:text-sm font-bold transition-all flex items-center justify-between group ${activeLayerId === layer.id
                      ? "bg-cyan-500 text-white border-cyan-600 shadow-md shadow-cyan-500/10"
                      : "bg-slate-50 text-slate-700 border-slate-200/60 hover:bg-slate-100"
                      }`}
                  >
                    <span className="truncate">{layer.layerName}</span>
                    <FaChevronRight className={`w-2.5 h-2.5 opacity-70 group-hover:translate-x-0.5 transition-transform ${activeLayerId === layer.id ? "text-white" : "text-slate-400"
                      }`} />
                  </button>
                ))}
              </div>

              {/* Right Display Information Console */}
              <div className="lg:col-span-7 bg-slate-50 border border-slate-200/60 rounded-2xl p-6 md:p-8 xl:p-10 min-h-[320px] flex flex-col justify-between shadow-xs">
                {(() => {
                  const target = structuralBlueprint.find((l) => l.id === activeLayerId)!;
                  return (
                    <>
                      <div className="space-y-4 xl:space-y-6">
                        <div>
                          <span className="text-[10px] xl:text-xs font-black tracking-widest text-cyan-600 uppercase block mb-1">
                            Material Engineering Specifications
                          </span>
                          <h3 className="text-lg xl:text-xl font-black text-slate-900">
                            {target.layerName.substring(3)}
                          </h3>
                        </div>
                        <div className="inline-block bg-white text-cyan-700 text-[11px] xl:text-xs font-extrabold px-3 py-1.5 rounded-md border border-cyan-100 shadow-2xs">
                          {target.materialSpec}
                        </div>
                        <p className="text-xs md:text-sm xl:text-base text-slate-600 font-medium leading-relaxed pt-2">
                          {target.technicalAdvantage}
                        </p>
                      </div>

                      <div className="mt-8 pt-4 border-t border-slate-200/60 flex items-center justify-between text-[11px] xl:text-xs text-slate-400 font-bold">
                        <span className="flex items-center gap-1 text-cyan-600">
                          <LuSparkles className="w-3.5 h-3.5" /> High-Purity Compounding
                        </span>
                        <span>BS 7835 Compliance Confirmed</span>
                      </div>
                    </>
                  );
                })()}
              </div>

            </div>
          </div>

          {/* ─── REASSURANCE & ENVIRONMENTAL VALUE METRICS ───────── */}
          <div className="grid grid-cols-1 md:grid-cols-3 gap-6 xl:gap-8 mb-24 xl:mb-32">
            <div className="bg-slate-50 border border-slate-100 rounded-2xl p-6 xl:p-8 shadow-xs flex items-start gap-4">
              <div className="p-3 bg-white border border-slate-200/60 rounded-xl text-cyan-500 shrink-0 shadow-2xs">
                <LuActivity className="w-5 h-5 xl:w-6 xl:h-6" />
              </div>
              <div className="space-y-1">
                <h4 className="text-xs xl:text-sm font-black text-slate-900">High Mechanical Resistance</h4>
                <p className="text-[11px] xl:text-xs text-slate-500 font-medium leading-relaxed">
                  Heavy steel/aluminum wire matrices protect inner dielectric materials from mechanical impacts during pull-in routing.
                </p>
              </div>
            </div>
            <div className="bg-slate-50 border border-slate-100 rounded-2xl p-6 xl:p-8 shadow-xs flex items-start gap-4">
              <div className="p-3 bg-white border border-slate-200/60 rounded-xl text-cyan-500 shrink-0 shadow-2xs">
                <LuFlameKindling className="w-5 h-5 xl:w-6 xl:h-6" />
              </div>
              <div className="space-y-1">
                <h4 className="text-xs xl:text-sm font-black text-slate-900">Low Toxicity Smoke Metrics</h4>
                <p className="text-[11px] xl:text-xs text-slate-500 font-medium leading-relaxed">
                  Dual internal and external LSZH barriers minimize smoke density, securing crowded indoor utility passages.
                </p>
              </div>
            </div>
            <div className="bg-slate-50 border border-slate-100 rounded-2xl p-6 xl:p-8 shadow-xs flex items-start gap-4">
              <div className="p-3 bg-white border border-slate-200/60 rounded-xl text-cyan-500 shrink-0 shadow-2xs">
                <LuGauge className="w-5 h-5 xl:w-6 xl:h-6" />
              </div>
              <div className="space-y-1">
                <h4 className="text-xs xl:text-sm font-black text-slate-900">Extended Lifespan Matrix</h4>
                <p className="text-[11px] xl:text-xs text-slate-500 font-medium leading-relaxed">
                  In-house formulated compounds maintain structural integrity under extreme heat spikes and moisture-prone industrial environments.
                </p>
              </div>
            </div>
          </div>

          {/* ─── TECHNICAL PROCUREMENT CALL TO ACTION ────────────── */}

          <div className="flex flex-col sm:flex-row justify-center items-center gap-4 w-full">
            <Link
              href="https://realswitchgears.com/assets/images/products/polycab-cable/lv-power-cable/pdf/LV-Power-Cable-IS-1.pdf"
              target="_blank"
              className="inline-flex items-center justify-center gap-2 bg-slate-100 hover:bg-slate-200 text-slate-900 text-xs font-bold px-8 py-4 rounded-full transition-all w-full sm:w-auto uppercase tracking-wider border border-slate-200 shadow-xs"
            >
              <FaDownload className="w-3.5 h-3.5" />
              View Technical PDF
            </Link>

            <Link
              href="/contact"
              className="inline-flex items-center justify-center gap-2 bg-cyan-500 hover:bg-cyan-600 text-white text-xs xl:text-sm font-bold px-8 sm:px-10 py-4 rounded-full transition-all duration-200 active:scale-95 shadow-md shadow-cyan-500/10 w-full sm:w-auto uppercase tracking-wider"
            >
              Send Enquiry
              <FaArrowRight className="w-3.5 h-3.5 transition-transform group-hover:translate-x-0.5" />
            </Link>
          </div>
        </div >
      </div >
    </>
  );
}