"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,
  LuTv,
  LuRadio,
  LuSun,
  LuCpu
} from "react-icons/lu";

import Breadcrumb from "@/components/Common/Breadcrumb";

interface TechnicalSpec {
  id: string;
  title: string;
  category: string;
  technicalDetails: string;
}

const engineeringMetrics = [
  { label: "Application Class", val: "CATV / Satellite TV" },
  { label: "Center Core", val: "99.97% Pure Solid Cu" },
  { label: "Insulation Type", val: "Nitrogen Gas Foam" },
  { label: "Braid Coverage", val: "60% Alloy Mesh" }
];

const technicalSpecifications: TechnicalSpec[] = [
  {
    id: "spec-1",
    title: "Electrical Grade 99.97% Pure Solid Bare Copper or CCS Core",
    category: "1. Center Conductor",
    technicalDetails: "Constructed using high-conductivity, electrical grade 99.97% pure solid bare copper or high-strength solid copper-clad steel (CCS) conductor material. This premium baseline guarantees optimal high-frequency signal transmission with minimal electrical resistance."
  },
  {
    id: "spec-2",
    title: "Superior Nitrogen Gas-Injected High-Density Polyethylene Foam",
    category: "2. Dielectric Insulation",
    technicalDetails: "Insulated with superior quality high-density physical polyethylene foam injected with eco-friendly nitrogen gas. This gas-injected layering process forms a highly uniform cell matrix that outperforms old chemical foaming methods, lowering overall attenuation loss."
  },
  {
    id: "spec-3",
    title: "Bonded Specialty Composite Type Aluminium Foil Shielding",
    category: "3. Inner Screen Layer",
    technicalDetails: "Protected by an inline bonded Aluminium foil composite layer that acts as the primary signal shield. This design blocks electromagnetic ingress and prevents leakage of internal high-frequency video and data distribution signals."
  },
  {
    id: "spec-4",
    title: "High-Tensile Specialty Grade Aluminium Alloy Wire Braid",
    category: "4. Outer Braid Shielding",
    technicalDetails: "Reinforced with a high-tensile specialty grade aluminium alloy wire braid providing a uniform 60% coverage layer. This shielding delivers low signal loss, adds longitudinal mechanical pull strength, and prevents structural oxide breakdown in tropical conditions."
  },
  {
    id: "spec-5",
    title: "Volumetric High-Stability Water-Repellent Jelly Flooding",
    category: "5. Environmental Flooding",
    technicalDetails: "Flooded with a high-stability thixotropic jelly compound that fills internal gaps. This jelly layer creates an effective water block that stops moisture tracking along the cable line in case the outer jacket gets physically damaged."
  },
  {
    id: "spec-6",
    title: "In-House Formulated UV & Abrasion Resistant Thermoplastic Jacket",
    category: "6. External Sheath Casing",
    technicalDetails: "Enclosed in an in-house formulated thermoplastic PVC compound jacket. This exterior sheath is specifically engineered to resist abrasion and intense UV exposure, preventing structural cracking over long-term exterior installations."
  }
];

