@extends('layouts.app')

@section('title', 'Contact')

@section('content')
@include('components.page-banner', [
'title' => 'Contactez-nous',
//'subtitle' => 'Nous sommes à votre écoute',
'image' => 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=1920&q=80'
])

{{-- Formulaire et coordonnées --}}
<section class="py-20 bg-white">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        @if(session('success'))
        <div class="mb-8 p-4 rounded-xl bg-green-50 border border-green-200 text-green-800 flex items-center gap-3">
            <svg class="w-6 h-6 text-green-500 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
            {{ session('success') }}
        </div>
        @endif

        @if($errors->any())
        <div class="mb-8 p-4 rounded-xl bg-red-50 border border-red-200 text-red-800">
            <p class="font-medium mb-2">Veuillez corriger les erreurs suivantes :</p>
            <ul class="list-disc list-inside space-y-1">
                @foreach($errors->all() as $error)
                <li>{{ $error }}</li>
                @endforeach
            </ul>
        </div>
        @endif

        <div class="grid grid-cols-1 lg:grid-cols-2 gap-16 items-start">
            {{-- Formulaire --}}
            <div class="order-2 lg:order-1">
                <div class="mb-8">
                    <span class="inline-block px-4 py-1.5 rounded-full bg-amber-100 text-amber-700 text-sm font-semibold mb-4">Contact</span>
                    <h2 class="text-3xl font-bold text-slate-800 mb-2">Envoyez-nous un message</h2>
                    <p class="text-slate-600">Remplissez le formulaire ci-dessous et nous vous répondrons dans les plus brefs délais.</p>
                </div>

                <form action="{{ route('contact.store') }}" method="POST" class="space-y-6">
                    @csrf
                    <div class="grid grid-cols-1 sm:grid-cols-2 gap-6">
                        <div>
                            <label for="nom" class="block text-sm font-medium text-slate-700 mb-2">Nom complet <span class="text-amber-500">*</span></label>
                            <input type="text" name="nom" id="nom" value="{{ old('nom') }}" required placeholder="Votre nom" class="w-full px-4 py-3 rounded-xl border border-slate-200 focus:ring-2 focus:ring-amber-500 focus:border-amber-500 transition-shadow placeholder-slate-400">
                            @error('nom')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                        </div>
                        <div>
                            <label for="email" class="block text-sm font-medium text-slate-700 mb-2">Email <span class="text-amber-500">*</span></label>
                            <input type="email" name="email" id="email" value="{{ old('email') }}" required placeholder="votre@email.com" class="w-full px-4 py-3 rounded-xl border border-slate-200 focus:ring-2 focus:ring-amber-500 focus:border-amber-500 transition-shadow placeholder-slate-400">
                            @error('email')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                        </div>
                    </div>
                    <div class="grid grid-cols-1 sm:grid-cols-2 gap-6">
                        <div>
                            <label for="telephone" class="block text-sm font-medium text-slate-700 mb-2">Téléphone</label>
                            <input type="tel" name="telephone" id="telephone" value="{{ old('telephone') }}" placeholder="+225 XX XX XX XX XX" class="w-full px-4 py-3 rounded-xl border border-slate-200 focus:ring-2 focus:ring-amber-500 focus:border-amber-500 transition-shadow placeholder-slate-400">
                            @error('telephone')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                        </div>
                        <div>
                            <label for="sujet" class="block text-sm font-medium text-slate-700 mb-2">Sujet</label>
                            <input type="text" name="sujet" id="sujet" value="{{ old('sujet') }}" placeholder="Objet de votre message" class="w-full px-4 py-3 rounded-xl border border-slate-200 focus:ring-2 focus:ring-amber-500 focus:border-amber-500 transition-shadow placeholder-slate-400">
                            @error('sujet')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                        </div>
                    </div>
                    <div>
                        <label for="message" class="block text-sm font-medium text-slate-700 mb-2">Message <span class="text-amber-500">*</span></label>
                        <textarea name="message" id="message" rows="5" required placeholder="Décrivez votre projet ou demande..." class="w-full px-4 py-3 rounded-xl border border-slate-200 focus:ring-2 focus:ring-amber-500 focus:border-amber-500 transition-shadow placeholder-slate-400 resize-none">{{ old('message') }}</textarea>
                        @error('message')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                    </div>
                    <button type="submit" class="w-full sm:w-auto sm:min-w-[200px] bg-amber-500 hover:bg-amber-600 text-white py-4 px-8 rounded-xl font-semibold transition shadow-lg shadow-amber-500/25 hover:shadow-amber-500/40 flex items-center justify-center gap-2">
                        <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8" /></svg>
                        Envoyer le message
                    </button>
                </form>
            </div>

            {{-- Coordonnées --}}
            <div class="order-1 lg:order-2">
                <div class="bg-slate-50 rounded-2xl p-8 border border-slate-100 shadow-sm sticky top-28">
                    <h3 class="font-bold text-slate-800 text-xl mb-6">Nos coordonnées</h3>
                    <div class="space-y-6">
                        <div class="flex gap-4">
                            <div class="w-12 h-12 rounded-xl bg-amber-500/20 flex items-center justify-center shrink-0">
                                <svg class="w-6 h-6 text-amber-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" />
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z" /></svg>
                            </div>
                            <div>
                                <p class="font-medium text-slate-800">Adresse</p>
                                <p class="text-slate-600">BOUAFLE-QUARTIER KABALA , non loin de
                                    l’église assemblée de Dieu</p>
                                <a href="https://www.google.com/maps" target="_blank" rel="noopener" class="text-amber-600 hover:text-amber-700 text-sm font-medium mt-1 inline-flex items-center gap-1">
                                    Voir sur la carte
                                    <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" /></svg>
                                </a>
                            </div>
                        </div>
                        <div class="flex gap-4">
                            <div class="w-12 h-12 rounded-xl bg-amber-500/20 flex items-center justify-center shrink-0">
                                <svg class="w-6 h-6 text-amber-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" /></svg>
                            </div>
                            <div>
                                <p class="font-medium text-slate-800">Email</p>
                                <a href="mailto:emelec.dgi@gmail.com" class="text-slate-600 hover:text-amber-600 transition">emelec.dgi@gmail.com </a>
                            </div>
                        </div>
                        <div class="flex gap-4">
                            <div class="w-12 h-12 rounded-xl bg-amber-500/20 flex items-center justify-center shrink-0">
                                <svg class="w-6 h-6 text-amber-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" /></svg>
                            </div>
                            <div>
                                <p class="font-medium text-slate-800">Téléphone</p>
                                <a href="tel:+2250787664033" class="text-slate-600 hover:text-amber-600 transition">+225 07 87 66 40 33 | +225 01 01 50 65 31</a>
                            </div>
                        </div>
                        <div class="flex gap-4">
                            <div class="w-12 h-12 rounded-xl bg-amber-500/20 flex items-center justify-center shrink-0">
                                <svg class="w-6 h-6 text-amber-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" /></svg>
                            </div>
                            <div>
                                // addresse of the company
                                <p class="font-medium text-slate-800">Addresse</p>
                                <p class="text-slate-600"> BOUAFLE-QUARTIER KABALA , non loin de
                                    l’église assemblée de Dieu</p>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
</section>

{{-- Google Maps --}}
<section class="bg-slate-100">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
        <div class="text-center mb-8">
            <h2 class="text-2xl md:text-3xl font-bold text-slate-800 mb-2">Nous trouver</h2>
            <p class="text-slate-600">Visitez notre siège ou planifiez votre visite</p>
        </div>
        <div class="rounded-2xl overflow-hidden shadow-xl border border-slate-200 h-[400px] md:h-[450px]">
            {{-- Remplacez l'URL par votre embed Google Maps (Partager > Intégrer une carte) --}}
            <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d31681.517886990372!2d-5.779409750135197!3d6.986917995875711!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0xfb9011f46971301%3A0x423de714eef57dd7!2sEglise%20Evangelique%20des%20assembl%C3%A9es%20de%20Dieu!5e0!3m2!1sfr!2sci!4v1771338595619!5m2!1sfr!2sci" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
        </div>
    </div>
</section>
@endsection
