import{r as c,j as e,H as h}from"./app-BRoRPa4x.js";import{H as x}from"./HomeLayout-BqgabGj_.js";import{S as p}from"./SchoolModal-BqMG3YAU.js";import{m as n}from"./proxy-iYr3ghlA.js";import"./Preloader-ljohZMnx.js";import"./Footer-DMFO-n_M.js";import"./index-CHm4akKZ.js";import"./SuccessDisplay-CFRNoQck.js";import"./sweetalert2.esm.all-UgF8mXO5.js";import"./ToastNote-Vtzm4n0q.js";import"./CalendarIcon-Dz0YLryS.js";import"./LockClosedIcon-O-boSNQW.js";import"./ArrowRightIcon-ChGRkg3P.js";import"./InformationCircleIcon-C1kay-lt.js";import"./ClockIcon-BK9oVM-Q.js";import"./MapPinIcon-DI-0ah0B.js";import"./SparklesIcon-DSvmnZOx.js";import"./CreditCardIcon-CzCmaS6S.js";const u={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1,delayChildren:.2}}},g={hidden:{y:20,opacity:0},visible:{y:0,opacity:1,transition:{duration:.5,ease:"easeOut"}}},j=({service:t,onBookClick:l})=>{const a=o=>{const i={year:"numeric",month:"short",day:"numeric"};return new Date(o).toLocaleDateString(void 0,i)},r=t.image_urls&&t.image_urls.length>0?t.image_urls[0]:`https://placehold.co/600x400/E2E8F0/475569?text=${encodeURIComponent(t.title)}`;return e.jsxs(n.div,{className:"bg-white rounded-lg border border-gray-200 overflow-hidden shadow-sm hover:shadow-lg transition-shadow duration-300",variants:g,whileHover:{y:-4},children:[e.jsxs("div",{className:"relative h-48 bg-gray-100",children:[e.jsx("img",{src:r,alt:t.title,className:"w-full h-full object-cover",onError:o=>{o.target.onerror=null,o.target.src=`https://placehold.co/600x400/E2E8F0/475569?text=${encodeURIComponent(t.title)}`}}),e.jsx("div",{className:"absolute top-4 right-4",children:t.type==="paid"?e.jsxs("span",{className:"bg-slate-800 text-white text-xs font-semibold px-2.5 py-1 rounded",children:["₵",t.price]}):e.jsx("span",{className:"bg-emerald-100 text-emerald-800 text-xs font-semibold px-2.5 py-1 rounded",children:"Free"})})]}),e.jsxs("div",{className:"p-6",children:[e.jsx("h3",{className:"text-xl font-bold text-slate-900 mb-3 leading-tight",children:t.title}),e.jsxs("ul",{className:"text-sm text-slate-600 space-y-2 mb-4",children:[e.jsxs("li",{className:"flex items-center",children:[e.jsx("svg",{className:"w-4 h-4 mr-2 text-emerald-600 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Starts: ",a(t.start_date)]}),e.jsxs("li",{className:"flex items-center",children:[e.jsxs("svg",{className:"w-4 h-4 mr-2 text-emerald-600 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),t.location]})]}),e.jsx("p",{className:"text-slate-600 text-sm mb-5 line-clamp-2",children:t.description}),e.jsx(n.button,{className:"w-full bg-emerald-600 hover:bg-emerald-700 text-white font-medium py-2.5 px-4 rounded-md transition-colors duration-200",whileHover:{scale:1.02},whileTap:{scale:.98},onClick:()=>l(t),children:t.type==="paid"?"Enroll Now":"Register for Free"})]})]})};function F({schoolServices:t}){const[l,a]=c.useState(!1),[r,o]=c.useState(null),i=s=>{o(s),a(!0)},d=()=>{a(!1),o(null)},m=s=>{console.log("School booking submitted:",s),d()};return e.jsxs(x,{children:[e.jsx(h,{title:"School Services"}),e.jsxs("section",{className:"bg-slate-50 py-16 md:py-24",id:"school-services",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsx("h1",{className:"text-4xl font-bold text-gray-800 mb-12 text-center",children:"Our School Programs"}),e.jsx(n.div,{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",variants:u,initial:"hidden",whileInView:"visible",viewport:{once:!0,amount:.1},children:t&&t.length>0?t.map(s=>e.jsx(j,{service:s,onBookClick:i},s.id)):e.jsx("div",{className:"col-span-full text-center py-12",children:e.jsx("p",{className:"text-lg text-slate-500",children:"No school programs are available at this time. Please check back later."})})})]}),e.jsx(p,{school:r,isOpen:l,onClose:d,onBook:m})]})]})}export{F as default};
