import{j as e}from"./vendor-ui-CUslpDkL.js";import{r as o}from"./vendor-react-Dg0Tra3e.js";import{u as x,b as c,C as n,S as p}from"./index-CJqEbhJN.js";import{f as u}from"./format-BrSaXzvW.js";import"./vendor-query-CN1EccJz.js";import"./vendor-supabase-yzuDJZPy.js";import"./vendor-motion-CiNtJfg1.js";function y(){const{t}=x(),[r,i]=o.useState([]),[l,m]=o.useState(!0);return o.useEffect(()=>{(async()=>{try{const d=await(await fetch("https://api.jikan.moe/v4/seasons/upcoming?limit=24")).json();i(d.data||[])}catch(a){console.error("Error fetching upcoming anime:",a)}finally{m(!1)}})()},[]),e.jsx("div",{className:"min-h-screen px-4 py-8 md:py-12",children:e.jsxs("div",{className:"mx-auto max-w-7xl",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx(c,{className:"w-10 h-10 text-accent"}),e.jsx("h1",{className:"text-4xl font-bold",children:t("upcoming.title")})]}),e.jsx("p",{className:"text-muted-foreground text-lg",children:t("upcoming.description")})]}),l&&e.jsxs("div",{className:"text-center py-20",children:[e.jsx(c,{className:"w-12 h-12 mx-auto mb-4 animate-spin text-primary"}),e.jsx("p",{className:"text-muted-foreground",children:t("upcoming.loading")})]}),!l&&r.length===0&&e.jsxs("div",{className:"text-center py-20 glass-card",children:[e.jsx(n,{className:"w-12 h-12 mx-auto mb-4 text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground",children:t("upcoming.noUpcoming")})]}),!l&&r.length>0&&e.jsx("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:r.map(s=>e.jsxs("div",{className:"glass-card-hover overflow-hidden group cursor-pointer h-full flex flex-col",children:[e.jsxs("div",{className:"relative h-80 overflow-hidden",children:[e.jsx("img",{src:s.images.jpg.large_image_url,alt:s.title_english||s.title,className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-110"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-card via-card/50 to-transparent"}),e.jsx("span",{className:"absolute top-3 left-3 px-3 py-1 text-xs font-semibold rounded-full bg-accent text-accent-foreground",children:t("upcoming.upcoming")}),s.season&&s.year&&e.jsxs("span",{className:"absolute top-3 right-3 px-3 py-1 text-xs font-semibold rounded-full glass-card",children:[s.season.charAt(0).toUpperCase()+s.season.slice(1)," ",s.year]}),s.aired.from&&e.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-4 translate-y-full group-hover:translate-y-0 transition-transform duration-300",children:e.jsxs("div",{className:"flex items-center gap-2 text-primary mb-2",children:[e.jsx(n,{className:"w-4 h-4"}),e.jsxs("span",{className:"text-xs font-semibold",children:[t("upcoming.releases")," ",u(new Date(s.aired.from),"MMM d, yyyy")]})]})})]}),e.jsxs("div",{className:"p-4 flex-1 flex flex-col",children:[e.jsx("h3",{className:"font-semibold text-lg mb-1 group-hover:text-primary transition-colors line-clamp-2",children:s.title_english||s.title}),s.title_japanese&&e.jsx("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-1",children:s.title_japanese}),s.synopsis&&e.jsx("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2",children:s.synopsis}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-auto",children:s.genres?.slice(0,3).map(a=>e.jsx("span",{className:"px-2 py-1 text-xs rounded-full bg-white/5 border border-white/10 text-muted-foreground",children:a.name},a.name))}),s.score&&e.jsxs("div",{className:"flex items-center gap-1 mt-3 text-sm",children:[e.jsx(p,{className:"w-4 h-4 text-secondary fill-secondary"}),e.jsx("span",{className:"font-semibold",children:s.score.toFixed(1)}),e.jsx("span",{className:"text-muted-foreground ml-1",children:t("upcoming.expectedScore")})]})]})]},s.mal_id))})]})})}export{y as default};