import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Textarea } from '@/components/ui/textarea';
import { motion } from 'framer-motion';
import { Mail, MapPin } from 'lucide-react';

export default function ContactFormSection() {
    const containerVariants = {
        hidden: { opacity: 0 },
        visible: {
            opacity: 1,
            transition: {
                staggerChildren: 0.2,
            },
        },
    };

    const itemVariants = {
        hidden: { opacity: 0, y: 50 },
        visible: { opacity: 1, y: 0 },
    };

    return (
        <section className="bg-white py-20">
            <div className="container mx-auto px-4">
                <motion.div
                    className="grid grid-cols-1 items-center gap-16 lg:grid-cols-2"
                    initial="hidden"
                    whileInView="visible"
                    viewport={{ once: true, amount: 0.3 }}
                    variants={containerVariants}
                >
                    {/* Left Side: Get in Touch Info */}
                    <motion.div variants={itemVariants} className="relative overflow-hidden rounded-2xl bg-slate-900 p-5 text-white shadow-xl">
                        <div className="h-34 w-full">
                            <img
                                src="https://images.pexels.com/photos/3184338/pexels-photo-3184338.jpeg?auto=compress&cs=tinysrgb&w=600&h=500&fit=crop"
                                alt="Business meeting background"
                                className="size-full rounded-xl object-cover opacity-20"
                            />
                        </div>

                        <div className="relative z-10">
                            <h2 className="mb-6 text-4xl font-bold">Get in Touch</h2>
                            <p className="mb-8 leading-relaxed text-gray-200">
                                Give us a call or drop by anytime, we endeavor to answer all inquiries within 24 hours on business days.
                            </p>
                            <div className="space-y-4">
                                <div className="flex items-start gap-3">
                                    <MapPin className="h-6 w-6 flex-shrink-0 text-green-400" />
                                    <span className="text-gray-100">15/100 Edward St, Brisbane City QLD 4000, Australia</span>
                                </div>
                                <div className="flex items-start gap-3">
                                    <Mail className="h-6 w-6 flex-shrink-0 text-green-400" />
                                    <span className="text-gray-100">support@fairtrustfund.com</span>
                                </div>
                            </div>
                        </div>
                    </motion.div>

                    {/* Right Side: Contact Form */}
                    <motion.div variants={itemVariants} className="rounded-2xl border border-gray-200 bg-white p-8 shadow-xl">
                        <form className="space-y-6">
                            <div>
                                <label htmlFor="name" className="mb-2 block text-sm font-medium text-gray-700">
                                    Your Name
                                </label>
                                <Input
                                    id="name"
                                    type="text"
                                    placeholder="Enter your name"
                                    className="w-full rounded-md border-gray-300 shadow-sm focus:border-green-500 focus:ring-green-500"
                                />
                            </div>
                            <div>
                                <label htmlFor="email" className="mb-2 block text-sm font-medium text-gray-700">
                                    Your Email
                                </label>
                                <Input
                                    id="email"
                                    type="email"
                                    placeholder="Enter your email"
                                    className="w-full rounded-md border-gray-300 shadow-sm focus:border-green-500 focus:ring-green-500"
                                />
                            </div>
                            <div>
                                <label htmlFor="message" className="mb-2 block text-sm font-medium text-gray-700">
                                    Your message
                                </label>
                                <Textarea
                                    id="message"
                                    placeholder="Type your message here..."
                                    rows={5}
                                    className="w-full rounded-md border-gray-300 shadow-sm focus:border-green-500 focus:ring-green-500"
                                />
                            </div>
                            <Button
                                type="submit"
                                className="w-full rounded-full bg-green-500 px-8 py-3 font-semibold text-white transition-all duration-300 hover:scale-105 hover:bg-green-600"
                            >
                                SEND MESSAGE
                            </Button>
                        </form>
                    </motion.div>
                </motion.div>
            </div>
        </section>
    );
}
