import { AlertTriangle, ShieldAlert, FileText, Settings, Bot } from "lucide-react";

export function AIAnalysisTab({ job }: { job: any }) {

    // For Phase 1 & 2, this is a static mockup.
    // In Phase 3, this will be dynamically populated from the AI Service via the job record.

    return (
        <div className="space-y-8 animate-in fade-in duration-300">
            <div className="text-center py-6 px-4 bg-gradient-to-br from-slate-50 to-orange-50/30 rounded-2xl border border-slate-200 shadow-sm relative overflow-hidden">
                <div className="absolute top-0 right-0 p-4 opacity-10">
                    <Bot className="w-32 h-32" />
                </div>

                <div className="relative z-10">
                    <div className="w-16 h-16 bg-white rounded-full flex items-center justify-center mx-auto mb-4 shadow-sm border border-slate-200">
                        <AlertTriangle className="w-8 h-8 text-orange-500" />
                    </div>
                    <h3 className="text-xl font-bold text-slate-900">AI Risk Assessment</h3>
                    <p className="text-sm text-slate-600 mt-2 max-w-md mx-auto">
                        This job posting has been analyzed by our AI moderation engine. Review the flagged anomalies below before approving.
                    </p>
                </div>
            </div>

            <div className="space-y-6">

                <h4 className="font-bold text-slate-900 flex items-center gap-2 border-b border-slate-100 pb-2">
                    <ShieldAlert className="w-5 h-5 text-red-500" /> High Priority Flags
                </h4>

                <div className="grid gap-4">
                    <div className="p-4 bg-red-50 border border-red-100 rounded-xl flex gap-4">
                        <div className="mt-0.5"><AlertTriangle className="w-5 h-5 text-red-600" /></div>
                        <div>
                            <p className="font-semibold text-red-900 text-sm">External Application URL Anomaly</p>
                            <p className="text-xs text-red-800 mt-1">
                                The external application URL (`{job.external_url || 'https://bit.ly/suspicious-link'}`) redirects to a known URL shortener which disguises the final destination.
                                This is a common tactic for phishing schemes.
                            </p>
                        </div>
                    </div>

                    <div className="p-4 bg-orange-50 border border-orange-100 rounded-xl flex gap-4">
                        <div className="mt-0.5"><FileText className="w-5 h-5 text-orange-600" /></div>
                        <div>
                            <p className="font-semibold text-orange-900 text-sm">Low Description Quality</p>
                            <p className="text-xs text-orange-800 mt-1">
                                The job description length is extremely short (under 100 words), lacking detailed responsibilities and requirements.
                            </p>
                        </div>
                    </div>
                </div>

                <div className="pt-6">
                    <h4 className="font-bold text-slate-900 flex items-center gap-2 border-b border-slate-100 pb-2">
                        <Settings className="w-5 h-5 text-slate-400" /> AI Confidence Score
                    </h4>

                    <div className="mt-4 bg-slate-50 border border-slate-200 rounded-xl p-6">
                        <div className="flex justify-between items-center mb-2">
                            <span className="text-sm font-medium text-slate-600">Spam Likelihood</span>
                            <span className="text-sm font-bold text-orange-600">74%</span>
                        </div>
                        <div className="w-full bg-slate-200 rounded-full h-2.5">
                            <div className="bg-orange-500 h-2.5 rounded-full" style={{ width: '74%' }}></div>
                        </div>
                        <p className="text-xs text-slate-500 mt-3 text-center italic">
                            Models trained on {new Date().getFullYear()} Jobzio fraud data.
                        </p>
                    </div>
                </div>

            </div>
        </div>
    );
}
