import { type SharedData } from '@/types';
import { Head, Link, usePage } from '@inertiajs/react';

export default function Welcome() {
    const { auth } = usePage<SharedData>().props;

    return (
        <>
            <Head title="Welcome">
                <link rel="preconnect" href="https://fonts.bunny.net" />
                <link href="https://fonts.bunny.net/css?family=instrument-sans:400,500,600" rel="stylesheet" />
            </Head>

            <div className="relative min-h-screen flex flex-col justify-between overflow-x-hidden bg-[#f8fafc] text-slate-900">
                {/* Background Subtle Lines */}
                <div className="fixed left-0 top-0 -z-20 flex h-full w-full items-center justify-around pointer-events-none">
                    <span className="flex h-full w-[1px] animate-line1 bg-slate-200"></span>
                    <span className="flex h-full w-[1px] animate-line2 bg-slate-200"></span>
                    <span className="flex h-full w-[1px] animate-line3 bg-slate-200"></span>
                </div>

                {/* Header */}
                <header className="fixed top-0 left-0 z-50 w-full py-4 bg-white/90 backdrop-blur-md border-b border-slate-200 shadow-sm">
                    <div className="max-w-7xl mx-auto flex items-center justify-between px-6 md:px-12">
                        <Link href="/" className="flex items-center gap-3 group">
                            <div className="relative h-10 w-10 md:h-11 md:w-11 transition-transform group-hover:scale-105">
                                <img
                                    alt="AEROCAB Logo"
                                    loading="eager"
                                    className="object-contain"
                                    src="./logo.svg"
                                />
                            </div>
                            <span className="font-extrabold text-slate-900 text-xl md:text-2xl tracking-wider">
                                AEROCAB
                            </span>
                        </Link>
                        <div className='flex justify-end gap-2'>
                            <Link
                                href="/reservation"
                                className="text-sm md:text-base font-bold text-white bg-[#0f1f3d] hover:bg-blue-700 px-6 py-2.5 rounded-full transition-all duration-300 shadow-md hover:shadow-lg"
                            >
                                Réservation
                            </Link>

                            {auth.user ? (
                                <Link
                                    href={route('dashboard')}
                                    className="text-sm md:text-base font-bold text-white bg-[#000] hover:bg-grey-700 px-6 py-2.5 rounded-full transition-all duration-300 shadow-md hover:shadow-lg"
                                >
                                    Dashboard
                                </Link>
                            ) : (
                                <>
                                    <Link
                                        href={route('login')}
                                        className="text-sm md:text-base font-bold text-white bg-[#000] hover:bg-grey-700 px-6 py-2.5 rounded-full transition-all duration-300 shadow-md hover:shadow-lg"
                                    >
                                        Log in
                                    </Link>
                                    <Link
                                        href={route('register')}
                                        className="text-sm md:text-base font-bold text-white bg-[#000] hover:bg-grey-700 px-6 py-2.5 rounded-full transition-all duration-300 shadow-md hover:shadow-lg"
                                    >
                                        Register
                                    </Link>
                                </>
                            )}
                        </div>
                    </div>
                </header>

                {/* Hero Section */}
                <main className="flex-1 flex flex-col justify-center">
                    <section className="relative min-h-screen flex flex-col justify-center items-center pt-32 pb-20 px-6 md:px-12">
                        {/* Background Image with Light Overlay */}
                        <div className="absolute inset-0 -z-10">
                            <img
                                alt="AEROCAB Service Background"
                                className="object-cover opacity-25"
                                src="/images/header_3.jpg"
                            />
                            <div className="absolute inset-0 bg-gradient-to-b from-white/90 via-white/80 to-[#f8fafc]"></div>
                        </div>

                        {/* Hero Banner Content */}
                        <div className="relative z-10 flex flex-col items-center gap-5 text-center max-w-4xl">
                            <div className="relative h-20 w-20 md:h-28 md:w-28 animate-pulse">
                                <img
                                    alt="AEROCAB Logo"
                                    className="object-contain"
                                    src="/logo.svg"
                                />
                            </div>

                            <div className="inline-block rounded-full bg-blue-50 border border-blue-200 px-4 py-1.5 shadow-sm">
                                <span className="text-xs font-bold uppercase tracking-wider text-[#0f1f3d]">
                                    Service Chauffeur Privé & Navettes
                                </span>
                            </div>

                            <h2 className="font-black text-slate-900 text-4xl md:text-6xl tracking-tight uppercase">
                                AEROCAB BRUXELLES
                            </h2>

                            <div className="h-[3px] w-20 bg-[#0f1f3d] my-1 rounded-full"></div>

                            <div className="flex flex-col gap-1.5">
                                <h3 className="font-bold text-slate-800 text-2xl md:text-3xl tracking-normal">
                                    Navettes aéroport & Transferts VIP
                                </h3>
                                <p className="text-slate-600 text-base md:text-xl font-normal max-w-2xl mx-auto">
                                    Depuis et vers Bruxelles, Zaventem (BRU), Charleroi (CRL) et toute la Belgique avec tarif fixe garanti.
                                </p>
                            </div>

                            <div className="mt-6 flex flex-col sm:flex-row gap-4">
                                <Link
                                    href="/reservation"
                                    className="px-8 py-4 bg-[#0f1f3d] text-white hover:bg-blue-700 text-base font-bold rounded-xl transition-all duration-300 shadow-lg hover:shadow-blue-500/25 hover:-translate-y-0.5"
                                >
                                    Réserver mon trajet en ligne
                                </Link>
                                <a
                                    href="#services"
                                    className="px-8 py-4 bg-white border border-slate-300 text-slate-700 hover:bg-slate-50 text-base font-bold rounded-xl transition-all duration-300 shadow-sm"
                                >
                                    Découvrir nos services
                                </a>
                            </div>
                        </div>

                        {/* QR Code Card */}
                        <div className="absolute bottom-6 right-6 hidden md:block z-10">
                            <div className="relative flex flex-col items-center gap-2 rounded-2xl bg-white border border-slate-200 p-4 shadow-lg">
                                <div className="relative h-20 w-20">
                                    <img
                                        alt="AEROCAB QR Code App"
                                        className="object-contain"
                                        src="/qr_code.svg"
                                    />
                                </div>
                                <span className="text-[11px] font-bold text-slate-600 tracking-wider uppercase">
                                    Scannez pour réserver
                                </span>
                            </div>
                        </div>
                    </section>

                    {/* Services Section */}
                    <section id="services" className="py-24 bg-white border-t border-slate-200 scroll-mt-20">
                        <div className="max-w-7xl mx-auto px-6 md:px-12">
                            <div className="text-center max-w-2xl mx-auto mb-16">
                                <div className="mb-4 inline-block rounded-full bg-blue-50 border border-blue-200 px-5 py-1.5">
                                    <span className="text-xs font-bold uppercase tracking-wider text-[#0f1f3d]">
                                        Nos engagements
                                    </span>
                                </div>
                                <h2 className="text-3xl md:text-4xl font-extrabold text-slate-900 mb-4">
                                    L'alternative haut de gamme au taxi traditionnel
                                </h2>
                                <p className="text-slate-600 text-base md:text-lg">
                                    Pour tous vos déplacements à Bruxelles et ses alentours, voyagez dans des conditions optimales de confort, discrétion et ponctualité.
                                </p>
                            </div>

                            {/* Features Grid */}
                            <div className="grid grid-cols-1 md:grid-cols-3 gap-8">
                                {/* Feature 1 */}
                                <div className="bg-[#f8fafc] hover:bg-white p-8 md:p-9 rounded-2xl border border-slate-200 hover:border-blue-300 transition-all duration-300 shadow-sm hover:shadow-md flex flex-col gap-5">
                                    <div className="relative h-14 w-14 bg-[#0f1f3d] rounded-xl flex items-center justify-center shadow-md">
                                        <img
                                            alt="Transport Privé Icon"
                                            width={32}
                                            height={32}
                                            className="brightness-0 invert"
                                            src="/icon-01.svg"
                                        />
                                    </div>
                                    <h3 className="text-xl font-bold text-slate-900">Tarifs fixes et forfaitaires</h3>
                                    <p className="text-slate-600 leading-relaxed text-sm md:text-base">
                                        Nous vous proposons un transport 100% privatif, avec un tarif forfaitaire transparent connu à l’avance, sans compteur ni surprise.
                                    </p>
                                </div>

                                {/* Feature 2 */}
                                <div className="bg-[#f8fafc] hover:bg-white p-8 md:p-9 rounded-2xl border border-slate-200 hover:border-blue-300 transition-all duration-300 shadow-sm hover:shadow-md flex flex-col gap-5">
                                    <div className="relative h-14 w-14 bg-[#0f1f3d] rounded-xl flex items-center justify-center shadow-md">
                                        <img
                                            alt="Bruxelles Icon"
                                            className="brightness-0 invert"
                                            src="/icon-02.svg"
                                        />
                                    </div>
                                    <h3 className="text-xl font-bold text-slate-900">Navettes aéroports Bruxelles</h3>
                                    <p className="text-slate-600 leading-relaxed text-sm md:text-base">
                                        Nous assurons vos transferts 24h/24 vers Bruxelles-Zaventem, Charleroi-Bruxelles Sud, Lille, Schiphol et Paris.
                                    </p>
                                </div>

                                {/* Feature 3 */}
                                <div className="bg-[#f8fafc] hover:bg-white p-8 md:p-9 rounded-2xl border border-slate-200 hover:border-blue-300 transition-all duration-300 shadow-sm hover:shadow-md flex flex-col gap-5">
                                    <div className="relative h-14 w-14 bg-[#0f1f3d] rounded-xl flex items-center justify-center shadow-md">
                                        <img
                                            alt="Confort Icon"
                                            className="brightness-0 invert"
                                            src="/icon-03.svg"
                                        />
                                    </div>
                                    <h3 className="text-xl font-bold text-slate-900">Chauffeurs professionnels</h3>
                                    <p className="text-slate-600 leading-relaxed text-sm md:text-base">
                                        Voyagez à bord de berlines et vans récents avec chauffeur en tenue, prise en charge de vos bagages et accueil personnalisé avec pancarte.
                                    </p>
                                </div>
                            </div>
                        </div>
                    </section>
                </main>

                {/* Footer */}
                <footer className="py-8 bg-slate-100 border-t border-slate-200 text-center text-xs md:text-sm text-slate-600">
                    <div className="max-w-7xl mx-auto px-6 flex flex-col sm:flex-row justify-between items-center gap-4">
                        <p>&copy; {new Date().getFullYear()} AEROCAB. Tous droits réservés.</p>
                        <div className="flex gap-6">
                            <Link href="/" className="hover:text-slate-900 transition-colors font-medium">Accueil</Link>
                            <Link href="/reservation" className="hover:text-slate-900 transition-colors font-medium">Réservation</Link>
                            <a href="https://www.waynium.com" target="_blank" rel="noopener noreferrer" className="hover:text-slate-900 transition-colors">Powered by WAYNIUM</a>
                        </div>
                    </div>
                </footer>
            </div>
        </>
    );
}
