import { Link } from 'react-router-dom';
import { useLanguage } from '../context/LanguageContext';
import Footer from '../components/Footer';

function AiTrends() {
    const { t } = useLanguage();

    const trends = [
        {
            id: 1,
            title: 'Natural Language Processing',
            description: t('aiTrends.trends.nlp.description'),
            icon: '🤖',
            stats: {
                growth: '+127%',
                adoption: '78%',
                impact: 'High'
            }
        },
        {
            id: 2,
            title: 'Computer Vision',
            description: t('aiTrends.trends.vision.description'),
            icon: '👁️',
            stats: {
                growth: '+85%',
                adoption: '64%',
                impact: 'High'
            }
        },
        {
            id: 3,
            title: 'Generative AI',
            description: t('aiTrends.trends.generative.description'),
            icon: '🎨',
            stats: {
                growth: '+245%',
                adoption: '52%',
                impact: 'Very High'
            }
        }
    ];

    return (
        <div className="relative min-h-screen bg-white">
            {/* Floating elements */}
            <div className="absolute inset-0 overflow-hidden pointer-events-none">
                <div className="absolute top-40 left-20 w-32 h-32 bg-brand-purple/10 rounded-full blur-3xl animate-pulse"></div>
                <div className="absolute bottom-40 right-20 w-40 h-40 bg-brand-pink/10 rounded-full blur-3xl animate-pulse delay-1000"></div>
            </div>

            <div className="max-w-[1400px] mx-auto px-4 sm:px-6 lg:px-8 pt-32">
                {/* Header section */}
                <div className="text-center mb-16">
                    <h1 className="text-[80px] leading-tight font-light tracking-tight text-gray-900 relative inline-block">
                        {t('aiTrends.title')}
                        <div className="absolute -top-1 -right-1 w-2 h-2 bg-brand-purple rounded-full"></div>
                    </h1>
                    <p className="text-xl text-gray-500 max-w-2xl mx-auto mt-6">
                        {t('aiTrends.description')}
                    </p>
                </div>

                {/* Trends Overview */}
                <div className="mb-16">
                    <h2 className="text-2xl font-medium text-gray-900 mb-8 text-center">{t('aiTrends.overview.title')}</h2>
                    <div className="grid grid-cols-1 md:grid-cols-3 gap-8">
                        {trends.map((trend) => (
                            <div key={trend.id} className="bg-white rounded-2xl shadow-lg p-6 relative group hover:shadow-xl transition-all duration-300 hover:-translate-y-1">
                                <div className="absolute -right-2 -top-2 w-10 h-10 bg-brand-purple text-white rounded-full flex items-center justify-center transform rotate-12 group-hover:rotate-0 transition-transform">
                                    <span className="text-xl">{trend.icon}</span>
                                </div>
                                <h3 className="text-xl font-medium text-gray-900 mb-4">{trend.title}</h3>
                                <p className="text-gray-600 mb-6">{trend.description}</p>
                                <div className="h-px bg-gray-100 mb-6"></div>
                                <div className="grid grid-cols-3 gap-4">
                                    <div>
                                        <span className="text-sm text-gray-500 block">Growth</span>
                                        <span className="font-medium text-brand-purple">{trend.stats.growth}</span>
                                    </div>
                                    <div>
                                        <span className="text-sm text-gray-500 block">Adoption</span>
                                        <span className="font-medium text-brand-purple">{trend.stats.adoption}</span>
                                    </div>
                                    <div>
                                        <span className="text-sm text-gray-500 block">Impact</span>
                                        <span className="font-medium text-brand-purple">{trend.stats.impact}</span>
                                    </div>
                                </div>
                            </div>
                        ))}
                    </div>
                </div>

                {/* Interactive Demo Section */}
                <div className="grid grid-cols-1 lg:grid-cols-3 gap-8 mb-16">
                    <div className="lg:col-span-2">
                        <div className="bg-white rounded-2xl shadow-lg overflow-hidden">
                            <div className="relative aspect-video">
                                <video
                                    className="w-full h-full object-cover"
                                    autoPlay
                                    loop
                                    muted
                                    playsInline
                                >
                                    <source src="/ai-demo.mp4" type="video/mp4" />
                                </video>
                                <div className="absolute inset-0 bg-gradient-to-t from-black/20 to-transparent"></div>
                            </div>
                            <div className="p-8">
                                <h3 className="text-xl font-medium text-gray-900 mb-4">{t('aiTrends.demo.title')}</h3>
                                <p className="text-gray-600 mb-6">{t('aiTrends.demo.description')}</p>
                                <Link 
                                    to="/register" 
                                    className="inline-flex items-center gap-2 bg-black text-white rounded-full px-6 py-3 text-sm group hover:bg-brand-purple transition-colors duration-300"
                                >
                                    <span>{t('aiTrends.demo.cta')}</span>
                                    <span className="transform group-hover:translate-x-1 transition-transform">→</span>
                                </Link>
                            </div>
                        </div>
                    </div>

                    {/* Stats Section */}
                    <div className="lg:col-span-1">
                        <div className="bg-white rounded-2xl shadow-lg p-8">
                            <h3 className="text-xl font-medium text-gray-900 mb-8">{t('aiTrends.stats.title')}</h3>
                            <div className="space-y-8">
                                <div>
                                    <div className="flex justify-between mb-2">
                                        <span className="text-sm text-gray-600">Market Growth</span>
                                        <span className="font-medium text-brand-purple">+156%</span>
                                    </div>
                                    <div className="w-full h-2 bg-gray-100 rounded-full overflow-hidden">
                                        <div className="h-full bg-brand-purple rounded-full" style={{ width: '75%' }}></div>
                                    </div>
                                </div>
                                <div>
                                    <div className="flex justify-between mb-2">
                                        <span className="text-sm text-gray-600">AI Adoption</span>
                                        <span className="font-medium text-brand-purple">68%</span>
                                    </div>
                                    <div className="w-full h-2 bg-gray-100 rounded-full overflow-hidden">
                                        <div className="h-full bg-brand-purple rounded-full" style={{ width: '68%' }}></div>
                                    </div>
                                </div>
                                <div>
                                    <div className="flex justify-between mb-2">
                                        <span className="text-sm text-gray-600">ROI Impact</span>
                                        <span className="font-medium text-brand-purple">+234%</span>
                                    </div>
                                    <div className="w-full h-2 bg-gray-100 rounded-full overflow-hidden">
                                        <div className="h-full bg-brand-purple rounded-full" style={{ width: '85%' }}></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <Footer />
        </div>
    );
}

export default AiTrends;
