(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{30:(e,t,s)=>{"use strict";s.d(t,{default:()=>K});var r=s(5155),a=s(5695),l=s(9137),i=s.n(l),n=s(2115),o=s(6874),d=s.n(o),c=s(2348),m=s(1824),x=s(2690);let u=(0,n.memo)(()=>{let[e,t]=(0,n.useState)(""),[s,l]=(0,n.useState)([]),[i,o]=(0,n.useState)(!1),[d,u]=(0,n.useState)(!1),[h,p]=(0,n.useState)(1),[b,g]=(0,n.useState)(!0),f=(0,c.A)(e,300),v=(0,a.useRouter)(),w=(0,n.useRef)(null),j=(0,n.useRef)(null),y=(0,n.useRef)(null),N=(0,n.useCallback)(async function(e,t){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e.trim())return void l([]);o(!0);try{let r=await fetch("/api/search?query=".concat(encodeURIComponent(e),"&page=").concat(t));if(r.ok){let e=await r.json();s?l(t=>[...t,...e.results||[]]):l(e.results||[]),g(e.total_pages>t)}}catch(e){}finally{o(!1)}},[]);(0,n.useEffect)(()=>{p(1),g(!0),N(f,1,!1)},[f,N]),(0,n.useEffect)(()=>{if(!d||!b)return;let e=new IntersectionObserver(e=>{let[t]=e;if(t.isIntersecting&&!i&&b){let e=h+1;p(e),N(f,e,!0)}},{threshold:.5});return y.current&&e.observe(y.current),j.current=e,()=>{j.current&&j.current.disconnect()}},[d,b,i,h,f,N]),(0,n.useEffect)(()=>{let e=e=>{w.current&&!w.current.contains(e.target)&&u(!1)},t=e=>{"Escape"===e.key&&u(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[]);let k=(0,n.useCallback)(e=>{let t="movie"===e.media_type?(0,x.GV)(e.id,e.title||"untitled"):(0,x.pK)(e.id,e.name||"untitled");u(!1),o(!0),v.push(t)},[v]),C=(0,n.useCallback)(t=>{t.preventDefault();let s=e.trim();s&&(v.push("/search?query=".concat(encodeURIComponent(s))),u(!1))},[e,v]),S=(0,n.useCallback)(()=>{u(!0),p(1),g(!0),e.trim()?N(e,1,!1):l([])},[e,N]);return(0,r.jsxs)("div",{children:[" ",(0,r.jsx)("div",{className:" relative cursor-pointer p-2.5 sm:p-3 rounded-xl sm:rounded-2xl bg-white/10 backdrop-blur-sm border border-white/20 hover:bg-white/20 hover:border-white/30 hover:scale-105 active:scale-95 transition-all duration-300 shadow-[0_2px_8px_rgba(0,0,0,0.1)] ",onClick:S,"aria-label":"Search",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"w-5 h-5 text-white/80",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M9 3.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11ZM2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Z",clipRule:"evenodd"})})}),d&&(0,r.jsxs)("div",{ref:w,className:"fixed inset-0 bg-black/60 backdrop-blur-md flex flex-col items-center justify-start z-[200] animate-in fade-in duration-300",children:[" ",(0,r.jsxs)("div",{className:" relative w-full max-w-4xl mt-4 sm:mt-8 mx-2 sm:mx-4 bg-black/20 backdrop-blur-xl border border-white/10 rounded-2xl sm:rounded-3xl shadow-[0_8px_32px_rgba(0,0,0,0.4)] animate-in slide-in-from-top-4 duration-500 ",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-blue-500/5 via-purple-500/5 to-pink-500/5"})," ",(0,r.jsxs)("div",{className:"relative flex items-center justify-between p-4 sm:p-6 pb-3 sm:pb-4",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl font-semibold text-white/90",children:"Search Movies & TV Shows"}),(0,r.jsxs)("button",{onClick:()=>u(!1),className:" p-2 rounded-2xl bg-white/10 backdrop-blur-sm border border-white/20 text-white/70 hover:bg-white/20 hover:text-white transition-all duration-300 hover:scale-110 active:scale-95 flex-shrink-0 ","aria-label":"Close search",children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-6 h-6",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M6.225 4.811a.75.75 0 011.06 0L12 9.525l4.715-4.714a.75.75 0 111.06 1.06L13.06 10.586l4.714 4.715a.75.75 0 11-1.06 1.06L12 11.646l-4.715 4.715a.75.75 0 11-1.06-1.06l4.714-4.715-4.714-4.714a.75.75 0 010-1.06z",clipRule:"evenodd"})})," "]})]}),(0,r.jsxs)("div",{className:"relative px-4 sm:px-6 pb-3 sm:pb-4 flex-shrink-0",children:[" ",(0,r.jsx)("form",{onSubmit:C,className:"relative",children:(0,r.jsxs)("div",{className:" relative flex items-center bg-white/10 backdrop-blur-sm border border-white/20 rounded-xl sm:rounded-2xl overflow-hidden focus-within:bg-white/15 focus-within:border-blue-400/50 transition-all duration-300 shadow-[0_4px_16px_rgba(0,0,0,0.2)] ",children:[(0,r.jsx)("div",{className:"pl-4 sm:pl-5 pr-2 sm:pr-3 py-3 sm:py-4",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"w-5 h-5 text-white/60",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M9 3.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11ZM2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Z",clipRule:"evenodd"})})}),(0,r.jsx)("input",{type:"text",value:e,onChange:e=>t(e.target.value),placeholder:"Search for movies, TV shows, anime...",className:" flex-1 py-3 sm:py-4 pr-4 sm:pr-5 bg-transparent text-white text-base sm:text-lg placeholder-white/50 focus:outline-none selection:bg-blue-500/30 ",autoFocus:!0}),e.trim()&&(0,r.jsx)("button",{type:"submit",className:" mr-2 p-2 rounded-xl bg-blue-500/80 backdrop-blur-sm text-white hover:bg-blue-500 transition-all duration-300 hover:scale-105 active:scale-95 shadow-[0_2px_8px_rgba(59,130,246,0.3)] flex-shrink-0 ","aria-label":"Search",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"w-4 h-4",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M9 3.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11ZM2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Z",clipRule:"evenodd"})})})]})})]}),(0,r.jsx)("div",{className:"relative px-4 sm:px-6 pb-4 sm:pb-6 flex-1 min-h-0",children:(0,r.jsxs)("div",{className:" h-full max-h-[50vh] sm:max-h-[60vh] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-white/20 hover:scrollbar-thumb-white/30 space-y-4 ",children:[" ",i&&1===h&&(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"w-12 h-12 border-4 border-white/20 border-t-blue-500 rounded-full animate-spin"}),(0,r.jsx)("div",{className:"absolute inset-0 w-12 h-12 border-4 border-transparent border-r-purple-500 rounded-full animate-spin [animation-direction:reverse] [animation-duration:1.5s]"})]}),(0,r.jsx)("p",{className:"text-white/60 text-sm font-medium",children:"Searching for amazing content..."})]})," ",s.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("p",{className:"text-white/70 text-sm font-medium",children:["Found ",s.length," result",1!==s.length?"s":""]}),(0,r.jsx)("div",{className:"h-px flex-1 ml-4 bg-gradient-to-r from-white/20 to-transparent"})]}),(0,r.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3 sm:gap-4",children:s.map(e=>(0,r.jsx)("div",{className:"group cursor-pointer",onClick:()=>k(e),children:(0,r.jsx)("div",{className:" relative overflow-hidden rounded-xl sm:rounded-2xl bg-gradient-to-br from-white/10 to-white/5 backdrop-blur-sm border border-white/10 transition-all duration-300 ease-out hover:scale-105 hover:bg-white/15 hover:border-white/20 hover:shadow-[0_8px_32px_rgba(0,0,0,0.3)] group-active:scale-95 ",children:(0,r.jsx)(m.A,{item:e,onClick:()=>k(e)})})},"".concat(e.id,"-").concat(e.media_type)))})]})," ",s.length>0&&b&&(0,r.jsx)("div",{ref:y,className:"flex justify-center py-6",children:i&&h>1&&(0,r.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,r.jsx)("div",{className:"w-6 h-6 border-2 border-white/20 border-t-blue-500 rounded-full animate-spin"}),(0,r.jsx)("span",{className:"text-white/60 text-sm",children:"Loading more..."})]})})," ",!i&&""!==e.trim()&&0===s.length&&(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[(0,r.jsx)("div",{className:"w-20 h-20 rounded-full bg-gradient-to-br from-gray-700 to-gray-800 flex items-center justify-center",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-8 h-8 text-white/40",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M10.5 3.75a6.75 6.75 0 1 0 0 13.5 6.75 6.75 0 0 0 0-13.5ZM2.25 10.5a8.25 8.25 0 1 1 14.59 5.28l4.69 4.69a.75.75 0 1 1-1.06 1.06l-4.69-4.69A8.25 8.25 0 0 1 2.25 10.5Z",clipRule:"evenodd"})})}),(0,r.jsxs)("div",{className:"text-center space-y-2",children:[(0,r.jsx)("h3",{className:"text-white/80 text-lg font-semibold",children:"No results found"}),(0,r.jsxs)("p",{className:"text-white/60 text-sm max-w-sm",children:["We couldn't find anything matching \"",e,'". Try different keywords or check your spelling.']})]})]}),s.length>0&&!b&&!i&&(0,r.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,r.jsxs)("div",{className:"flex items-center space-x-3 text-white/50",children:[(0,r.jsx)("div",{className:"h-px w-12 bg-white/20"}),(0,r.jsx)("span",{className:"text-sm",children:"That's everything!"}),(0,r.jsx)("div",{className:"h-px w-12 bg-white/20"})]})})]})})]})]})]})});var h=s(1066),p=s(7340),b=s(8719),g=s(8564),f=s(6618),v=s(7580),w=s(283),j=s(1243),y=s(2657),N=s(8749),k=s(2919),C=s(1264),S=s(1007),A=s(4416);class E{isBlocked(e){let t=Date.now(),s=this.attempts.get(e);return!!s&&(t>s.resetTime?(this.attempts.delete(e),!1):s.count>=this.maxAttempts)}recordAttempt(e){let t=Date.now(),s=this.attempts.get(e);return!s||t>s.resetTime?(this.attempts.set(e,{count:1,resetTime:t+this.windowMs}),!1):(s.count++,s.count>this.maxAttempts)}getResetTime(e){let t=this.attempts.get(e);return t?Math.ceil(Math.max(0,t.resetTime-Date.now())/1e3):0}reset(e){this.attempts.delete(e)}getRemainingAttempts(e){let t=this.attempts.get(e);return!t||Date.now()>t.resetTime?this.maxAttempts:Math.max(0,this.maxAttempts-t.count)}constructor(){this.attempts=new Map,this.maxAttempts=5,this.windowMs=9e5}}let _=e=>e.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?e.length>255?"Email is too long":/{if(!e)return"Password is required";if(e.length<8)return"Password must be at least 8 characters";if(e.length>128)return"Password is too long";let t=/[A-Z]/.test(e),s=/[a-z]/.test(e),r=/\d/.test(e),a=/[!@#$%^&*(),.?":{}|<>]/.test(e);return t&&s&&r&&a?/(.)\1{3,}/.test(e)?"Password cannot have repeated characters":/123456|password|qwerty|admin/i.test(e)?"Password is too common":null:"Password must contain uppercase, lowercase, number, and special character"},z=e=>e?e.length>100?"Name is too long":e.length<2?"Name is too short":/^[a-zA-Z\s'-]+$/.test(e)?/e.trim().replace(/[<>]/g,"").replace(/javascript:/gi,"").replace(/data:/gi,"").replace(/vbscript:/gi,"").slice(0,1e3),D=new E;function P(e){let{isOpen:t,onClose:s}=e,[a,l]=(0,n.useState)("signin"),[i,o]=(0,n.useState)(""),[d,c]=(0,n.useState)(""),[m,x]=(0,n.useState)(""),[u,h]=(0,n.useState)(!1),[p,b]=(0,n.useState)(!1),[g,f]=(0,n.useState)(null),[v,E]=(0,n.useState)({}),[P,R]=(0,n.useState)(!1),[M,F]=(0,n.useState)(0),{signIn:B,signUp:I,resetPassword:V}=(0,w.A)();(0,n.useEffect)(()=>{if(i){let e=D.isBlocked(i);R(e),e&&F(D.getResetTime(i))}},[i]),(0,n.useEffect)(()=>{let e;return P&&M>0&&(e=setInterval(()=>{let e=D.getResetTime(i);F(e),e<=0&&R(!1)},1e3)),()=>clearInterval(e)},[P,M,i]);let U=()=>{o(""),c(""),x(""),f(null),h(!1),E({}),R(!1),F(0)},O=()=>{let e={},t=_(i);if(t&&(e.email=t),"forgot-password"!==a){let t=L(d);t&&(e.password=t)}if("signup"===a&&m){let t=z(m);t&&(e.fullName=t)}return E(e),0===Object.keys(e).length},H=()=>{U(),s()},q=async e=>{if(e.preventDefault(),D.isBlocked(i)){let e=D.getResetTime(i);f({type:"error",text:"Too many failed attempts. Please wait ".concat(Math.ceil(e/60)," minutes before trying again.")}),R(!0),F(e);return}if(!O())return void f({type:"error",text:"Please fix the errors below."});b(!0),f(null);let t=T(i.toLowerCase()),s=m?T(m):void 0;try{if("signin"===a){let{error:e}=await B(t,d);e?(D.recordAttempt(t),f({type:"error",text:e.message})):(D.reset(t),f({type:"success",text:"Successfully signed in!"}),setTimeout(H,1e3))}else if("signup"===a){let{error:e}=await I(t,d,s);e?(D.recordAttempt(t),f({type:"error",text:e.message})):(D.reset(t),f({type:"success",text:"Account created! Please check your email to verify your account."}),setTimeout(()=>l("signin"),2e3))}else if("forgot-password"===a){let{error:e}=await V(t);e?(D.recordAttempt(t),f({type:"error",text:e.message})):(f({type:"success",text:"Password reset email sent! Check your inbox."}),setTimeout(()=>l("signin"),2e3))}}catch(e){f({type:"error",text:"An unexpected error occurred."})}finally{b(!1)}},W=e=>{l(e),f(null),E({})};return t?(0,r.jsxs)("div",{className:"fixed inset-0 z-[200] flex items-center justify-center p-3 sm:p-4 md:p-6 lg:p-8",style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",width:"100vw"},children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-gray-900/95 via-gray-800/90 to-black/98 backdrop-blur-3xl",onClick:H,style:{background:"linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(31, 41, 55, 0.90) 35%, rgba(55, 65, 81, 0.85) 70%, rgba(0, 0, 0, 0.98) 100%)",backdropFilter:"blur(50px) saturate(200%)"}}),(0,r.jsxs)("div",{className:"relative w-full max-w-[320px] sm:max-w-sm md:max-w-md overflow-hidden mx-auto",style:{background:"linear-gradient(145deg, rgba(31, 41, 55, 0.8) 0%, rgba(17, 24, 39, 0.9) 100%)",backdropFilter:"blur(40px) saturate(200%)",border:"1px solid rgba(99, 102, 241, 0.3)",borderRadius:"20px",margin:"0 auto",transform:"translateY(0)",minHeight:"auto",maxHeight:"90vh",overflowY:"auto",boxShadow:"\n 0 32px 64px rgba(0, 0, 0, 0.9),\n 0 16px 32px rgba(99, 102, 241, 0.4),\n 0 8px 16px rgba(147, 51, 234, 0.3),\n inset 0 1px 0 rgba(99, 102, 241, 0.2),\n inset 0 -1px 0 rgba(0, 0, 0, 0.8)\n "},children:[(0,r.jsx)("div",{className:"relative p-4 sm:p-6 border-b border-gray-700/50",style:{background:"linear-gradient(135deg, rgba(55, 65, 81, 0.7) 0%, rgba(31, 41, 55, 0.8) 100%)",backdropFilter:"blur(30px)",borderRadius:"20px 20px 0 0"},children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("h2",{className:"text-lg sm:text-xl md:text-2xl font-bold text-white leading-tight",children:["signin"===a&&"✨ Welcome Back","signup"===a&&"\uD83D\uDE80 Join StreamVibe","forgot-password"===a&&"\uD83D\uDD11 Reset Password"]}),(0,r.jsx)("button",{onClick:H,className:"group relative p-2 sm:p-3 rounded-xl sm:rounded-2xl transition-all duration-300 hover:scale-110",style:{background:"linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(147, 51, 234, 0.2) 100%)",backdropFilter:"blur(10px)",border:"1px solid rgba(99, 102, 241, 0.4)"},children:(0,r.jsx)(A.A,{className:"w-5 h-5 sm:w-6 sm:h-6 text-gray-300 group-hover:text-white transition-colors duration-300"})})]})}),(0,r.jsxs)("form",{onSubmit:q,className:"p-4 sm:p-5 md:p-6 space-y-5 sm:space-y-6",children:["signup"===a&&(0,r.jsxs)("div",{className:"space-y-2 sm:space-y-3",children:[(0,r.jsx)("label",{htmlFor:"fullName",className:"block text-xs sm:text-sm font-bold text-gray-200 tracking-wide",children:"Full Name (Optional)"}),(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsx)("div",{className:"absolute inset-0 rounded-2xl transition-all duration-300 group-hover:scale-105",style:{background:"linear-gradient(135deg, rgba(99, 102, 241, 0.6) 0%, rgba(147, 51, 234, 0.5) 100%)",filter:"blur(8px)",opacity:0}}),(0,r.jsx)(S.A,{className:"absolute left-3 sm:left-3.5 top-1/2 transform -translate-y-1/2 w-4 h-4 sm:w-5 sm:h-5 text-gray-400 group-focus-within:text-blue-400 transition-all duration-300 z-10 pointer-events-none"}),(0,r.jsx)("input",{id:"fullName",type:"text",value:m,onChange:e=>x(e.target.value),className:"relative w-full pl-11 sm:pl-12 pr-4 sm:pr-5 py-3 sm:py-4 text-white placeholder-gray-400 focus:outline-none transition-all duration-300 font-medium text-sm sm:text-base z-0",placeholder:"Enter your full name",style:{background:"linear-gradient(135deg, rgba(31, 41, 55, 0.8) 0%, rgba(17, 24, 39, 0.9) 100%)",backdropFilter:"blur(15px) saturate(150%)",border:"1px solid ".concat(v.fullName?"rgba(239, 68, 68, 0.5)":"rgba(99, 102, 241, 0.3)"),borderRadius:"16px",boxShadow:"inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 8px 32px rgba(99, 102, 241, 0.2)"}})]}),v.fullName&&(0,r.jsxs)("div",{className:"flex items-center mt-2 text-red-400 text-xs font-medium",children:[(0,r.jsx)(j.A,{className:"w-3 h-3 mr-1"}),v.fullName]})]}),(0,r.jsxs)("div",{className:"space-y-2 sm:space-y-3",children:[(0,r.jsx)("label",{htmlFor:"email",className:"block text-xs sm:text-sm font-bold text-gray-200 tracking-wide",children:"Email Address"}),(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsx)("div",{className:"absolute inset-0 rounded-2xl transition-all duration-300 group-hover:scale-105",style:{background:"linear-gradient(135deg, rgba(79, 70, 229, 0.6) 0%, rgba(99, 102, 241, 0.5) 100%)",filter:"blur(8px)",opacity:0}}),(0,r.jsx)(C.A,{className:"absolute left-3 sm:left-3.5 top-1/2 transform -translate-y-1/2 w-4 h-4 sm:w-5 sm:h-5 text-gray-400 group-focus-within:text-blue-400 transition-all duration-300 z-10 pointer-events-none"}),(0,r.jsx)("input",{id:"email",type:"email",value:i,onChange:e=>o(e.target.value),required:!0,className:"relative w-full pl-11 sm:pl-12 pr-4 sm:pr-5 py-3 sm:py-4 text-white placeholder-gray-400 focus:outline-none transition-all duration-300 font-medium text-sm sm:text-base z-0",placeholder:"Enter your email",style:{background:"linear-gradient(135deg, rgba(31, 41, 55, 0.8) 0%, rgba(17, 24, 39, 0.9) 100%)",backdropFilter:"blur(15px) saturate(150%)",border:"1px solid ".concat(v.email?"rgba(239, 68, 68, 0.5)":"rgba(99, 102, 241, 0.3)"),borderRadius:"16px",boxShadow:"inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 8px 32px rgba(79, 70, 229, 0.2)"}})]}),v.email&&(0,r.jsxs)("div",{className:"flex items-center mt-2 text-red-400 text-xs font-medium",children:[(0,r.jsx)(j.A,{className:"w-3 h-3 mr-1"}),v.email]}),P&&(0,r.jsxs)("div",{className:"flex items-center mt-2 text-orange-400 text-xs font-medium",children:[(0,r.jsx)(j.A,{className:"w-3 h-3 mr-1"}),"Account temporarily locked. Try again in ",Math.ceil(M/60)," minutes."]})]}),"forgot-password"!==a&&(0,r.jsxs)("div",{className:"space-y-2 sm:space-y-3",children:[(0,r.jsx)("label",{htmlFor:"password",className:"block text-xs sm:text-sm font-bold text-gray-200 tracking-wide",children:"Password"}),(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsx)("div",{className:"absolute inset-0 rounded-2xl transition-all duration-300 group-hover:scale-105",style:{background:"linear-gradient(135deg, rgba(147, 51, 234, 0.6) 0%, rgba(99, 102, 241, 0.5) 100%)",filter:"blur(8px)",opacity:0}}),(0,r.jsx)(k.A,{className:"absolute left-3 sm:left-3.5 top-1/2 transform -translate-y-1/2 w-4 h-4 sm:w-5 sm:h-5 text-gray-400 group-focus-within:text-blue-400 transition-all duration-300 z-10 pointer-events-none"}),(0,r.jsx)("input",{id:"password",type:u?"text":"password",value:d,onChange:e=>c(e.target.value),required:!0,minLength:6,className:"relative w-full pl-11 sm:pl-12 pr-12 sm:pr-14 py-3 sm:py-4 text-white placeholder-gray-400 focus:outline-none transition-all duration-300 font-medium text-sm sm:text-base z-0",placeholder:"Enter your password",style:{background:"linear-gradient(135deg, rgba(31, 41, 55, 0.8) 0%, rgba(17, 24, 39, 0.9) 100%)",backdropFilter:"blur(15px) saturate(150%)",border:"1px solid ".concat(v.password?"rgba(239, 68, 68, 0.5)":"rgba(99, 102, 241, 0.3)"),borderRadius:"16px",boxShadow:"inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 8px 32px rgba(147, 51, 234, 0.2)"}}),(0,r.jsx)("button",{type:"button",onClick:()=>h(!u),className:"absolute right-2.5 sm:right-3 top-1/2 transform -translate-y-1/2 p-1 sm:p-1.5 rounded-lg transition-all duration-300 hover:scale-110 z-10",style:{background:"linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(147, 51, 234, 0.2) 100%)",backdropFilter:"blur(10px)"},children:u?(0,r.jsx)(N.A,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-gray-400 hover:text-white transition-colors duration-300"}):(0,r.jsx)(y.A,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-gray-400 hover:text-white transition-colors duration-300"})})]}),v.password&&(0,r.jsxs)("div",{className:"flex items-center mt-2 text-red-400 text-xs font-medium",children:[(0,r.jsx)(j.A,{className:"w-3 h-3 mr-1"}),v.password]}),"signup"===a&&!v.password&&(0,r.jsx)("p",{className:"text-xs text-gray-400 mt-2 sm:mt-3 font-medium tracking-wide",children:"\uD83D\uDD12 Password must be at least 8 characters with uppercase, lowercase, number, and special character"})]}),g&&(0,r.jsxs)("div",{className:"p-3 sm:p-4 rounded-xl text-xs font-bold backdrop-blur-xl border transition-all duration-500 ".concat("success"===g.type?"text-green-100 border-green-400/40":"text-red-100 border-red-400/40"),style:{background:"success"===g.type?"linear-gradient(135deg, rgba(34, 197, 94, 0.8) 0%, rgba(22, 163, 74, 0.7) 100%)":"linear-gradient(135deg, rgba(239, 68, 68, 0.8) 0%, rgba(220, 38, 38, 0.7) 100%)",backdropFilter:"blur(20px) saturate(200%)",boxShadow:"success"===g.type?"0 8px 32px rgba(34, 197, 94, 0.4)":"0 8px 32px rgba(239, 68, 68, 0.4)"},children:["success"===g.type?"✅ ":"❌ ",g.text]}),(0,r.jsxs)("button",{type:"submit",disabled:p||P,className:"group relative w-full py-3 sm:py-4 md:py-5 font-bold text-sm sm:text-base transition-all duration-500 disabled:cursor-not-allowed disabled:opacity-50 overflow-hidden",style:{background:p||P?"linear-gradient(135deg, rgba(107, 114, 128, 0.8) 0%, rgba(75, 85, 99, 0.8) 100%)":"linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #9333ea 100%)",borderRadius:"14px",border:"1px solid rgba(99, 102, 241, 0.6)",boxShadow:"0 16px 40px rgba(99, 102, 241, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2)"},children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-white/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),p?(0,r.jsxs)("div",{className:"flex items-center justify-center text-white",children:[(0,r.jsx)("div",{className:"w-4 h-4 sm:w-5 sm:h-5 border-2 border-white/30 border-t-white rounded-full animate-spin mr-2 sm:mr-3"}),(0,r.jsx)("span",{className:"font-bold tracking-wide text-xs sm:text-sm",children:"✨ Processing..."})]}):P?(0,r.jsxs)("span",{className:"relative text-white font-bold tracking-wide text-xs sm:text-sm",children:["\uD83D\uDD12 Account Locked - ",Math.ceil(M/60)," min remaining"]}):(0,r.jsxs)("span",{className:"relative text-white font-bold tracking-wide text-xs sm:text-sm",children:["signin"===a&&"\uD83D\uDE80 Sign In to Your Account","signup"===a&&"✨ Create Your Account","forgot-password"===a&&"\uD83D\uDCE7 Send Reset Email"]})]}),(0,r.jsxs)("div",{className:"space-y-2 sm:space-y-3 text-center",children:["signin"===a&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",onClick:()=>W("forgot-password"),className:"text-gray-300 hover:text-white transition-all duration-300 font-semibold hover:underline text-xs tracking-wide",children:"\uD83D\uDD11 Forgot your password?"}),(0,r.jsxs)("div",{className:"text-gray-300 font-medium text-xs sm:text-sm",children:["Don't have an account?"," ",(0,r.jsx)("button",{type:"button",onClick:()=>W("signup"),className:"text-blue-400 hover:text-blue-300 transition-all duration-300 font-bold hover:underline",children:"Sign up here ✨"})]})]}),"signup"===a&&(0,r.jsxs)("div",{className:"text-gray-300 font-medium text-xs sm:text-sm",children:["Already have an account?"," ",(0,r.jsx)("button",{type:"button",onClick:()=>W("signin"),className:"text-blue-400 hover:text-blue-300 transition-all duration-300 font-bold hover:underline",children:"Sign in here \uD83D\uDE80"})]}),"forgot-password"===a&&(0,r.jsxs)("div",{className:"text-gray-300 font-medium text-xs sm:text-sm",children:["Remember your password?"," ",(0,r.jsx)("button",{type:"button",onClick:()=>W("signin"),className:"text-blue-400 hover:text-blue-300 transition-all duration-300 font-bold hover:underline",children:"Sign in here \uD83D\uDD19"})]})]})]})]})]}):null}var R=s(4835);function M(e){var t,s,a,l;let{isOpen:i,onClose:o}=e,{user:d,signOut:c}=(0,w.A)(),[m,x]=(0,n.useState)(!1),u=(0,n.useRef)(null),h=async()=>{x(!0);let{error:e}=await c();e||o(),x(!1)};return i&&d?(0,r.jsxs)("div",{className:"fixed inset-0 z-[200] flex items-center justify-center p-3 sm:p-4 md:p-6 lg:p-8",style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",width:"100vw"},children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-gray-900/95 via-gray-800/90 to-black/98 backdrop-blur-3xl",onClick:o,style:{background:"linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(31, 41, 55, 0.90) 35%, rgba(55, 65, 81, 0.85) 70%, rgba(0, 0, 0, 0.98) 100%)",backdropFilter:"blur(50px) saturate(200%)"}}),(0,r.jsxs)("div",{ref:u,className:"relative w-full max-w-[320px] sm:max-w-sm md:max-w-md overflow-hidden mx-auto",style:{background:"linear-gradient(145deg, rgba(31, 41, 55, 0.8) 0%, rgba(17, 24, 39, 0.9) 100%)",backdropFilter:"blur(40px) saturate(200%)",border:"1px solid rgba(99, 102, 241, 0.3)",borderRadius:"20px",margin:"0 auto",transform:"translateY(0)",minHeight:"auto",maxHeight:"90vh",overflowY:"auto",boxShadow:"\n 0 32px 64px rgba(0, 0, 0, 0.9),\n 0 16px 32px rgba(99, 102, 241, 0.4),\n 0 8px 16px rgba(147, 51, 234, 0.3),\n inset 0 1px 0 rgba(99, 102, 241, 0.2),\n inset 0 -1px 0 rgba(0, 0, 0, 0.8)\n "},children:[(0,r.jsx)("div",{className:"relative p-4 sm:p-6 border-b border-gray-700/50",style:{background:"linear-gradient(135deg, rgba(55, 65, 81, 0.7) 0%, rgba(31, 41, 55, 0.8) 100%)",backdropFilter:"blur(30px)",borderRadius:"20px 20px 0 0"},children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl md:text-2xl font-bold text-white leading-tight",children:"\uD83D\uDC64 Profile"}),(0,r.jsx)("button",{onClick:o,className:"group relative p-2 sm:p-3 rounded-xl sm:rounded-2xl transition-all duration-300 hover:scale-110",style:{background:"linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(147, 51, 234, 0.2) 100%)",backdropFilter:"blur(10px)",border:"1px solid rgba(99, 102, 241, 0.4)"},children:(0,r.jsx)(A.A,{className:"w-5 h-5 sm:w-6 sm:h-6 text-gray-300 group-hover:text-white transition-colors duration-300"})})]})}),(0,r.jsxs)("div",{className:"p-4 sm:p-5 md:p-6",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-4 mb-6 p-4 sm:p-5 rounded-xl sm:rounded-2xl",style:{background:"linear-gradient(135deg, rgba(55, 65, 81, 0.6) 0%, rgba(31, 41, 55, 0.7) 100%)",backdropFilter:"blur(20px) saturate(150%)",border:"1px solid rgba(99, 102, 241, 0.2)",boxShadow:"inset 0 1px 0 rgba(99, 102, 241, 0.1), 0 8px 32px rgba(0, 0, 0, 0.3)"},children:[(0,r.jsxs)("div",{className:"w-16 h-16 sm:w-20 sm:h-20 rounded-full flex items-center justify-center text-white font-semibold text-lg sm:text-xl relative",style:{background:"linear-gradient(135deg, rgba(99, 102, 241, 0.8) 0%, rgba(147, 51, 234, 0.8) 50%, rgba(59, 130, 246, 0.8) 100%)",backdropFilter:"blur(20px)",border:"2px solid rgba(99, 102, 241, 0.5)",boxShadow:"\n 0 8px 32px rgba(99, 102, 241, 0.4),\n 0 4px 16px rgba(147, 51, 234, 0.3),\n inset 0 1px 0 rgba(255, 255, 255, 0.2)\n "},children:[(a=null==(t=d.user_metadata)?void 0:t.full_name,l=d.email,a?a.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):l.slice(0,2).toUpperCase()),(0,r.jsx)("div",{className:"absolute -bottom-1 -right-1 w-4 h-4 sm:w-5 sm:h-5 rounded-full border-2 border-gray-800",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",boxShadow:"0 2px 8px rgba(16, 185, 129, 0.4)"}})]}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"text-base sm:text-lg font-semibold text-white mb-1",children:(null==(s=d.user_metadata)?void 0:s.full_name)||"User"}),(0,r.jsx)("p",{className:"text-gray-300 text-sm mb-1",children:d.email}),(0,r.jsxs)("p",{className:"text-gray-400 text-xs",children:["✨ Member since ",new Date(d.created_at).toLocaleDateString()]})]})]}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("button",{onClick:()=>{o(),window.location.href="/library"},className:"w-full flex items-center space-x-3 p-3 sm:p-4 rounded-xl sm:rounded-2xl transition-all duration-300 hover:scale-[1.02] text-left group",style:{background:"linear-gradient(135deg, rgba(55, 65, 81, 0.5) 0%, rgba(31, 41, 55, 0.6) 100%)",backdropFilter:"blur(20px) saturate(150%)",border:"1px solid rgba(99, 102, 241, 0.2)",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05)"},children:[(0,r.jsx)("div",{className:"p-2 rounded-lg group-hover:scale-110 transition-transform duration-200",style:{background:"linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(147, 51, 234, 0.2) 100%)"},children:(0,r.jsx)(b.A,{className:"w-4 h-4 sm:w-5 sm:h-5 text-blue-300"})}),(0,r.jsx)("span",{className:"text-white font-medium",children:"My Library"})]}),(0,r.jsxs)("button",{onClick:()=>{o(),window.location.href="/parties"},className:"w-full flex items-center space-x-3 p-3 sm:p-4 rounded-xl sm:rounded-2xl transition-all duration-300 hover:scale-[1.02] text-left group",style:{background:"linear-gradient(135deg, rgba(55, 65, 81, 0.5) 0%, rgba(31, 41, 55, 0.6) 100%)",backdropFilter:"blur(20px) saturate(150%)",border:"1px solid rgba(99, 102, 241, 0.2)",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05)"},children:[(0,r.jsx)("div",{className:"p-2 rounded-lg group-hover:scale-110 transition-transform duration-200",style:{background:"linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(147, 51, 234, 0.2) 100%)"},children:(0,r.jsx)(v.A,{className:"w-4 h-4 sm:w-5 sm:h-5 text-purple-300"})}),(0,r.jsx)("span",{className:"text-white font-medium",children:"My Parties"})]}),(0,r.jsxs)("button",{onClick:h,disabled:m,className:"w-full flex items-center space-x-3 p-3 sm:p-4 rounded-xl sm:rounded-2xl transition-all duration-300 hover:scale-[1.02] text-left group disabled:opacity-50 disabled:cursor-not-allowed",style:{background:m?"linear-gradient(135deg, rgba(55, 65, 81, 0.5) 0%, rgba(31, 41, 55, 0.6) 100%)":"linear-gradient(135deg, rgba(220, 38, 38, 0.2) 0%, rgba(153, 27, 27, 0.3) 100%)",backdropFilter:"blur(20px) saturate(150%)",border:"1px solid ".concat(m?"rgba(99, 102, 241, 0.2)":"rgba(220, 38, 38, 0.4)"),boxShadow:m?"0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05)":"0 8px 32px rgba(220, 38, 38, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05)"},children:[(0,r.jsx)("div",{className:"p-2 rounded-lg group-hover:scale-110 transition-transform duration-200",style:{background:m?"linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(147, 51, 234, 0.2) 100%)":"linear-gradient(135deg, rgba(220, 38, 38, 0.4) 0%, rgba(153, 27, 27, 0.3) 100%)"},children:m?(0,r.jsx)("div",{className:"w-4 h-4 sm:w-5 sm:h-5 border-2 border-gray-300 border-t-transparent rounded-full animate-spin"}):(0,r.jsx)(R.A,{className:"w-4 h-4 sm:w-5 sm:h-5 text-red-300"})}),(0,r.jsx)("span",{className:"font-medium ".concat(m?"text-white":"text-red-300"),children:m?"\uD83D\uDD04 Signing out...":"Sign Out"})]})]})]})]})]}):null}var F=s(3226);let B=()=>{let{user:e}=(0,w.A)(),{getUserParties:t}=(0,F.x)(),[s,r]=(0,n.useState)(0),[a,l]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{(async()=>{if(!e)return r(0);try{l(!0);let e=await t();r(e.length)}catch(e){r(0)}finally{l(!1)}})()},[e,t]),{count:s,loading:a}},I=e=>{let{href:t,icon:s,label:a,isActive:l,onClick:i}=e;return(0,r.jsxs)(d(),{href:t,className:"relative group flex items-center space-x-1 px-2 py-1 ".concat(l?"text-white":"text-gray-300"," hover:text-white transition-colors duration-300"),onClick:i,children:[s,(0,r.jsx)("span",{className:"font-medium",children:a}),(0,r.jsx)("div",{className:"absolute -bottom-1 left-0 h-0.5 bg-white transition-all duration-300 ".concat(l?"w-full":"w-0 group-hover:w-full")})]})},V=()=>{var e,t,s;let[l,i]=(0,n.useState)(!1),o=(0,a.usePathname)(),[c,m]=(0,n.useState)(""),[x,j]=(0,n.useState)(!0),y=(0,n.useRef)(0),N=(0,n.useRef)(!1),[k,C]=(0,n.useState)(!1),[S,A]=(0,n.useState)(!1),{user:E,loading:_}=(0,w.A)(),{count:L}=B();(0,n.useEffect)(()=>{let e=()=>{let e=window.scrollY;e>y.current&&e>50&&!l?j(!1):j(!0),y.current=e,N.current=!1},t=()=>{N.current||(window.requestAnimationFrame(()=>{e()}),N.current=!0)};return window.addEventListener("scroll",t),()=>{window.removeEventListener("scroll",t)}},[l]),(0,n.useEffect)(()=>{m(o)},[o]);let z=e=>c===e||c.startsWith(e+"/"),T=(e,t)=>e?e.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):t.slice(0,2).toUpperCase(),D=()=>{E?A(!0):C(!0)};return(0,r.jsxs)("header",{className:"fixed left-0 right-0 z-[100] transition-all duration-300 ease-in-out ".concat(x?"translate-y-0 top-[var(--surfshark-banner-height-mobile)] md:top-[var(--surfshark-banner-height-desktop)] bg-gray-900/80 backdrop-blur-md shadow-lg":"-translate-y-full top-0 bg-transparent"),children:[(0,r.jsxs)("div",{className:"md:hidden flex items-center justify-between px-4",style:{height:"var(--header-height-mobile)"},children:[" "," ",(0,r.jsx)(d(),{href:"/",className:"relative group flex items-center",children:(0,r.jsx)("img",{src:"/images/LOGO.png",alt:"BoredFlix Logo",className:"h-6 w-auto"})}),(0,r.jsx)("div",{className:"flex-grow"}),(0,r.jsxs)("div",{className:"flex items-center space-x-3",children:[" ",(0,r.jsxs)("a",{href:"https://discord.gg/VHDedCcbGY",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center w-14 h-14 transition-all duration-300 opacity-80 hover:opacity-100",title:"Join our Discord",children:[" ",(0,r.jsx)("img",{src:"/images/discord.png",alt:"Join Discord",className:"w-14 h-14"})]}),_?(0,r.jsx)("div",{className:"px-3 py-1 bg-gray-200 text-gray-500 rounded-md text-sm",children:"Loading..."}):E?(0,r.jsx)("button",{className:"w-8 h-8 bg-blue-600 text-white rounded-full text-xs font-semibold hover:bg-blue-700 transition-colors",onClick:D,children:T(null==(e=E.user_metadata)?void 0:e.full_name,E.email)}):(0,r.jsx)("button",{className:"px-3 py-1 bg-white text-black rounded-md transition-colors duration-300 font-medium text-sm shadow-md hover:shadow-lg",onClick:D,children:(0,r.jsx)("span",{children:"Sign In"})})]})]}),(0,r.jsxs)("div",{className:"hidden md:flex items-center justify-between px-4 transition-all duration-300 ease-in-out",style:{height:"var(--header-height-desktop)"},children:[" ",(0,r.jsxs)(d(),{href:"/",className:"relative group flex items-center",onClick:()=>m("/"),children:[(0,r.jsx)("img",{src:"/images/LOGO.png",alt:"BoredFlix Logo",className:"h-7 w-auto"}),(0,r.jsx)("div",{className:"absolute -bottom-1 left-0 w-0 h-0.5 bg-white group-hover:w-full transition-all duration-300"})]}),(0,r.jsxs)("div",{className:"flex space-x-6 items-center",children:[(0,r.jsx)(I,{href:"/",icon:(0,r.jsx)(p.A,{size:18}),label:"Home",isActive:z("/"),onClick:()=>m("/")}),(0,r.jsx)(I,{href:"/browse/movies",icon:(0,r.jsx)(h.A,{size:18}),label:"Movies",isActive:z("/browse/movies"),onClick:()=>m("/browse/movies")})," ",(0,r.jsx)(I,{href:"/browse/tv",icon:(0,r.jsx)(f.A,{size:18}),label:"TV Shows",isActive:z("/browse/tv"),onClick:()=>m("/browse/tv")}),(0,r.jsx)(I,{href:"/browse/anime",icon:(0,r.jsx)(g.A,{size:18}),label:"Anime",isActive:z("/browse/anime"),onClick:()=>m("/browse/anime")}),(0,r.jsx)(I,{href:"/parties",icon:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(v.A,{size:18}),L>0&&(0,r.jsx)("div",{className:"absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full min-w-[16px] h-4 flex items-center justify-center font-bold",children:(0,r.jsx)("span",{className:"text-[10px]",children:L>9?"9+":L})})]}),label:"Parties",isActive:z("/parties"),onClick:()=>m("/parties")}),(0,r.jsx)(I,{href:"/library",icon:(0,r.jsx)(b.A,{size:18}),label:"My Library",isActive:z("/library"),onClick:()=>m("/library")})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsx)(u,{})," ",(0,r.jsxs)("a",{href:"https://discord.gg/VHDedCcbGY",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center w-16 h-16 hover:bg-gray-800 rounded-lg transition-all duration-300 opacity-80 hover:opacity-100",title:"Join our Discord",children:[" ",(0,r.jsx)("img",{src:"/images/discord.png",alt:"Join Discord",className:"w-12 h-12"})]}),_?(0,r.jsx)("div",{className:"flex items-center px-4 py-2 bg-gray-200 text-gray-500 rounded-md font-medium",children:"Loading..."}):E?(0,r.jsxs)("button",{className:"group flex items-center space-x-3 px-4 py-2.5 bg-gradient-to-r from-gray-800/80 to-gray-900/80 hover:from-gray-700/90 hover:to-gray-800/90 backdrop-blur-md border border-gray-600/30 hover:border-gray-500/50 text-white rounded-xl transition-all duration-300 font-medium shadow-lg hover:shadow-xl hover:shadow-black/20",onClick:D,children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"w-9 h-9 bg-gradient-to-br from-blue-500/80 to-purple-600/80 text-white rounded-lg text-sm font-semibold flex items-center justify-center shadow-md group-hover:shadow-lg transition-all duration-300 group-hover:scale-105",children:T(null==(t=E.user_metadata)?void 0:t.full_name,E.email)}),(0,r.jsx)("div",{className:"absolute -top-0.5 -right-0.5 w-3 h-3 bg-green-400 border-2 border-gray-900 rounded-full opacity-90"})]})," ",(0,r.jsx)("div",{className:"hidden lg:flex flex-col items-start",children:(0,r.jsx)("span",{className:"text-sm font-medium text-white leading-tight",children:(null==(s=E.user_metadata)?void 0:s.full_name)||"Profile"})}),(0,r.jsx)("svg",{className:"w-4 h-4 text-gray-400 group-hover:text-gray-300 transition-colors duration-300 hidden lg:block",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}):(0,r.jsxs)("button",{className:"group flex items-center space-x-2 px-6 py-2.5 bg-gradient-to-r from-white/90 to-gray-100/90 hover:from-white hover:to-gray-50 text-gray-900 rounded-xl transition-all duration-300 font-semibold shadow-lg hover:shadow-xl hover:shadow-black/10 backdrop-blur-sm border border-white/20",onClick:D,children:[(0,r.jsx)("svg",{className:"w-4 h-4 text-gray-700 group-hover:text-gray-900 transition-colors duration-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),(0,r.jsx)("span",{className:"text-sm",children:"Sign In"})]})]})]}),(0,r.jsx)(P,{isOpen:k,onClose:()=>C(!1)}),(0,r.jsx)(M,{isOpen:S,onClose:()=>A(!1)})]})};var U=s(7924);let O="hideBottomNav",H="showBottomNav",q=()=>{let[e,t]=(0,n.useState)("/"),[s,l]=(0,n.useState)(!1),[i,o]=(0,n.useState)(""),[u,v]=(0,n.useState)([]),[w,j]=(0,n.useState)(!1),[y,N]=(0,n.useState)(1),[k,C]=(0,n.useState)(!0),[S,E]=(0,n.useState)(!0),_=(0,c.A)(i,300),L=(0,a.useRouter)(),z=(0,n.useRef)(null);(0,n.useEffect)(()=>{let e=()=>{E(!1)},t=()=>{E(!0)};return window.addEventListener(O,e),window.addEventListener(H,t),()=>{window.removeEventListener(O,e),window.removeEventListener(H,t)}},[]),(0,n.useEffect)(()=>{t(window.location.pathname)},[]);let T=t=>e===t||e.startsWith(t+"/"),D=(0,n.useCallback)(async function(e,t){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e.trim())return void v([]);j(!0);try{let r=await fetch("/api/search?query=".concat(encodeURIComponent(e),"&page=").concat(t));if(r.ok){let e=await r.json();s?v(t=>[...t,...e.results||[]]):v(e.results||[]),C(e.total_pages>t)}}catch(e){}finally{j(!1)}},[]);(0,n.useEffect)(()=>{_.trim()?(N(1),C(!0),D(_,1,!1)):(v([]),C(!0),N(1))},[_,D]),(0,n.useEffect)(()=>{let e=e=>{z.current&&!z.current.contains(e.target)&&l(!1)},t=e=>{"Escape"===e.key&&l(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[]);let P=e=>{let t="movie"===e.media_type?(0,x.GV)(e.id,e.title||"untitled"):(0,x.pK)(e.id,e.name||"untitled");l(!1),L.push(t)},R=()=>{l(!0)},M=s=>{let{href:a,icon:l,label:i,isSearchButton:n=!1}=s,o=!!a&&T(a),c=(0,r.jsxs)("div",{className:"\n relative flex flex-col items-center justify-center h-12 w-11 rounded-2xl\n transition-all duration-300 ease-out\n ".concat(o?"bg-blue-500/20 backdrop-blur-md shadow-lg":"hover:bg-white/10 hover:shadow-md","\n "),children:[o&&(0,r.jsx)("div",{className:"absolute -top-1 w-1 h-1 bg-blue-500 rounded-full animate-pulse z-10"}),(0,r.jsx)("div",{className:"\n transition-all duration-300 relative z-20\n ".concat(o?"text-blue-400":"text-gray-400 group-hover:text-white","\n "),children:l}),(0,r.jsx)("span",{className:"\n text-[10px] font-medium mt-1 whitespace-nowrap relative z-20\n ".concat(o?"text-blue-400 font-semibold":"text-gray-500 group-hover:text-gray-300","\n "),children:i})]});return n?(0,r.jsx)("button",{onClick:R,className:"group relative transition-transform duration-200 active:scale-95",children:c}):(0,r.jsx)(d(),{href:a,onClick:()=>{e!==a&&t(a)},className:"group relative transition-transform duration-200 active:scale-95",children:c})};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"md:hidden fixed bottom-0 left-0 right-0 z-[51] p-2 transition-all duration-300 ".concat(S?"translate-y-0":"translate-y-full opacity-0"),children:[" ",(0,r.jsxs)("div",{className:" mx-3 mb-2 rounded-3xl bg-black/40 backdrop-blur-xl border border-white/10 shadow-[0_8px_32px_rgba(0,0,0,0.4)] relative overflow-hidden px-2 py-3 ",children:[" ",(0,r.jsxs)("div",{className:"flex justify-evenly items-center w-full",children:[(0,r.jsx)(M,{href:"/",icon:(0,r.jsx)(p.A,{size:20}),label:"Home"}),(0,r.jsx)(M,{href:"/browse/movies",icon:(0,r.jsx)(h.A,{size:20}),label:"Movies"}),(0,r.jsx)(M,{href:"/browse/tv",icon:(0,r.jsx)(f.A,{size:20}),label:"TV"}),(0,r.jsx)(M,{href:"/browse/anime",icon:(0,r.jsx)(g.A,{size:20}),label:"Anime"}),(0,r.jsx)(M,{href:"/library",icon:(0,r.jsx)(b.A,{size:20}),label:"Library"}),(0,r.jsx)(M,{icon:(0,r.jsx)(U.A,{size:20}),label:"Search",isSearchButton:!0})]}),(0,r.jsx)("div",{className:"absolute bottom-0 left-1/2 transform -translate-x-1/2 w-12 h-1 bg-gradient-to-r from-blue-500 to-purple-500 rounded-full opacity-30"})]})]}),s&&(0,r.jsx)("div",{ref:z,className:"fixed inset-0 bg-black/80 backdrop-blur-md flex flex-col items-center justify-start z-[60] animate-in fade-in duration-300",children:(0,r.jsxs)("div",{className:" bg-gray-900/90 backdrop-blur-xl rounded-2xl shadow-2xl p-6 pt-8 w-[calc(100%-2rem)] max-w-3xl mt-10 border border-white/10 relative overflow-hidden animate-in slide-in-from-top-4 duration-500 ",children:[(0,r.jsx)("button",{onClick:()=>l(!1),className:" absolute top-0 right-0 w-10 h-10 rounded-bl-2xl bg-black/50 hover:bg-black/70 text-gray-400 hover:text-white transition-all duration-300 flex items-center justify-center backdrop-blur-sm hover:scale-105 z-50 shadow-lg border-b border-l border-white/10 ","aria-label":"Close",children:(0,r.jsx)(A.A,{size:20})}),(0,r.jsx)("form",{onSubmit:e=>{e.preventDefault();let t=i.trim();t&&(L.push("/search?query=".concat(encodeURIComponent(t))),l(!1))},className:"relative z-20 mt-2",children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:"text",value:i,onChange:e=>o(e.target.value),placeholder:"Search movies & TV shows...",className:" w-full px-6 py-4 pr-14 rounded-2xl bg-white/10 backdrop-blur-sm border border-white/20 text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:bg-white/15 focus:border-blue-500/50 text-lg transition-all duration-300 shadow-inner z-20 ",autoFocus:!0}),(0,r.jsx)("button",{type:"submit","aria-label":"Search",className:" absolute right-4 top-1/2 -translate-y-1/2 w-8 h-8 rounded-xl bg-gradient-to-br from-blue-500 to-purple-600 text-white hover:shadow-lg hover:shadow-blue-500/25 transition-all duration-300 hover:scale-110 flex items-center justify-center ",children:(0,r.jsx)(U.A,{size:18})})]})}),(0,r.jsxs)("div",{className:"mt-10 max-h-[60vh] overflow-y-auto overflow-x-hidden scrollbar-thin scrollbar-thumb-white/20 scrollbar-track-transparent pt-4",children:[w&&1===y&&(0,r.jsx)("div",{className:"flex justify-center py-8",children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"w-8 h-8 border-2 border-blue-500/30 rounded-full animate-spin"}),(0,r.jsx)("div",{className:"absolute inset-0 w-8 h-8 border-2 border-transparent border-t-blue-500 rounded-full animate-spin"})]})}),u.length>0&&(0,r.jsx)("div",{className:"grid grid-cols-2 gap-4 w-full",children:u.map(e=>(0,r.jsx)("div",{className:"transform transition-all duration-300 hover:scale-105",children:(0,r.jsx)(m.A,{item:e,onClick:()=>P(e)})},"".concat(e.id,"-").concat(e.media_type)))}),!w&&""!==i.trim()&&0===u.length&&(0,r.jsxs)("div",{className:"text-center py-12",children:[(0,r.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-gradient-to-br from-gray-700 to-gray-800 flex items-center justify-center",children:(0,r.jsx)(U.A,{size:24,className:"text-gray-400"})}),(0,r.jsx)("p",{className:"text-white text-lg font-medium",children:"No results found"}),(0,r.jsx)("p",{className:"text-gray-400 mt-2",children:"Try different keywords or check spelling"})]}),u.length>0&&!k&&!w&&(0,r.jsxs)("div",{className:"text-center py-6 text-gray-500 text-sm",children:[(0,r.jsx)("div",{className:"w-full h-px bg-gradient-to-r from-transparent via-gray-600 to-transparent mb-3"}),"End of results"]})]})]})})]})},W=()=>{let e=new Date().getFullYear();return(0,r.jsxs)("footer",{children:[(0,r.jsx)(q,{})," ",(0,r.jsx)("div",{className:"bg-gradient-to-r from-gray-900 via-black to-gray-900 border-t border-gray-700/50 md:mb-0 mb-[var(--bottom-nav-height)]",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-6 md:py-8",children:[" ",(0,r.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 lg:grid-cols-4 gap-8 md:gap-12 mb-6 md:mb-8",children:[(0,r.jsxs)("div",{className:"sm:col-span-1 lg:col-span-2",children:[(0,r.jsx)("h3",{className:"text-lg md:text-xl font-bold text-white mb-2 md:mb-3 bg-gradient-to-r from-blue-400 to-purple-500 bg-clip-text text-transparent",children:"Boredflix"}),(0,r.jsx)("p",{className:"text-gray-400 text-xs md:text-sm leading-relaxed",children:"Your ultimate destination for discovering movies and TV shows. Stream, explore, and enjoy endless entertainment."})]}),(0,r.jsxs)("div",{className:"sm:col-span-1 lg:col-span-1",children:[(0,r.jsx)("h4",{className:"text-white font-semibold mb-2 md:mb-3 text-sm md:text-base",children:"Browse"}),(0,r.jsxs)("ul",{className:"space-y-1 md:space-y-2 text-xs md:text-sm",children:[(0,r.jsx)("li",{children:(0,r.jsx)(d(),{href:"/browse/movies",className:"text-gray-400 hover:text-blue-400 transition-colors",children:"Movies"})}),(0,r.jsx)("li",{children:(0,r.jsx)(d(),{href:"/browse/tv",className:"text-gray-400 hover:text-blue-400 transition-colors",children:"TV Shows"})}),(0,r.jsx)("li",{children:(0,r.jsx)(d(),{href:"/browse/anime",className:"text-gray-400 hover:text-blue-400 transition-colors",children:"Anime"})}),(0,r.jsx)("li",{children:(0,r.jsx)(d(),{href:"/library",className:"text-gray-400 hover:text-blue-400 transition-colors",children:"My Library"})}),(0,r.jsx)("li",{children:(0,r.jsx)(d(),{href:"/search",className:"text-gray-400 hover:text-blue-400 transition-colors",children:"Search"})})]})]}),(0,r.jsxs)("div",{className:"sm:col-span-1 lg:col-span-1",children:[(0,r.jsx)("h4",{className:"text-white font-semibold mb-2 md:mb-3 text-sm md:text-base",children:"Information"}),(0,r.jsxs)("ul",{className:"space-y-1 md:space-y-2 text-xs md:text-sm",children:[(0,r.jsx)("li",{children:(0,r.jsx)(d(),{href:"/privacy",className:"text-gray-400 hover:text-blue-400 transition-colors",children:"Privacy Policy"})}),(0,r.jsx)("li",{children:(0,r.jsx)(d(),{href:"/terms",className:"text-gray-400 hover:text-blue-400 transition-colors",children:"Terms of Service"})}),(0,r.jsx)("li",{children:(0,r.jsx)(d(),{href:"/contact",className:"text-gray-400 hover:text-blue-400 transition-colors",children:"Contact Us"})}),(0,r.jsx)("li",{children:(0,r.jsx)(d(),{href:"/about",className:"text-gray-400 hover:text-blue-400 transition-colors",children:"About"})})]})]})]}),(0,r.jsx)("div",{className:"border-t border-gray-700/50 pt-4 md:pt-6 mb-4 md:mb-6",children:(0,r.jsxs)("div",{className:"bg-gray-800/50 rounded-lg p-3 md:p-4 border border-gray-700/30",children:[(0,r.jsxs)("h5",{className:"text-white font-medium mb-1 md:mb-2 flex items-center text-sm md:text-base",children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 md:w-2 md:h-2 bg-blue-500 rounded-full mr-2"}),"Important Notice"]}),(0,r.jsx)("p",{className:"text-gray-400 text-xs md:text-sm leading-relaxed",children:"Boredflix does not host or store any media files. All content is sourced from third-party services and platforms. We respect intellectual property rights and comply with DMCA regulations."})]})}),(0,r.jsx)("div",{className:"border-t border-gray-700/50 pt-4 md:pt-6",children:(0,r.jsxs)("div",{className:"flex flex-col space-y-3 md:space-y-0 md:flex-row md:justify-between md:items-center",children:[(0,r.jsx)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:space-x-4 space-y-1 sm:space-y-0",children:(0,r.jsxs)("p",{className:"text-gray-400 text-xs md:text-sm",children:["\xa9 ",e," ",(0,r.jsx)("span",{className:"text-white font-medium",children:"Boredflix"}),". All rights reserved."]})})," ",(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:space-x-4 space-y-1 sm:space-y-0 text-xs text-gray-500",children:[(0,r.jsx)("span",{children:"Made with ❤️ for movie lovers"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"•"}),(0,r.jsx)("button",{onClick:()=>{"caches"in window&&caches.keys().then(e=>{e.forEach(e=>caches.delete(e))}),localStorage.removeItem("lastBuildTime"),localStorage.removeItem("lastKnownBuildTime"),window.location.reload()},className:"hover:text-blue-400 transition-colors underline",title:"Clear cache and refresh",children:"Version 1.0 ⟳"})]})]})})]})})]})};var Y=s(6982);let Z=e=>{let{children:t}=e,[s,l]=(0,n.useState)(!1);return(0,a.usePathname)(),(0,n.useCallback)(()=>{l(!1)},[]),(0,n.useEffect)(()=>{let e=document.documentElement.style;s?(e.setProperty("--surfshark-banner-height-mobile","50px"),e.setProperty("--surfshark-banner-height-desktop","48px")):(e.setProperty("--surfshark-banner-height-mobile","0px"),e.setProperty("--surfshark-banner-height-desktop","0px"))},[s]),(0,r.jsx)(Y.tE,{children:(0,r.jsxs)("div",{className:"flex flex-col min-h-screen w-full max-w-[100vw] overflow-x-hidden relative",children:[" ",(0,r.jsx)(V,{})," ",(0,r.jsxs)("main",{style:{paddingTop:"calc(var(--header-height-mobile) + var(--surfshark-banner-height-mobile))"},className:"jsx-3d3acef126e8aea3 min-h-screen p-4 w-full overflow-x-hidden flex-1 pb-[var(--bottom-nav-height)]",children:[(0,r.jsx)(i(),{id:"3d3acef126e8aea3",children:"main.jsx-3d3acef126e8aea3{padding-top:-webkit-calc(var(--header-height-mobile) + var(--surfshark-banner-height-mobile));padding-top:-moz-calc(var(--header-height-mobile) + var(--surfshark-banner-height-mobile));padding-top:calc(var(--header-height-mobile) + var(--surfshark-banner-height-mobile))}@media(min-width:768px){main.jsx-3d3acef126e8aea3{padding-top:-webkit-calc(var(--header-height-desktop) + var(--surfshark-banner-height-desktop));padding-top:-moz-calc(var(--header-height-desktop) + var(--surfshark-banner-height-desktop));padding-top:calc(var(--header-height-desktop) + var(--surfshark-banner-height-desktop))}}"}),t]})," ",(0,r.jsx)(W,{})," "]})})},K=e=>{let{children:t}=e;return(0,a.usePathname)().startsWith("/party/")?(0,r.jsx)(Y.tE,{children:(0,r.jsx)("div",{className:"w-full max-w-[100vw] overflow-x-hidden",children:t})}):(0,r.jsx)(Z,{children:t})}},347:()=>{},1595:(e,t,s)=>{"use strict";s.d(t,{default:()=>i});var r=s(5155),a=s(2115);class l extends a.Component{static getDerivedStateFromError(e){var t,s,r,a;return((null==(t=e.message)?void 0:t.includes("ChunkLoadError"))||(null==(s=e.message)?void 0:s.includes("Loading chunk"))||(null==(r=e.message)?void 0:r.includes("Loading CSS chunk"))||(null==(a=e.message)?void 0:a.includes("Failed to fetch dynamically imported module"))||"ChunkLoadError"===e.name)&&setTimeout(()=>{"caches"in window?caches.keys().then(e=>{Promise.all(e.map(e=>caches.delete(e))).then(()=>{window.location.reload()}).catch(()=>{window.location.reload()})}).catch(()=>{window.location.reload()}):window.location.reload()},100),{hasError:!0,error:e}}componentDidCatch(e,t){var s,r;(null==(s=e.message)?void 0:s.includes("ChunkLoadError"))||null==(r=e.message)||r.includes("Loading chunk")}render(){if(this.state.hasError){var e,t,s,a;return(null==(t=this.state.error)||null==(e=t.message)?void 0:e.includes("ChunkLoadError"))||(null==(a=this.state.error)||null==(s=a.message)?void 0:s.includes("Loading chunk"))?(0,r.jsx)("div",{className:"min-h-screen bg-gray-900 flex items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500 mx-auto mb-4"}),(0,r.jsx)("p",{className:"text-white",children:"Updating application..."})]})}):this.props.fallback?this.props.fallback:(0,r.jsx)("div",{className:"min-h-screen bg-gray-900 flex items-center justify-center p-4",children:(0,r.jsxs)("div",{className:"bg-gray-800 rounded-lg p-6 max-w-md w-full text-center",children:[(0,r.jsx)("div",{className:"text-red-500 text-6xl mb-4",children:"⚠️"}),(0,r.jsx)("h2",{className:"text-white text-xl font-semibold mb-2",children:"Something went wrong"}),(0,r.jsx)("p",{className:"text-gray-400 mb-4",children:"The application encountered an error. This might be due to a recent update."}),(0,r.jsx)("button",{onClick:this.handleRetry,className:"bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-lg transition-colors",children:"Reload Application"})]})})}return this.props.children}constructor(e){super(e),this.handleRetry=()=>{"caches"in window?caches.keys().then(e=>{Promise.all(e.filter(e=>e.includes("next")||e.includes("static")||e.includes("webpack")).map(e=>caches.delete(e))).then(()=>window.location.reload()).catch(()=>window.location.reload())}).catch(()=>window.location.reload()):window.location.reload()},this.state={hasError:!1}}}let i=l},1824:(e,t,s)=>{"use strict";s.d(t,{A:()=>h});var r=s(5155),a=s(2115),l=s(6874),i=s.n(l),n=s(6766),o=s(7132),d=s(2690),c=s(4020),m=s(5690),x=s(3311),u=s(8564);let h=e=>{var t;let{item:s,priority:l=!1,onClick:h,customActions:p}=e,[b,g]=(0,a.useState)(!1),[f,v]=(0,a.useState)(!1),[w,j]=(0,a.useState)(!1);if(!s||s instanceof Promise)return(0,r.jsxs)("div",{className:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-gray-800/80 to-gray-900/80 backdrop-blur-sm aspect-[2/3] w-full animate-pulse",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/50 to-transparent"}),(0,r.jsx)("div",{className:"h-full w-full flex items-center justify-center text-gray-400 text-sm font-medium",children:(0,r.jsx)("div",{className:"animate-spin w-6 h-6 border-2 border-blue-500 border-t-transparent rounded-full"})})]});let y="movie"===s.media_type?s.title:s.name,N="movie"===s.media_type?s.release_date:s.first_air_date,k="movie"===s.media_type?(0,d.GV)(s.id,y||"untitled"):(0,d.pK)(s.id,y||"untitled"),C=N?N.substring(0,4):"N/A",S=s.poster_path&&!f?"".concat(o.im,"w500").concat(s.poster_path):"/images/placeholder-poster.png",A=s.vote_average?Math.round(10*s.vote_average):null,E=N&&new Date(N)>new Date(Date.now()-5184e6),_=s.genres&&(null==(t=s.genres[0])?void 0:t.name)?s.genres[0].name:null,L={"@context":"https://schema.org","@type":"movie"===s.media_type?"Movie":"TV Show",name:y||"Untitled",genre:_||"Unknown",datePublished:N||"Unknown",aggregateRating:s.vote_average&&s.vote_count&&s.vote_average>0?{"@type":"AggregateRating",ratingValue:s.vote_average.toFixed(1),bestRating:"10",worstRating:"0",ratingCount:s.vote_count}:void 0},z=(e,t)=>{e.preventDefault(),e.stopPropagation(),t.onClick(),j(!1)};return(0,r.jsxs)("div",{className:"relative group cursor-pointer",onClick:h,children:[(0,r.jsx)("script",{type:"application/ld+json",children:JSON.stringify(L)}),(0,r.jsxs)(i(),{href:k,className:"block relative overflow-hidden rounded-xl transition-all duration-500 ease-out bg-gradient-to-br from-gray-900/50 to-black/50 backdrop-blur-sm shadow-sm hover:shadow-lg hover:shadow-blue-500/20 group transform hover:md:-translate-y-1 hover:md:scale-102 active:scale-98",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),onTouchStart:()=>g(!0),onTouchEnd:()=>setTimeout(()=>g(!1),2e3),"aria-label":"View details for ".concat(y||"Untitled"," (").concat("movie"===s.media_type?"Movie":"TV Show",")"),children:[(0,r.jsx)("div",{className:"absolute inset-0 rounded-2xl bg-gradient-to-r from-blue-500/50 via-purple-500/50 to-pink-500/50 opacity-0 group-hover:opacity-100 transition-opacity duration-500 blur-sm -z-10"}),E&&(0,r.jsxs)("div",{className:"absolute top-1 left-1 md:top-2 md:left-2 z-20 flex items-center gap-0.5 px-1 py-0.5 md:px-2 md:py-1 bg-gradient-to-r from-blue-600 to-blue-700 text-white text-xs font-bold rounded-full shadow-lg backdrop-blur-sm border border-blue-400/30",children:[" ",(0,r.jsx)(x.A,{className:"w-2.5 h-2.5 md:w-2.5 md:h-2.5"}),(0,r.jsx)("span",{className:"text-[9px] md:text-xs",children:"NEW"})]}),A&&(0,r.jsxs)("div",{className:"absolute top-1 right-1 md:top-2 md:right-2 z-20 flex items-center gap-0.5 px-1 py-0.5 md:px-2 md:py-1 bg-gradient-to-r ".concat(A?A>=75?"from-emerald-500 to-green-600":A>=60?"from-amber-500 to-orange-600":"from-red-500 to-rose-600":"from-gray-600 to-gray-700"," rounded-full shadow-lg backdrop-blur-sm border border-white/20"),children:[" ",(0,r.jsx)(u.A,{className:"w-2.5 h-2.5 md:w-2.5 md:h-2.5 text-white fill-current"}),(0,r.jsxs)("span",{className:"text-white font-bold text-[9px] md:text-xs",children:[A,"%"]})]}),(0,r.jsxs)("div",{className:"relative aspect-[2/3] w-full overflow-hidden rounded-xl bg-gradient-to-br from-gray-800 to-gray-900",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/50 via-black/20 to-transparent z-10 transition-all duration-500 ".concat(b?"opacity-100":"opacity-0")}),(0,r.jsx)(n.default,{src:S,alt:y?"".concat(y," poster"):"".concat(s.media_type," poster"),fill:!0,sizes:"(max-width: 640px) 50vw, (max-width: 768px) 33vw, (max-width: 1024px) 25vw, (max-width: 1280px) 20vw, 16.6vw",className:"object-cover transition-all duration-700 ease-out ".concat(b?"scale-110 brightness-110 contrast-110 saturate-110":"scale-100 brightness-100 contrast-100 saturate-100"),priority:l,onError:()=>v(!0),loading:l?"eager":"lazy"}),(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/20 via-transparent to-transparent"})]}),(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center transition-all duration-500 ".concat(b?"opacity-100 scale-100":"opacity-0 scale-75"),children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-blue-500/30 rounded-full animate-ping"}),(0,r.jsx)("div",{className:"absolute inset-0 bg-blue-500/20 rounded-full animate-pulse"})," ",(0,r.jsx)("div",{className:"relative w-8 h-8 md:w-12 md:h-12 bg-gradient-to-r from-blue-600 to-blue-700 rounded-full flex items-center justify-center shadow-xl border-2 border-blue-400/50 backdrop-blur-sm transform transition-transform duration-300 hover:scale-110 active:scale-95",children:(0,r.jsx)(m.A,{className:"h-3 w-3 md:h-5 md:w-5 text-white ml-0.5 fill-current"})})]})}),(0,r.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 transition-all duration-500 ".concat(b?"opacity-0 translate-y-2":"opacity-100 translate-y-0"),children:[" ",(0,r.jsx)("div",{className:"bg-gradient-to-t from-black/60 via-black/20 to-transparent p-1 md:p-1.5",children:(0,r.jsxs)("div",{className:"flex items-center justify-between text-[9px] md:text-xs",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 md:gap-1.5",children:[(0,r.jsx)("span",{className:"text-white/80 font-medium bg-black/40 backdrop-blur-sm px-1 py-0.5 md:px-1.5 rounded text-[9px] md:text-xs",children:C}),(0,r.jsx)("span",{className:"text-white/90 font-medium bg-black/40 backdrop-blur-sm px-1 py-0.5 md:px-1.5 rounded text-[9px] md:text-xs",children:"movie"===s.media_type?"Movie":"TV"})]}),A&&(0,r.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,r.jsx)(u.A,{className:"w-2.5 h-2.5 md:w-2.5 md:h-2.5 text-yellow-400 fill-current"}),(0,r.jsx)("span",{className:"text-white/90 font-medium text-[9px] md:text-xs",children:(s.vote_average||0).toFixed(1)})]})]})})]})]}),p&&p.length>0&&(0,r.jsxs)("div",{className:"absolute top-1 right-1 md:top-2 md:right-2 z-20",children:[(0,r.jsx)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),j(!w)},className:"flex items-center justify-center w-8 h-8 md:w-10 md:h-10 rounded-full transition-all duration-300 ease-in-out bg-black/60 hover:bg-black/70 active:bg-black/80 shadow-md","aria-label":"Toggle actions",children:(0,r.jsx)(c.A,{className:"w-5 h-5 text-white"})}),w&&(0,r.jsx)("div",{className:"absolute top-full right-0 mt-1 bg-gray-900/95 backdrop-blur-md border border-gray-700/50 rounded-lg shadow-xl overflow-hidden z-30",children:p.map((e,t)=>(0,r.jsxs)("button",{onClick:t=>z(t,e),className:"flex items-center gap-2 w-full px-4 py-2 text-sm text-left text-white hover:bg-blue-600/20 transition-colors",children:[e.icon&&(0,r.jsx)("span",{className:"flex-shrink-0",children:e.icon}),(0,r.jsx)("span",{children:e.label})]},"action-".concat(t)))})]})]})}},2348:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var r=s(2115);function a(e,t){let[s,a]=(0,r.useState)(e);return(0,r.useEffect)(()=>{let s=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(s)}},[e,t]),s}},2690:(e,t,s)=>{"use strict";function r(e){return e&&"string"==typeof e?e.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").trim():"untitled"}function a(e,t){let s=r(t);return"/movie/".concat(e,"/").concat(s)}function l(e,t){let s=r(t);return"/tv/".concat(e,"/").concat(s)}s.d(t,{GV:()=>a,pK:()=>l})},3808:()=>{},4918:(e,t,s)=>{"use strict";s.d(t,{default:()=>i});var r=s(5155),a=s(2115),l=s(5695);function i(){let[e,t]=(0,a.useState)(!1);(0,l.useRouter)(),(0,a.useEffect)(()=>{let e=async()=>{try{if(document.hidden)return;let e=await fetch("/api/build-info?"+Date.now(),{cache:"no-cache"});if(!e.ok)return;let s=await e.json(),r=localStorage.getItem("lastKnownBuildTime");r&&r!==s.buildTime&&t(!0),localStorage.setItem("lastKnownBuildTime",s.buildTime)}catch(e){}},s=setTimeout(e,12e4),r=setInterval(e,6e5),a=()=>{document.hidden||setTimeout(e,5e3)};return document.addEventListener("visibilitychange",a),()=>{clearTimeout(s),clearInterval(r),document.removeEventListener("visibilitychange",a)}},[]);let s=()=>{t(!1)};return e?(0,r.jsx)("div",{className:"fixed top-4 right-4 z-50 bg-gradient-to-r from-blue-600 to-purple-600 text-white p-4 rounded-lg shadow-lg max-w-sm",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)("svg",{className:"w-6 h-6 text-blue-200",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold text-sm",children:"Update Available"}),(0,r.jsx)("p",{className:"text-xs text-blue-100 mt-1",children:"New features and improvements are ready! Refresh to see the latest version."}),(0,r.jsxs)("div",{className:"flex gap-2 mt-3",children:[(0,r.jsx)("button",{onClick:()=>{"caches"in window?caches.keys().then(e=>{Promise.all(e.filter(e=>e.includes("next")||e.includes("static")||e.includes("webpack")).map(e=>caches.delete(e))).then(()=>{window.location.reload()})}):window.location.reload()},className:"bg-white text-blue-600 px-3 py-1 rounded text-xs font-medium hover:bg-blue-50 transition-colors",children:"Refresh Now"}),(0,r.jsx)("button",{onClick:s,className:"text-blue-200 px-3 py-1 rounded text-xs hover:text-white transition-colors",children:"Later"})]})]}),(0,r.jsx)("button",{onClick:s,className:"flex-shrink-0 text-blue-200 hover:text-white transition-colors",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}):null}},6288:(e,t,s)=>{"use strict";s.d(t,{X:()=>r.A});var r=s(4416)},6305:(e,t,s)=>{"use strict";s.d(t,{default:()=>l});var r=s(5155),a=s(2115);function l(){let[e,t]=(0,a.useState)(""),[s,l]=(0,a.useState)(""),[i,n]=(0,a.useState)(!1);(0,a.useEffect)(()=>{var e;t((null==(e=document.querySelector('meta[name="build-time"]'))?void 0:e.getAttribute("content"))||""),l(localStorage.getItem("lastKnownBuildTime")||"")},[]);let o=async()=>{try{if("caches"in window){let e=await caches.keys();await Promise.all(e.map(e=>caches.delete(e)))}Object.keys(localStorage).forEach(e=>{e.includes("auth")||e.includes("user")||e.includes("session")||localStorage.removeItem(e)}),sessionStorage.clear(),alert("Caches cleared! Page will reload."),window.location.reload()}catch(e){}},d=async()=>{try{let e=await fetch("/api/build-info?"+Date.now()),t=await e.json();alert("Current build time: ".concat(t.buildTime,"\nBuild date: ").concat(t.buildDate));let s=localStorage.getItem("lastKnownBuildTime");s&&s!==t.buildTime&&alert("New build detected! Consider refreshing.")}catch(e){}};return i?(0,r.jsxs)("div",{className:"fixed bottom-20 right-4 z-50 bg-black/80 text-white p-3 rounded-lg text-xs max-w-xs",children:[(0,r.jsx)("div",{className:"mb-2",children:(0,r.jsx)("strong",{children:"Cache Debug Panel"})}),(0,r.jsxs)("div",{className:"space-y-1 mb-3",children:[(0,r.jsxs)("div",{children:["Build: ",e]}),(0,r.jsxs)("div",{children:["Last: ",s]}),(0,r.jsxs)("div",{children:["Match: ",e===s?"✅":"❌"]})]}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("button",{onClick:o,className:"block w-full bg-red-600 px-2 py-1 rounded text-xs hover:bg-red-700",children:"Clear Caches"}),(0,r.jsx)("button",{onClick:d,className:"block w-full bg-blue-600 px-2 py-1 rounded text-xs hover:bg-blue-700",children:"Check Updates"}),(0,r.jsx)("button",{onClick:()=>n(!1),className:"block w-full bg-gray-600 px-2 py-1 rounded text-xs hover:bg-gray-700",children:"Hide Panel"})]})]}):null}},6982:(e,t,s)=>{"use strict";s.d(t,{dj:()=>n,tE:()=>o});var r=s(5155),a=s(2115),l=s(6288);let i=(0,a.createContext)(void 0),n=()=>{let e=(0,a.useContext)(i);if(!e)throw Error("useToast must be used within a ToastProvider");return e},o=e=>{let{children:t}=e,[s,n]=(0,a.useState)([]),o=(0,a.useCallback)((e,t)=>{let s=Math.random().toString(36).substring(2,9);return n(r=>[...r,{id:s,message:e,type:t}]),setTimeout(()=>{d(s)},4e3),s},[]),d=(0,a.useCallback)(e=>{n(t=>t.filter(t=>t.id!==e))},[]);return(0,r.jsxs)(i.Provider,{value:{toasts:s,showToast:o,hideToast:d},children:[" ",t,(0,r.jsx)("div",{className:"fixed top-4 right-4 z-[200] flex flex-col gap-2",children:s.map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-lg p-3 shadow-lg transition-all transform animate-slide-in-top\n ".concat("success"===e.type?"bg-green-600/90 text-white":"error"===e.type?"bg-red-600/90 text-white":"bg-blue-600/90 text-white"," \n backdrop-blur-sm border border-white/10 min-w-[300px] max-w-sm"),children:[(0,r.jsx)("p",{className:"text-sm font-medium flex-1",children:e.message}),(0,r.jsx)("button",{onClick:()=>d(e.id),className:"rounded-full p-1 hover:bg-white/20 transition-colors",children:(0,r.jsx)(l.X,{size:16})})]},e.id))})]})}},7132:(e,t,s)=>{"use strict";s.d(t,{im:()=>r,pe:()=>a});let r="https://image.tmdb.org/t/p/",a={poster:{tiny:"w92",small:"w154",medium:"w300",large:"w500",xlarge:"w780"},backdrop:{small:"w300",medium:"w780",large:"w1280",original:"original"},profile:{tiny:"w45",small:"w185",medium:"h632",original:"original"},logo:{small:"w92",medium:"w300",large:"w500"}}},8247:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,9243,23)),Promise.resolve().then(s.t.bind(s,1008,23)),Promise.resolve().then(s.t.bind(s,347,23)),Promise.resolve().then(s.bind(s,4918)),Promise.resolve().then(s.bind(s,6305)),Promise.resolve().then(s.bind(s,1595)),Promise.resolve().then(s.bind(s,30)),Promise.resolve().then(s.bind(s,283)),Promise.resolve().then(s.t.bind(s,3808,23))}},e=>{var t=t=>e(e.s=t);e.O(0,[3821,7690,833,8096,3226,8441,7358],()=>t(8247)),_N_E=e.O()}]);