"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 {
  LuLayers,
  LuShieldCheck,
  LuTriangle,
  LuActivity,
  LuBinary,
  LuFactory,
  LuCpu
} from "react-icons/lu";
import Breadcrumb from "@/components/Common/Breadcrumb";

// export const metadata = {
//   title: "Polycab Instrumentation Cables | BS EN 50288-7 Process Control Wire",
//   description: "Explore Polycab instrumentation cables conforming to BS EN 50288-7. Engineered with PVC/XLPE insulation and Aluminium-Mylar individual screening for industrial automation signal routing.",
//   keywords: ["Polycab Instrumentation Cable", "BS EN 50288-7 Cable", "Process Control Wire", "Aluminium Mylar Screening", "Signal Transmission Cable"],
// };

interface TechnicalSpec {
  id: string;
  title: string;
  category: string;
  technicalDetails: string;
}

export default function PolycabInstrumentationCableBS() {
  const [activeSpecId, setActiveSpecId] = useState<string>("spec-1");

  const engineeringMetrics = [
    { label: "Standard Class", val: "BS EN 50288-7" },
    { label: "Core Metal", val: "Plain / Tinned Copper" },
    { label: "Dielectric Layer", val: "High-Prop PVC / XLPE" },
    { label: "Shielding Form", val: "Al-Mylar Tape / ATC" }
  ];

  const technicalSpecifications: TechnicalSpec[] = [
    {
      id: "spec-1",
      title: "High-Conductivity Annealed Plain/Tinned Stranded Conductor",
      category: "Conductor Core Architecture",
      technicalDetails: "Constructed utilizing high-conductivity annealed plain or tinned stranded copper conductors. The entire drawing and stranding process is completed completely in-house on state-of-the-art machinery to guarantee structural integrity and uniform signal propagation."
    },
    {
      id: "spec-2",
      title: "In-House Developed PVC / XLPE Insulation Compound",
      category: "Dielectric Layering",
      technicalDetails: "Insulated with Polycab's custom-formulated PVC or XLPE insulation compound, featuring exceptionally high dielectric strength. This formulation delivers minimal signal loss, excellent voltage breakdown resistance, and long-term thermal stability."
    },
    {
      id: "spec-3",
      title: "Aluminium-Mylar Tape with Tinned Copper Drain Wire Shielding",
      category: "Electromagnetic Screening",
      technicalDetails: "Provides specialized individual shielding for twisted pairs or triads. Features premium Aluminium-Mylar tape wrapped with a continuous tinned copper drain wire in uninterrupted contact with the tape's metallic side. Shielding with ATC braiding can also be provided to meet specific project configurations."
    },
    {
      id: "spec-4",
      title: "Dynamic Pair & Triad Numerical / Color Identification Matrix",
      category: "Core Identification Framework",
      technicalDetails: "Enables seamless terminal connection mapping. Cores, pairs, or triads are uniquely identified via crisp direct surface number printing or via a numbered polyester binding tape layered securely over each bundle. Identification is also available with variable standard color-coding options."
    }
  ];

  return (
    <>
      <Breadcrumb pageName="Polycab Instrumentation Cables" description="Polycab 1100V grade industrial cables. Engineered with PVC/XLPE insulation and Aluminium-Mylar individual screening for industrial automation signal routing." />
      <div className="min-h-screen bg-white text-slate-800 py-16 lg:py-28 xl:py-36 selection:bg-cyan-100 selection:text-slate-900">
        {/* Maximum content container upgraded to 1600px layout for expansive multi-panel reading */}
        <div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-[1600px]">



          {/* ─── HERO BRAND / DETAILS SECTION ──────────────────── */}
          <div className="grid grid-cols-1 lg:grid-cols-12 gap-12 xl:gap-20 items-center mb-24 xl:mb-32">

            {/* Left Frame: Image Asset Viewport */}
            <div className="lg:col-span-5 flex justify-center order-2 lg:order-1">
              <div className="relative w-full max-w-[450px] xl:max-w-[550px] aspect-square rounded-3xl overflow-hidden bg-white border border-slate-200 p-8 shadow-sm group">
                <div className="relative w-full h-full">
                  <Image
                    src="/images/polycab/Instrumentation-Cable-BS.png"
                    alt="Polycab BS EN 50288-7 Shielded Process Instrumentation Cable"
                    fill
                    priority
                    className="object-contain group-hover:scale-105 transition-transform duration-500"
                    sizes="(max-width: 768px) 100vw, (max-width: 1280px) 450px, 550px"
                  />
                </div>
              </div>
            </div>

            {/* Right Frame: Text Narrative Content */}
            <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-slate-900 px-4 py-1.5 text-xs xl:text-sm font-bold tracking-wider text-cyan-400 uppercase border border-slate-800">
                BS EN 50288-7 Compliance • Process Automation Signal Grid
              </span>

              <h1 className="text-3xl md:text-4xl xl:text-5xl font-black tracking-tight text-slate-900 leading-tight">
                Polycab Instrumentation Cables <br />
                <span className="text-cyan-600 font-extrabold text-xl md:text-2xl xl:text-3xl block mt-3">
                  Screened Multi-Pair Process Control Cables for Modern Automation
                </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>
                  The rapid expansion of automation within processing industries requires highly reliable signal transmission. Across massive utility scales like oil refineries, petrochemical plants, steel mills, and power stations, data must route cleanly without external interference.
                </p>
                <p>
                  In a continuous processing facility, physical parameters like temperature, pressure, fluid flow, and volumetric levels are captured and converted into sensitive electrical signals. These telemetry streams feed directly back to the central operations center.
                </p>
                <p>
                  If the control room represents the brain of the plant, <strong className="text-slate-900">instrumentation cables function as the arteries</strong>. Polycab’s <strong className="text-slate-900">BS EN 50288-7</strong> range provides the shielding needed to analyze signals cleanly and send precise commands back to field hardware.
                </p>
              </div>

              {/* Parameter Cards Summary Layout */}
              <div className="grid grid-cols-2 sm:grid-cols-4 gap-4 bg-slate-50 border border-slate-200/80 p-5 rounded-2xl shadow-2xs">
                {engineeringMetrics.map((metric, index) => (
                  <div key={index} className="bg-white border border-slate-200 p-4 rounded-xl text-center flex flex-col justify-center min-h-[80px]">
                    <span className="text-[10px] xl:text-xs text-slate-400 font-bold uppercase tracking-wider block mb-1">
                      {metric.label}
                    </span>
                    <span className="text-xs xl:text-sm font-black text-slate-900 leading-snug">
                      {metric.val}
                    </span>
                  </div>
                ))}
              </div>

              {/* Direct Brochure CTAs */}
              <div className="flex flex-wrap gap-4 pt-2">
                <Link
                  href="https://realswitchgears.com/assets/images/products/polycab-cable/instrumentation-cable/pdf/Instrumentation-Cable-BS.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 shadow-sm"
                >
                  <FaDownload className="w-3.5 h-3.5 group-hover:translate-y-0.5 transition-transform" />
                  Download BS EN 50288-7 Catalog
                </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-md shadow-cyan-500/10"
                >
                  Send Enquiry <FaEnvelope className="w-3.5 h-3.5" />
                </Link>
              </div>
            </div>

          </div>

          {/* ─── INTERACTIVE ARCHITECTURE SPECIFICATION VIEWER ──── */}
          <div className="mb-24 xl:mb-32">
            <div className="flex items-center gap-4 mb-10 border-b border-slate-200 pb-5">
              <div className="p-3 bg-slate-100 border border-slate-200 text-slate-700 rounded-xl">
                <LuLayers className="w-6 h-6" />
              </div>
              <div>
                <h2 className="text-xl xl:text-2xl font-black text-slate-900">Technical Specifications &amp; Core Geometry</h2>
                <p className="text-xs xl:text-sm text-slate-500 font-medium mt-0.5">
                  Select an engineering element below to evaluate insulation profiles, tracking metrics, and shielding properties of Polycab's signal matrix.
                </p>
              </div>
            </div>

            <div className="grid grid-cols-1 lg:grid-cols-12 gap-8 xl:gap-12 items-start">

              {/* Left Control Panel Column */}
              <div className="lg:col-span-5 space-y-2.5">
                {technicalSpecifications.map((spec) => (
                  <button
                    key={spec.id}
                    onClick={() => setActiveSpecId(spec.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 ${activeSpecId === spec.id
                      ? "bg-slate-900 text-white border-slate-950 shadow-md"
                      : "bg-slate-50 text-slate-700 border-slate-200 hover:bg-slate-100"
                      }`}
                  >
                    <span className="truncate pr-4">{spec.title}</span>
                    <FaChevronRight className={`w-2.5 h-2.5 shrink-0 opacity-70 group-hover:translate-x-0.5 transition-transform ${activeSpecId === spec.id ? "text-cyan-400" : "text-slate-400"
                      }`} />
                  </button>
                ))}
              </div>

              {/* Right Details Information Block */}
              <div className="lg:col-span-7 bg-slate-50 border border-slate-200 rounded-2xl p-6 md:p-8 xl:p-10 min-h-[260px] flex flex-col justify-between shadow-2xs">
                {(() => {
                  const specMatch = technicalSpecifications.find((s) => s.id === activeSpecId)!;
                  return (
                    <>
                      <div className="space-y-4">
                        <div>
                          <span className="text-[10px] xl:text-xs font-black tracking-widest text-cyan-600 uppercase block mb-1.5">
                            {specMatch.category}
                          </span>
                          <h3 className="text-base xl:text-lg font-black text-slate-900">
                            {specMatch.title}
                          </h3>
                        </div>
                        <p className="text-xs md:text-sm xl:text-base text-slate-600 font-medium leading-relaxed pt-3 border-t border-slate-200">
                          {specMatch.technicalDetails}
                        </p>
                      </div>

                      <div className="mt-8 pt-4 border-t border-slate-200 flex items-center justify-between text-[11px] xl:text-xs text-slate-400 font-bold">
                        <span className="flex items-center gap-1.5 text-slate-700">
                          <LuShieldCheck className="w-4 h-4 text-cyan-500" /> High-Performance Crosstalk Attenuation
                        </span>
                        <span>BS EN 50288-7 Certified</span>
                      </div>
                    </>
                  );
                })()}
              </div>

            </div>
          </div>

          {/* ─── INDUSTRIAL APPLICATIONS & SIGNAL UTILITY CARDS ──── */}
          <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-200 rounded-2xl p-6 xl:p-8 shadow-2xs flex items-start gap-4">
              <div className="p-3 bg-cyan-50 border border-cyan-100 rounded-xl text-cyan-600 shrink-0">
                <LuFactory className="w-6 h-6" />
              </div>
              <div className="space-y-1.5">
                <h4 className="text-xs xl:text-sm font-black text-slate-900">Continuous Process Plants</h4>
                <p className="text-[11px] xl:text-xs text-slate-500 font-medium leading-relaxed">
                  Optimized for demanding processing topologies such as oil refining, petrochemical processing, fertilizer blending, and cement factories.
                </p>
              </div>
            </div>
            <div className="bg-slate-50 border border-slate-200 rounded-2xl p-6 xl:p-8 shadow-2xs flex items-start gap-4">
              <div className="p-3 bg-cyan-50 border border-cyan-100 rounded-xl text-cyan-600 shrink-0">
                <LuBinary className="w-6 h-6" />
              </div>
              <div className="space-y-1.5">
                <h4 className="text-xs xl:text-sm font-black text-slate-900">Telemetry Parameter Conversions</h4>
                <p className="text-[11px] xl:text-xs text-slate-500 font-medium leading-relaxed">
                  Maintains clean data transmission for complex field metrics including temperature tracking, inline pressure, fluid flow rates, and volume levels.
                </p>
              </div>
            </div>
            <div className="bg-slate-50 border border-slate-200 rounded-2xl p-6 xl:p-8 shadow-2xs flex items-start gap-4">
              <div className="p-3 bg-cyan-50 border border-cyan-100 rounded-xl text-cyan-600 shrink-0">
                <LuActivity className="w-6 h-6" />
              </div>
              <div className="space-y-1.5">
                <h4 className="text-xs xl:text-sm font-black text-slate-900">EMI & RFI Noise Shielding</h4>
                <p className="text-[11px] xl:text-xs text-slate-500 font-medium leading-relaxed">
                  The continuous contact Aluminium-Mylar screen with tinned copper drain wires prevents inductive crosstalk from adjacent high-voltage lines.
                </p>
              </div>
            </div>
          </div>

          {/* ─── COMMERCIAL INQUIRY BLOCK ──────────────────────── */}
          <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>
    </>
  );
}