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

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

    const features = [
        {
            id: 1,
            title: 'Brand Style Transfer',
            description: t('imageGen.features.styleTransfer.description'),
            icon: '🎨',
            stats: {
                styles: '25+',
                speed: '< 30s',
                quality: 'HD'
            }
        },
        {
            id: 2,
            title: 'Product Visualization',
            description: t('imageGen.features.product.description'),
            icon: '📦',
            stats: {
                formats: '12+',
                angles: '360°',
                backgrounds: '50+'
            }
        },
        {
            id: 3,
            title: 'Social Media Content',
            description: t('imageGen.features.social.description'),
            icon: '📱',
            stats: {
                templates: '100+',
                formats: 'All',
                customization: 'Full'
            }
        }
    ];

    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('imageGen.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('imageGen.description')}
                    </p>
                </div>

                {/* Features Overview */}
                <div className="mb-16">
                    <h2 className="text-2xl font-medium text-gray-900 mb-8 text-center">{t('imageGen.features.title')}</h2>
                    <div className="grid grid-cols-1 md:grid-cols-3 gap-8">
                        {features.map((feature) => (
                            <div key={feature.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">{feature.icon}</span>
                                </div>
                                <h3 className="text-xl font-medium text-gray-900 mb-4">{feature.title}</h3>
                                <p className="text-gray-600 mb-6">{feature.description}</p>
                                <div className="h-px bg-gray-100 mb-6"></div>
                                <div className="grid grid-cols-3 gap-4">
                                    {Object.entries(feature.stats).map(([key, value]) => (
                                        <div key={key}>
                                            <span className="text-sm text-gray-500 block capitalize">{key}</span>
                                            <span className="font-medium text-brand-purple">{value}</span>
                                        </div>
                                    ))}
                                </div>
                            </div>
                        ))}
                    </div>
                </div>

                {/* Image Generator Demo and Style Presets */}
                <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">
                                <div className="absolute inset-0 grid grid-cols-2 gap-4 p-6">
                                    <div className="bg-gray-100 rounded-xl"></div>
                                    <div className="bg-gray-100 rounded-xl"></div>
                                    <div className="bg-gray-100 rounded-xl"></div>
                                    <div className="bg-gray-100 rounded-xl"></div>
                                </div>
                                <div className="absolute inset-0 bg-gradient-to-t from-black/10 to-transparent"></div>
                            </div>
                            <div className="p-8">
                                <h3 className="text-xl font-medium text-gray-900 mb-4">{t('imageGen.demo.title')}</h3>
                                <p className="text-gray-600 mb-6">{t('imageGen.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('imageGen.demo.cta')}</span>
                                    <span className="transform group-hover:translate-x-1 transition-transform">→</span>
                                </Link>
                            </div>
                        </div>
                    </div>

                    {/* Style Presets */}
                    <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-6">{t('imageGen.styles.title')}</h3>
                            <div className="space-y-3">
                                {['Minimalist', 'Brutalist', 'Retro', 'Modern', 'Abstract'].map((style) => (
                                    <div 
                                        key={style} 
                                        className="p-4 rounded-xl hover:bg-gray-50 transition-colors duration-300 cursor-pointer group"
                                    >
                                        <span className="text-gray-600 group-hover:text-brand-purple transition-colors">{style}</span>
                                    </div>
                                ))}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <Footer />
        </div>
    );
}

export default ImageGeneration;
