import React from 'react';
import { Link } from '@inertiajs/react';
import { PublicHeader } from '@/Components/PublicHeader';
import { PublicFooter } from '@/Components/PublicFooter';
import { SEOHead } from '@/Components/SEOHead';
import { ServiceCard } from '@/Components/ServiceCard';
import { ArrowLeft, ArrowRight, CheckCircle2 } from 'lucide-react';

interface ServiceShowProps {
    service: any;
    relatedServices: any[];
}

export default function Show({ service, relatedServices }: ServiceShowProps) {
    return (
        <div className="min-h-screen bg-[#060B18] text-slate-100 flex flex-col font-sans">
            <SEOHead
                title={`${service.meta_title || service.title} | Tech in Soul`}
                description={service.meta_description || service.short_description}
            />

            <PublicHeader />

            <main className="flex-grow pt-32 pb-20">
                <div className="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 space-y-8">
                    <Link
                        href="/services"
                        className="inline-flex items-center gap-2 text-xs font-semibold text-slate-400 hover:text-[#00F2FE] transition-colors"
                    >
                        <ArrowLeft className="w-4 h-4" /> Back to All Services
                    </Link>

                    <div>
                        <span className="text-xs font-bold text-[#00F2FE] uppercase tracking-widest block mb-2">
                            {service.category?.name || 'SPECIALIZED SERVICE'}
                        </span>
                        <h1 className="text-4xl sm:text-5xl font-extrabold text-white tracking-tight">
                            {service.title}
                        </h1>
                    </div>

                    <div className="glass-card rounded-2xl p-8 space-y-6">
                        <h3 className="text-xl font-bold text-white">Overview</h3>
                        <p className="text-base text-slate-300 leading-relaxed">
                            {service.short_description}
                        </p>
                        <div className="prose prose-invert max-w-none text-slate-300 leading-relaxed space-y-4">
                            {service.description}
                        </div>
                    </div>

                    {/* Service CTA */}
                    <div className="glass-card rounded-2xl p-8 text-center space-y-4 border border-[#00F2FE]/30">
                        <h3 className="text-2xl font-bold text-white">Interested in {service.title}?</h3>
                        <p className="text-sm text-slate-400 max-w-xl mx-auto">
                            Let's map out your project architecture, deliverables, and timeline with our engineering team.
                        </p>
                        <Link
                            href="/contact"
                            className="btn-aqua px-6 py-3 rounded-xl text-sm font-bold inline-flex items-center gap-2"
                        >
                            Request a Proposal <ArrowRight className="w-4 h-4" />
                        </Link>
                    </div>

                    {/* Related Services */}
                    {relatedServices && relatedServices.length > 0 && (
                        <div className="pt-12 border-t border-slate-800 space-y-6">
                            <h3 className="text-2xl font-bold text-white">Other Services</h3>
                            <div className="grid grid-cols-1 md:grid-cols-3 gap-6">
                                {relatedServices.map((srv) => (
                                    <ServiceCard key={srv.id} service={srv} />
                                ))}
                            </div>
                        </div>
                    )}
                </div>
            </main>

            <PublicFooter />
        </div>
    );
}
