import{u as k,r as c,a as A,j as e,P as S,J as F,m as Q,N as E,B as q,H,S as l,b as u,n as w,L as M,o as z,I as B,X as L,p as R,q as V,t as P,v as T,M as I,w as O,e as $}from"./index-Bt7ohjT1.js";import{S as G}from"./skeleton-f2GsyDr_.js";import{u as U,F as b}from"./useFAQs-7XiMjMQ4.js";import{C as _}from"./circle-help-D5GYWaFn.js";function Z(){var y;const{openCheckDate:f}=k(),[a,p]=c.useState(""),[n,J]=c.useState("all"),{data:o,isLoading:N}=U(),C=c.useRef({}),{data:r}=A("faqs"),d=c.useMemo(()=>o?o.reduce((s,t)=>(s[t.category]||(s[t.category]=[]),s[t.category].push(t),s),{}):{},[o]);c.useMemo(()=>b.filter(({value:s})=>{var t;return((t=d[s])==null?void 0:t.length)>0}),[d]);const g=c.useMemo(()=>{let s=d;if(n!=="all"){const t=d[n];s=t?{[n]:t}:{}}if(a.trim()){const t=a.toLowerCase(),m={};return Object.entries(s).forEach(([x,i])=>{const h=(i||[]).filter(v=>v.question.toLowerCase().includes(t)||v.answer.toLowerCase().includes(t));h.length>0&&(m[x]=h)}),m}return s},[a,d,n]),j=Object.values(g).reduce((s,t)=>s+((t==null?void 0:t.length)||0),0);return e.jsxs("div",{className:"page-dark min-h-screen bg-background",children:[e.jsx(S,{title:"Bubble Football FAQs | UK's #1 Rated | Spartacus Bubble Soccer",description:"Got questions about bubble football? Find answers about booking, safety, equipment and more. The UK's #1 rated experience by Spartacus."}),o&&o.length>0&&e.jsx(F,{id:"faqs-page",data:Q(o.filter(s=>s.is_enabled).map(s=>({question:s.question,answer:s.answer})))}),e.jsx(E,{}),e.jsx(q,{}),e.jsxs("main",{children:[e.jsxs("section",{className:"relative min-h-[55vh] flex items-center justify-center text-center overflow-hidden",children:[e.jsx(H,{overlayVariant:"foreground",overlayOpacity:50,image:(r==null?void 0:r.imageUrl)||void 0,desktopPosition:r==null?void 0:r.desktopPosition,mobilePosition:r==null?void 0:r.mobilePosition}),e.jsxs("div",{className:"relative z-10 container mx-auto px-4 py-32 md:py-40",children:[e.jsxs(l,{children:[e.jsxs("div",{className:"inline-flex items-center gap-2 bg-primary/20 border border-primary/30 rounded-sm px-4 py-2 mb-6",children:[e.jsx(_,{className:"w-4 h-4 text-primary"}),e.jsx("span",{className:"text-xs font-bold uppercase tracking-widest text-primary",children:"Quick Answers"})]}),e.jsxs("h1",{className:"font-display text-5xl md:text-7xl lg:text-8xl font-bold italic text-white uppercase tracking-tight leading-[0.9]",children:["Frequently Asked",e.jsx("br",{}),e.jsx("span",{className:"text-primary",children:"Questions"})]}),e.jsx("p",{className:"mt-6 text-lg md:text-xl text-white/70 max-w-2xl mx-auto leading-relaxed",children:"Clear answers to common questions about Spartacus Bubble Soccer."})]}),e.jsxs(l,{delay:.2,children:[e.jsx("div",{className:"mt-10",children:e.jsx(u,{size:"lg",onClick:()=>f({source:"faqs-hero"}),children:"Check Date"})}),e.jsxs("p",{className:"mt-4 text-sm text-white/50",children:["Can't find your answer? ",e.jsx(w,{to:"/contact",className:"text-primary hover:underline",children:"Contact us"}),"."]})]})]})]}),e.jsx(M,{dark:!0}),e.jsx("section",{className:"py-12 bg-foreground",children:e.jsx("div",{className:"container mx-auto px-4 max-w-4xl",children:e.jsxs(l,{delay:.1,children:[e.jsxs("div",{className:"relative max-w-xl mx-auto",children:[e.jsx(z,{className:"absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5 text-white/40"}),e.jsx(B,{type:"text",placeholder:n==="all"?"Search all FAQs...":`Search ${((y=b.find(s=>s.value===n))==null?void 0:y.label)||""} FAQs...`,value:a,onChange:s=>p(s.target.value),className:"pl-12 pr-12 h-12 text-base bg-white/10 border-white/20 text-white placeholder:text-white/40 focus:border-primary"}),a&&e.jsx("button",{onClick:()=>p(""),className:"absolute right-4 top-1/2 -translate-y-1/2 text-white/40 hover:text-white transition-colors",children:e.jsx(L,{className:"w-5 h-5"})})]}),a&&e.jsx("p",{className:"text-center text-sm text-white/50 mt-4",children:j===0?"No results found":`${j} result${j===1?"":"s"} found`})]})})}),e.jsxs("section",{className:"py-20 px-4 bg-primary relative overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 opacity-[0.06] pointer-events-none",style:{backgroundImage:`url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")`}}),e.jsx("div",{className:"container mx-auto max-w-4xl relative z-10",children:N?e.jsx("div",{className:"space-y-8",children:[...Array(4)].map((s,t)=>e.jsx(G,{className:"h-32 w-full rounded-sm"},t))}):Object.keys(g).length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx("p",{className:"text-foreground/70 mb-4",children:a?"No FAQs match your search. Try a different term or browse all questions.":"No FAQs available yet."}),a&&e.jsx(u,{variant:"outline",onClick:()=>p(""),children:"Clear search"})]}):e.jsx("div",{className:"space-y-6",children:b.map(({value:s,label:t},m)=>{const x=g[s];return!x||x.length===0?null:e.jsx(l,{delay:a?0:.1+m*.05,children:e.jsxs("div",{ref:i=>C.current[s]=i,className:"bg-card border border-border p-6 md:p-8 rounded-sm scroll-mt-24",children:[e.jsx("h2",{className:"font-display text-lg md:text-xl font-bold text-foreground uppercase tracking-tight mb-6",children:t}),e.jsx(R,{type:"single",collapsible:!0,className:"w-full",defaultValue:a?`${s}-0`:void 0,children:x.map((i,h)=>e.jsxs(V,{value:`${s}-${h}`,className:"border-border",children:[e.jsx(P,{className:"text-left font-medium text-foreground hover:text-primary py-4 text-sm uppercase tracking-wide",children:i.question}),e.jsx(T,{className:"text-muted-foreground text-sm leading-relaxed pb-4",children:i.answer})]},i.id))})]})},s)})})})]}),e.jsx("section",{className:"py-20 px-4 bg-foreground",children:e.jsxs("div",{className:"container mx-auto max-w-3xl text-center",children:[e.jsxs(l,{children:[e.jsxs("div",{className:"inline-flex items-center gap-2 bg-primary/20 border border-primary/30 rounded-sm px-4 py-2 mb-6",children:[e.jsx(I,{className:"w-4 h-4 text-primary"}),e.jsx("span",{className:"text-xs font-bold uppercase tracking-widest text-primary",children:"Get in Touch"})]}),e.jsx("h2",{className:"font-display text-3xl md:text-4xl font-bold text-white uppercase tracking-tight mb-4",children:"Still Have Questions?"})]}),e.jsx(l,{delay:.1,children:e.jsx("p",{className:"text-white/70 text-lg mb-8 max-w-xl mx-auto",children:"Can't find what you're looking for? Our friendly team is here to help with any questions about your booking."})}),e.jsx(l,{delay:.2,children:e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-center",children:[e.jsx(u,{asChild:!0,size:"lg",className:"min-w-[180px]",children:e.jsxs(w,{to:"/contact",className:"flex items-center gap-2",children:["Contact Us ",e.jsx(O,{className:"w-4 h-4"})]})}),e.jsx(u,{size:"lg",variant:"outline",className:"border-white/30 text-white hover:bg-white/10 min-w-[180px]",onClick:()=>f({source:"faqs-final"}),children:"Check Date"})]})}),e.jsx(l,{delay:.3,children:e.jsx("p",{className:"mt-8 text-white/50 text-sm",children:"We typically respond within 24 hours on working days."})})]})})]}),e.jsx($,{})]})}export{Z as default};