import{r as m,j as e}from"./app-C417rstp.js";import{p,n as y}from"./index-C9OncgsG.js";import b from"./LabBigCar-D_nhSWJx.js";import f from"./Tabs-BAVCwQOA.js";import{m as c}from"./proxy-Bepa3l_N.js";import{A as u}from"./index-CIV8c8cT.js";import"./ImageSlider-sklF08m2.js";function x(...o){return o.filter(Boolean).join(" ")}const h="from-primary-600 to-secondary-600",j="/images/fondos/fondo_13.png";function L({laboratorios:o=[]}){const t=m.useMemo(()=>Array.isArray(o)?o:[],[o]),[d,i]=m.useState(0),l=t.length===0;m.useEffect(()=>{if(l)return;const n=new URLSearchParams(window.location.search).get("lab");if(n){const r=t.findIndex(g=>String(g.id)===n||g.slug===n);r>=0&&i(r)}},[t,l]),m.useEffect(()=>{if(l)return;const a=n=>{n.key==="ArrowRight"&&i(r=>(r+1)%t.length),n.key==="ArrowLeft"&&i(r=>(r-1+t.length)%t.length)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t.length,l]);const s=t[d];return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 via-white to-gray-50",children:[e.jsxs("section",{className:"relative overflow-hidden",children:[e.jsx("img",{src:j,alt:"Centros y Laboratorios DETRI",className:"absolute inset-0 h-full w-full object-cover",loading:"eager"}),e.jsx("div",{className:"absolute inset-0 bg-black/45"}),e.jsx("div",{className:x("absolute inset-0 bg-gradient-to-br mix-blend-multiply opacity-60",h)}),e.jsx("div",{className:"absolute inset-0 bg-grid-pattern opacity-[0.06]"}),e.jsx("div",{className:"relative min-h-[40vh] lg:min-h-[50vh] flex items-center justify-center text-center px-6 py-16",children:e.jsxs(c.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.8,ease:[.23,1,.32,1]},children:[e.jsx(c.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:{delay:.2},className:x("inline-block mb-4 px-4 py-2 rounded-full bg-white/10 text-white text-sm font-semibold border border-white/20"),children:"DETRI · Universidad EPN"}),e.jsxs("h1",{className:"text-5xl sm:text-6xl lg:text-7xl font-black tracking-tight text-white mb-4",children:["Centros y"," ",e.jsx("span",{className:x("bg-clip-text text-transparent bg-gradient-to-r",h),children:"Laboratorios"})]}),e.jsx("p",{className:"mt-2 max-w-2xl mx-auto text-lg text-white/85",children:"Explora nuestros espacios de innovación y tecnología"})]})})]}),l?e.jsx("section",{className:"py-20",children:e.jsx("div",{className:"mx-auto max-w-3xl px-6 lg:px-8 text-center",children:e.jsxs("div",{className:"inline-block rounded-2xl border border-gray-200 bg-white px-6 py-10 shadow-sm",children:[e.jsx("h3",{className:"text-2xl font-bold text-gray-900",children:"Aún no hay laboratorios agregados"}),e.jsx("p",{className:"mt-2 text-gray-600",children:"Cuando se registren laboratorios desde el panel, aparecerán aquí automáticamente."})]})})}):e.jsxs(e.Fragment,{children:[e.jsx(f,{labs:t,current:d,onChange:i}),e.jsx("section",{className:"py-16",children:e.jsxs("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:[e.jsx(u,{mode:"wait",children:e.jsx(b,{lab:s},(s==null?void 0:s.id)??(s==null?void 0:s.slug)??d)}),e.jsxs(c.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"mt-10 flex items-center justify-between gap-4",children:[e.jsxs(c.button,{whileHover:{scale:1.05,x:-5},whileTap:{scale:.95},onClick:()=>i(a=>(a-1+t.length)%t.length),className:`inline-flex items-center gap-2 rounded-xl border-2 border-gray-200 px-6 py-3 text-sm font-semibold
                               text-gray-700 hover:border-gray-300 hover:bg-gray-50 transition-all shadow-sm hover:shadow-md`,children:[e.jsx(p,{className:"text-lg"})," Anterior"]}),e.jsxs("div",{className:"text-sm text-gray-500 font-medium",children:[d+1," / ",t.length]}),e.jsxs(c.button,{whileHover:{scale:1.05,x:5},whileTap:{scale:.95},onClick:()=>i(a=>(a+1)%t.length),className:x("inline-flex items-center gap-2 rounded-xl px-6 py-3 text-sm font-semibold text-white","bg-gradient-to-r shadow-md hover:shadow-lg transition-all",h),children:["Siguiente ",e.jsx(y,{className:"text-lg"})]})]})]})})]})]})})}export{L as default};