export default function PolycabCoaxialCable() {
  const [activeSpecId, setActiveSpecId] = useState<string>("spec-1");

  const activeSpec =
    technicalSpecifications.find(
      (spec) => spec.id === activeSpecId
    ) || technicalSpecifications[0];
  return (
    <>
      <Breadcrumb pageName="Polycab Coaxial Cable" description="Polycab Coaxial Cable" />
    <div className="min-h-screen bg-white text-slate-800 py-16 lg:py-24 2xl:py-32 selection:bg-cyan-100 selection:text-cyan-900">
      <div className="container mx-auto px-4 max-w-7xl 2xl:max-w-(screen-2xl)">

        {/* ─── HERO BRAND / DETAILS SECTION ──────────────────── */}
        <div className="grid grid-cols-1 lg:grid-cols-12 gap-12 2xl:gap-20 items-center mb-24 2xl: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-[420px] 2xl:max-w-[520px] aspect-square rounded-3xl overflow-hidden bg-slate-50 border border-slate-100 p-8 shadow-xs group">
              <div className="relative w-full h-full">
                <Image
                  src="/images/polycab/COAXIAL-CABLE-1.png"
                  alt="Polycab Jelly Flooded Gas-Insulated High-Frequency Coaxial Cable"
                  fill
                  priority
                  className="object-contain group-hover:scale-105 transition-transform duration-500"
                  sizes="(max-width: 768px) 100vw, (max-width: 1536px) 420px, 520px"
                />
              </div>
            </div>
          </div>

          {/* Right Frame: Text Narrative Content */}
          <div className="lg:col-span-7 space-y-6 2xl: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 font-bold tracking-wider text-cyan-400 uppercase border border-slate-800">
              CATV Network Architecture • Nitrogen Gas Physical Foam Medium
            </span>

            <h1 className="text-3xl md:text-4xl 2xl:text-5xl font-black tracking-tight text-slate-900 leading-tight">
              Polycab Co-axial Cables <br />
              <span className="text-cyan-600 font-extrabold text-xl md:text-2xl 2xl:text-3xl block mt-2">
                Jelly Flooded Low-Loss Double Screened Cable TV Infrastructure
              </span>
            </h1>

            <div className="space-y-4 2xl:space-y-6 text-slate-600 text-sm md:text-base 2xl:text-lg leading-relaxed font-medium">
              <p>
                Polycab’s high-performance <strong>Jelly Flooded Co-axial Cables</strong> are manufactured at their ultra-modern production plant in Daman, utilizing premium engineering and strict material matrices.
              </p>
              <p>
                The center conductor is made from <strong>99.97% pure solid electrical-grade copper</strong> to ensure better signal transmission. Unlike standard chemical foaming, the dielectric layer is insulated with eco-friendly <strong>nitrogen gas-injected physical foam</strong> to maintain clean signal routing across broad distances.
              </p>
              <p>
                Featuring a robust <strong>double screen design</strong> that pairs bonded aluminium foil with a <strong>60% coverage aluminium alloy braid</strong>, these cables maintain strong resistance to oxide buildup in challenging tropical weather climates.
              </p>
              <p>
                The outer jacket is extruded using a custom in-house formulated thermoplastic PVC compound, making the cable highly resistant to mechanical abrasion and long-term UV degradation during outdoor routing.
              </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-4 rounded-2xl">
              {engineeringMetrics.map((metric, index) => (
                <div key={index} className="bg-white border border-slate-200/60 p-3.5 rounded-xl text-center flex flex-col justify-center shadow-xs">
                  <span className="text-[10px] 2xl:text-xs text-slate-400 font-bold uppercase tracking-wider block mb-1">
                    {metric.label}
                  </span>
                  <span className="text-xs 2xl: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/coaxial-cable/pdf/COAXIAL-CABLE-1.pdf"
                target="_blank"
                className="inline-flex items-center gap-2 bg-slate-900 hover:bg-slate-800 text-white text-xs 2xl: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 Co-axial Cable Catalog
              </Link>
              <Link
                href="/contact"
                className="inline-flex items-center gap-2 bg-cyan-500 hover:bg-cyan-600 text-white text-xs 2xl: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 2xl:mb-32">
          <div className="flex items-center gap-3 mb-10 border-b border-slate-100 pb-5">
            <div className="p-2.5 bg-slate-50 border border-slate-200 text-slate-700 rounded-xl">
              <LuLayers className="w-5 h-5 text-cyan-600" />
            </div>
            <div>
              <h2 className="text-xl font-black text-slate-900 2xl:text-2xl">Technical Specifications &amp; Concentric Construction</h2>
              <p className="text-xs md:text-sm text-slate-500 font-medium mt-0.5">
                Select an extrusion layer segment below to analyze the specialized mechanical compounds and insulation architecture.
              </p>
            </div>
          </div>

          <div className="grid grid-cols-1 lg:grid-cols-12 gap-8 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 2xl:text-sm font-bold transition-all flex items-center justify-between group ${activeSpecId === spec.id
                    ? "bg-cyan-500 text-white border-cyan-600 shadow-md shadow-cyan-500/10"
                    : "bg-slate-50 text-slate-700 border-slate-200/70 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-white" : "text-slate-400"
                    }`} />
                </button>
              ))}
            </div>

            {/* Right Details Information Block */}
            <div className="lg:col-span-7 bg-slate-50 border border-slate-200/60 rounded-2xl p-6 md:p-8 2xl:p-10 min-h-[260px] flex flex-col justify-between">
              <div className="space-y-4">
                <div>
                  <span className="text-[10px] 2xl:text-xs font-black tracking-widest text-cyan-600 uppercase block mb-1">
                    {activeSpec?.category}
                  </span>

                  <h3 className="text-lg font-black text-slate-900 2xl:text-xl">
                    {activeSpec?.title}
                  </h3>
                </div>

                <p className="text-sm 2xl:text-base text-slate-600 font-medium leading-relaxed pt-4 border-t border-slate-200/60">
                  {activeSpec?.technicalDetails}
                </p>
              </div>
              <div className="mt-8 pt-4 border-t border-slate-200/60 flex items-center justify-between text-xs text-slate-400 font-bold">
                <span className="flex items-center gap-1.5 text-slate-600">
                  <LuShieldCheck className="w-4 h-4 text-cyan-600" /> High-Performance R&amp;D Lab Verification
                </span>
                <span>Premium Daman Plant Asset</span>
              </div>
            </div>

          </div>
        </div>

        {/* ─── ENVIRONMENTAL UTILITY CARDS ──── */}
        <div className="grid grid-cols-1 md:grid-cols-3 gap-6 mb-24 2xl:mb-32">
          <div className="bg-slate-50 border border-slate-200/60 rounded-2xl p-6 2xl:p-8 flex items-start gap-4">
            <div className="p-3 bg-white border border-slate-100 rounded-xl text-cyan-600 shrink-0 shadow-xs">
              <LuTv className="w-5 h-5 2xl:w-6 2xl:h-6" />
            </div>
            <div className="space-y-1">
              <h4 className="text-sm font-black text-slate-900 2xl:text-base">CATV Network Optimization</h4>
              <p className="text-xs 2xl:text-sm text-slate-500 font-medium leading-relaxed">
                The ideal choice for modern cable television distribution networks requiring clear signal processing and low attenuation.
              </p>
            </div>
          </div>
          <div className="bg-slate-50 border border-slate-200/60 rounded-2xl p-6 2xl:p-8 flex items-start gap-4">
            <div className="p-3 bg-white border border-slate-100 rounded-xl text-cyan-600 shrink-0 shadow-xs">
              <LuRadio className="w-5 h-5 2xl:w-6 2xl:h-6" />
            </div>
            <div className="space-y-1">
              <h4 className="text-sm font-black text-slate-900 2xl:text-base">Double Layer EMI Screening</h4>
              <p className="text-xs 2xl:text-sm text-slate-500 font-medium leading-relaxed">
                Combines bonded composite foil with a 60% alloy grid to effectively eliminate signal drops from surrounding ambient static.
              </p>
            </div>
          </div>
          <div className="bg-slate-50 border border-slate-200/60 rounded-2xl p-6 2xl:p-8 flex items-start gap-4">
            <div className="p-3 bg-white border border-slate-100 rounded-xl text-cyan-600 shrink-0 shadow-xs">
              <LuSun className="w-5 h-5 2xl:w-6 2xl:h-6" />
            </div>
            <div className="space-y-1">
              <h4 className="text-sm font-black text-slate-900 2xl:text-base">Tropical Weather Defense</h4>
              <p className="text-xs 2xl:text-sm text-slate-500 font-medium leading-relaxed">
                The UV-resistant PVC casing and jelly core prevent water tracking and core oxidation during extreme weather shifts.
              </p>
            </div>
          </div>
        </div>

        {/* ─── COMMERCIAL INQUIRY BLOCK ──────────────────────── */}
        <div className="flex flex-wrap gap-4 pt-2">
          <Link
            href="https://realswitchgears.com/assets/images/products/polycab-cable/panel-wires/pdf/Panel-wires-IS-694.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 IS 694 Catalogue
          </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>
    </>
  );
}