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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import React from "react";
|
| 2 |
+
import { motion } from "framer-motion";
|
| 3 |
+
import { cn } from "@/lib/utils";
|
| 4 |
+
import {
|
| 5 |
+
X,
|
| 6 |
+
Sparkles,
|
| 7 |
+
Zap,
|
| 8 |
+
Shield,
|
| 9 |
+
Cloud,
|
| 10 |
+
BarChart3,
|
| 11 |
+
Bot,
|
| 12 |
+
Globe,
|
| 13 |
+
Lock,
|
| 14 |
+
Rocket,
|
| 15 |
+
Users,
|
| 16 |
+
CheckCircle2,
|
| 17 |
+
ArrowRight
|
| 18 |
+
} from "lucide-react";
|
| 19 |
+
import { Button } from "@/components/ui/button";
|
| 20 |
+
|
| 21 |
+
const features = [
|
| 22 |
+
{
|
| 23 |
+
icon: Zap,
|
| 24 |
+
title: "Unlimited Extractions",
|
| 25 |
+
description: "Process unlimited documents with lightning-fast AI extraction",
|
| 26 |
+
color: "amber",
|
| 27 |
+
cta: "Try Pro",
|
| 28 |
+
gradient: "from-amber-500 to-orange-500"
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
icon: Bot,
|
| 32 |
+
title: "Advanced AI Models",
|
| 33 |
+
description: "Access GPT-4 Vision and specialized extraction models",
|
| 34 |
+
color: "indigo",
|
| 35 |
+
cta: "Talk to Sales",
|
| 36 |
+
gradient: "from-indigo-500 to-violet-500"
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
icon: Cloud,
|
| 40 |
+
title: "API Access",
|
| 41 |
+
description: "Integrate EZOFIS into your workflow with our REST API",
|
| 42 |
+
color: "blue",
|
| 43 |
+
cta: "View Docs",
|
| 44 |
+
gradient: "from-blue-500 to-cyan-500"
|
| 45 |
+
},
|
| 46 |
+
{
|
| 47 |
+
icon: BarChart3,
|
| 48 |
+
title: "Advanced Analytics",
|
| 49 |
+
description: "Track accuracy, processing time, and extraction insights",
|
| 50 |
+
color: "emerald",
|
| 51 |
+
cta: "Custom Demo",
|
| 52 |
+
gradient: "from-emerald-500 to-teal-500"
|
| 53 |
+
},
|
| 54 |
+
{
|
| 55 |
+
icon: Shield,
|
| 56 |
+
title: "Enterprise Security",
|
| 57 |
+
description: "SOC2 compliant with end-to-end encryption",
|
| 58 |
+
color: "slate",
|
| 59 |
+
cta: "Learn More",
|
| 60 |
+
gradient: "from-slate-600 to-slate-800"
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
icon: Users,
|
| 64 |
+
title: "Team Collaboration",
|
| 65 |
+
description: "Share extractions and collaborate with your team",
|
| 66 |
+
color: "purple",
|
| 67 |
+
cta: "Try Pro",
|
| 68 |
+
gradient: "from-purple-500 to-pink-500"
|
| 69 |
+
}
|
| 70 |
+
];
|
| 71 |
+
|
| 72 |
+
export default function UpgradeModal({ open, onClose }) {
|
| 73 |
+
if (!open) return null;
|
| 74 |
+
|
| 75 |
+
return (
|
| 76 |
+
<div className="fixed inset-0 z-50 flex items-center justify-center">
|
| 77 |
+
{/* Backdrop */}
|
| 78 |
+
<motion.div
|
| 79 |
+
initial={{ opacity: 0 }}
|
| 80 |
+
animate={{ opacity: 1 }}
|
| 81 |
+
exit={{ opacity: 0 }}
|
| 82 |
+
className="absolute inset-0 bg-black/50 backdrop-blur-sm"
|
| 83 |
+
onClick={onClose}
|
| 84 |
+
/>
|
| 85 |
+
|
| 86 |
+
{/* Modal */}
|
| 87 |
+
<motion.div
|
| 88 |
+
initial={{ opacity: 0, scale: 0.95, y: 20 }}
|
| 89 |
+
animate={{ opacity: 1, scale: 1, y: 0 }}
|
| 90 |
+
exit={{ opacity: 0, scale: 0.95, y: 20 }}
|
| 91 |
+
className="relative z-10 w-full max-w-6xl max-h-[90vh] mx-4 bg-white rounded-2xl shadow-2xl overflow-hidden flex flex-col"
|
| 92 |
+
onClick={(e) => e.stopPropagation()}
|
| 93 |
+
>
|
| 94 |
+
{/* Header */}
|
| 95 |
+
<div className="sticky top-0 bg-gradient-to-r from-indigo-600 via-violet-600 to-purple-600 text-white px-8 py-6 z-10">
|
| 96 |
+
<button
|
| 97 |
+
onClick={onClose}
|
| 98 |
+
className="absolute right-6 top-6 h-8 w-8 rounded-lg bg-white/10 hover:bg-white/20 flex items-center justify-center transition-colors"
|
| 99 |
+
>
|
| 100 |
+
<X className="h-4 w-4" />
|
| 101 |
+
</button>
|
| 102 |
+
|
| 103 |
+
<motion.div
|
| 104 |
+
initial={{ opacity: 0, y: 20 }}
|
| 105 |
+
animate={{ opacity: 1, y: 0 }}
|
| 106 |
+
className="text-center"
|
| 107 |
+
>
|
| 108 |
+
<div className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-white/10 backdrop-blur-sm mb-4">
|
| 109 |
+
<Sparkles className="h-4 w-4" />
|
| 110 |
+
<span className="text-sm font-medium">Trial Limit Reached</span>
|
| 111 |
+
</div>
|
| 112 |
+
<h2 className="text-3xl font-bold mb-2">You've processed 2 documents</h2>
|
| 113 |
+
<p className="text-white/80 text-lg">Upgrade to unlock the full power of EZOFIS AI</p>
|
| 114 |
+
</motion.div>
|
| 115 |
+
</div>
|
| 116 |
+
|
| 117 |
+
{/* Stats Bar */}
|
| 118 |
+
<div className="grid grid-cols-3 gap-6 px-8 py-6 bg-slate-50 border-b border-slate-200">
|
| 119 |
+
{[
|
| 120 |
+
{ label: "Accuracy Rate", value: "98.5%", icon: CheckCircle2 },
|
| 121 |
+
{ label: "Processing Speed", value: "< 3s", icon: Zap },
|
| 122 |
+
{ label: "Happy Customers", value: "10,000+", icon: Users }
|
| 123 |
+
].map((stat, i) => (
|
| 124 |
+
<motion.div
|
| 125 |
+
key={stat.label}
|
| 126 |
+
initial={{ opacity: 0, y: 20 }}
|
| 127 |
+
animate={{ opacity: 1, y: 0 }}
|
| 128 |
+
transition={{ delay: i * 0.1 }}
|
| 129 |
+
className="text-center"
|
| 130 |
+
>
|
| 131 |
+
<div className="flex items-center justify-center gap-2 mb-1">
|
| 132 |
+
<stat.icon className="h-4 w-4 text-indigo-600" />
|
| 133 |
+
<span className="text-2xl font-bold text-slate-900">{stat.value}</span>
|
| 134 |
+
</div>
|
| 135 |
+
<p className="text-sm text-slate-500">{stat.label}</p>
|
| 136 |
+
</motion.div>
|
| 137 |
+
))}
|
| 138 |
+
</div>
|
| 139 |
+
|
| 140 |
+
{/* Features Grid - Scrollable */}
|
| 141 |
+
<div className="flex-1 overflow-auto px-8 py-8">
|
| 142 |
+
<div className="text-center mb-8">
|
| 143 |
+
<h3 className="text-2xl font-bold text-slate-900 mb-2">
|
| 144 |
+
Unlock Premium Features
|
| 145 |
+
</h3>
|
| 146 |
+
<p className="text-slate-600">
|
| 147 |
+
Scale your document processing with enterprise-grade capabilities
|
| 148 |
+
</p>
|
| 149 |
+
</div>
|
| 150 |
+
|
| 151 |
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
| 152 |
+
{features.map((feature, index) => (
|
| 153 |
+
<motion.div
|
| 154 |
+
key={feature.title}
|
| 155 |
+
initial={{ opacity: 0, y: 20 }}
|
| 156 |
+
animate={{ opacity: 1, y: 0 }}
|
| 157 |
+
transition={{ delay: 0.2 + index * 0.1 }}
|
| 158 |
+
className="group relative bg-white rounded-2xl border border-slate-200 p-6 hover:shadow-xl hover:shadow-slate-200/50 transition-all duration-300 hover:-translate-y-1 overflow-hidden"
|
| 159 |
+
>
|
| 160 |
+
{/* Gradient Background on Hover */}
|
| 161 |
+
<div className={`absolute inset-0 bg-gradient-to-br ${feature.gradient} opacity-0 group-hover:opacity-5 transition-opacity duration-300`} />
|
| 162 |
+
|
| 163 |
+
<div className="relative">
|
| 164 |
+
<div className={cn(
|
| 165 |
+
"h-12 w-12 rounded-xl flex items-center justify-center mb-4 group-hover:scale-110 transition-transform duration-300",
|
| 166 |
+
feature.color === "amber" && "bg-amber-50",
|
| 167 |
+
feature.color === "indigo" && "bg-indigo-50",
|
| 168 |
+
feature.color === "blue" && "bg-blue-50",
|
| 169 |
+
feature.color === "emerald" && "bg-emerald-50",
|
| 170 |
+
feature.color === "slate" && "bg-slate-50",
|
| 171 |
+
feature.color === "purple" && "bg-purple-50"
|
| 172 |
+
)}>
|
| 173 |
+
<feature.icon className={cn(
|
| 174 |
+
"h-6 w-6",
|
| 175 |
+
feature.color === "amber" && "text-amber-600",
|
| 176 |
+
feature.color === "indigo" && "text-indigo-600",
|
| 177 |
+
feature.color === "blue" && "text-blue-600",
|
| 178 |
+
feature.color === "emerald" && "text-emerald-600",
|
| 179 |
+
feature.color === "slate" && "text-slate-600",
|
| 180 |
+
feature.color === "purple" && "text-purple-600"
|
| 181 |
+
)} />
|
| 182 |
+
</div>
|
| 183 |
+
<h4 className="font-semibold text-slate-900 mb-2">{feature.title}</h4>
|
| 184 |
+
<p className="text-sm text-slate-600 mb-4 leading-relaxed">{feature.description}</p>
|
| 185 |
+
|
| 186 |
+
<Button
|
| 187 |
+
variant="ghost"
|
| 188 |
+
size="sm"
|
| 189 |
+
className={cn(
|
| 190 |
+
"w-full h-9 border transition-all group-hover:shadow-md",
|
| 191 |
+
feature.color === "amber" && "text-amber-600 hover:bg-amber-50 border-amber-200 hover:border-amber-300",
|
| 192 |
+
feature.color === "indigo" && "text-indigo-600 hover:bg-indigo-50 border-indigo-200 hover:border-indigo-300",
|
| 193 |
+
feature.color === "blue" && "text-blue-600 hover:bg-blue-50 border-blue-200 hover:border-blue-300",
|
| 194 |
+
feature.color === "emerald" && "text-emerald-600 hover:bg-emerald-50 border-emerald-200 hover:border-emerald-300",
|
| 195 |
+
feature.color === "slate" && "text-slate-600 hover:bg-slate-50 border-slate-200 hover:border-slate-300",
|
| 196 |
+
feature.color === "purple" && "text-purple-600 hover:bg-purple-50 border-purple-200 hover:border-purple-300"
|
| 197 |
+
)}
|
| 198 |
+
>
|
| 199 |
+
{feature.cta}
|
| 200 |
+
<ArrowRight className="h-3.5 w-3.5 ml-2 group-hover:translate-x-1 transition-transform" />
|
| 201 |
+
</Button>
|
| 202 |
+
</div>
|
| 203 |
+
</motion.div>
|
| 204 |
+
))}
|
| 205 |
+
</div>
|
| 206 |
+
</div>
|
| 207 |
+
|
| 208 |
+
{/* CTA Footer */}
|
| 209 |
+
<div className="sticky bottom-0 bg-white border-t border-slate-200 px-8 py-6">
|
| 210 |
+
<div className="flex items-center justify-between gap-6">
|
| 211 |
+
<div className="flex-1">
|
| 212 |
+
<h4 className="font-semibold text-slate-900 mb-1">Ready to scale?</h4>
|
| 213 |
+
<p className="text-sm text-slate-600">Choose the plan that fits your needs</p>
|
| 214 |
+
</div>
|
| 215 |
+
<div className="flex items-center gap-3">
|
| 216 |
+
<Button
|
| 217 |
+
variant="outline"
|
| 218 |
+
size="lg"
|
| 219 |
+
className="h-11 border-slate-300"
|
| 220 |
+
>
|
| 221 |
+
<Users className="h-4 w-4 mr-2" />
|
| 222 |
+
Talk to Sales
|
| 223 |
+
</Button>
|
| 224 |
+
<Button
|
| 225 |
+
size="lg"
|
| 226 |
+
className="h-11 bg-gradient-to-r from-indigo-600 to-violet-600 hover:from-indigo-700 hover:to-violet-700 shadow-lg shadow-indigo-500/25 hover:shadow-xl hover:shadow-indigo-500/30"
|
| 227 |
+
>
|
| 228 |
+
<Rocket className="h-4 w-4 mr-2" />
|
| 229 |
+
Upgrade to Pro
|
| 230 |
+
<Sparkles className="h-4 w-4 ml-2" />
|
| 231 |
+
</Button>
|
| 232 |
+
</div>
|
| 233 |
+
</div>
|
| 234 |
+
</div>
|
| 235 |
+
</motion.div>
|
| 236 |
+
</div>
|
| 237 |
+
);
|
| 238 |
+
}
|
| 239 |
+
|