@extends('layouts.app')

@section('title', 
    (\App\Models\Setting::get('site_name') ?: 'My Website') 
    . ' - ' 
    . (\App\Models\Setting::get('seo_contact_title') ?: 'Contact Us')
)

@section('content')
<!-- Hero Section -->
<section class="relative pt-32 pb-20 lg:pt-40 lg:pb-24 overflow-hidden bg-[#0c2340]">
    <div class="container mx-auto px-4 relative z-10 text-center">
        <h1 class="font-serif text-5xl lg:text-6xl text-white mb-6">
            Get in <span class="text-[#c9a84c] italic">Touch</span>
        </h1>
        <p class="text-white/70 max-w-xl mx-auto">We'd love to hear from you. Whether you have a question about our packages, pricing, or anything else, our team is ready to answer all your questions.</p>
    </div>
</section>

<!-- Contact Form Section -->
<section class="py-20 bg-[#f5f1ea]">
    <div class="container mx-auto px-4 max-w-6xl">
        <div class="grid md:grid-cols-5 gap-12 bg-white rounded-3xl overflow-hidden shadow-xl">
            <!-- Info -->
            <div class="md:col-span-2 bg-[#0c2340] text-white p-10 flex flex-col justify-between">
                <div>
                    <h3 class="font-serif text-3xl mb-8">Contact Information</h3>
                    <div class="space-y-6">
                        <div class="flex items-start gap-4">
                            <i data-feather="map-pin" class="w-6 h-6 text-[#c9a84c] shrink-0"></i>
                            <p class="text-white/80 leading-relaxed">{{ \App\Models\Setting::get('site_address', '123 Tourism Street, City, Country') }}</p>
                        </div>
                        <div class="flex items-center gap-4">
                            <i data-feather="phone" class="w-6 h-6 text-[#c9a84c] shrink-0"></i>
                            <p class="text-white/80">{{ \App\Models\Setting::get('site_phone', '+1 234 567 8900') }}</p>
                        </div>
                        <div class="flex items-center gap-4">
                            <i data-feather="mail" class="w-6 h-6 text-[#c9a84c] shrink-0"></i>
                            <p class="text-white/80">{{ \App\Models\Setting::get('site_email', 'info@tourism.com') }}</p>
                        </div>
                    </div>
                </div>
                
                <!-- Social -->
                <div class="mt-12">
                    <h4 class="text-sm uppercase tracking-widest text-white/50 mb-4">Follow Us</h4>
                    <div class="flex gap-4">
                        @if(\App\Models\Setting::get('social_facebook'))
                            <a href="{{ \App\Models\Setting::get('social_facebook') }}" class="w-10 h-10 rounded-full bg-white/10 flex items-center justify-center hover:bg-[#c9a84c] transition-colors"><i data-feather="facebook" class="w-4 h-4"></i></a>
                        @endif
                        @if(\App\Models\Setting::get('social_twitter'))
                            <a href="{{ \App\Models\Setting::get('social_twitter') }}" class="w-10 h-10 rounded-full bg-white/10 flex items-center justify-center hover:bg-[#c9a84c] transition-colors"><i data-feather="twitter" class="w-4 h-4"></i></a>
                        @endif
                        @if(\App\Models\Setting::get('social_instagram'))
                            <a href="{{ \App\Models\Setting::get('social_instagram') }}" class="w-10 h-10 rounded-full bg-white/10 flex items-center justify-center hover:bg-[#c9a84c] transition-colors"><i data-feather="instagram" class="w-4 h-4"></i></a>
                        @endif
                    </div>
                </div>
            </div>
            
            <!-- Form -->
            <div class="md:col-span-3 p-10">
                <h3 class="font-serif text-3xl text-[#0c2340] mb-8">Send us a message</h3>
                
                @if(session('success'))
                    <div class="bg-green-50 text-green-700 p-4 rounded-xl mb-6 flex items-center gap-3">
                        <i data-feather="check-circle" class="w-5 h-5"></i>
                        {{ session('success') }}
                    </div>
                @endif
                
                @if(session('error'))
                    <div class="bg-red-50 text-red-700 p-4 rounded-xl mb-6 flex items-center gap-3">
                        <i data-feather="alert-circle" class="w-5 h-5"></i>
                        {{ session('error') }}
                    </div>
                @endif

                <form action="{{ route('contact.submit') }}" method="POST" class="space-y-6">
                    @csrf
                    <div class="grid md:grid-cols-2 gap-6">
                        <div>
                            <label class="block text-sm font-medium text-[#0c2340]/70 mb-2">Your Name</label>
                            <input type="text" name="name" required class="w-full bg-[#f5f1ea] border-none rounded-xl px-4 py-3 focus:ring-2 focus:ring-[#c9a84c]" placeholder="John Doe">
                            @error('name') <p class="text-red-500 text-xs mt-1">{{ $message }}</p> @enderror
                        </div>
                        <div>
                            <label class="block text-sm font-medium text-[#0c2340]/70 mb-2">Email Address</label>
                            <input type="email" name="email" required class="w-full bg-[#f5f1ea] border-none rounded-xl px-4 py-3 focus:ring-2 focus:ring-[#c9a84c]" placeholder="john@example.com">
                            @error('email') <p class="text-red-500 text-xs mt-1">{{ $message }}</p> @enderror
                        </div>
                    </div>
                    
                    <div class="grid md:grid-cols-2 gap-6">
                        <div>
                            <label class="block text-sm font-medium text-[#0c2340]/70 mb-2">Phone Number</label>
                            <input type="text" name="phone" class="w-full bg-[#f5f1ea] border-none rounded-xl px-4 py-3 focus:ring-2 focus:ring-[#c9a84c]" placeholder="+1 234 567 8900">
                            @error('phone') <p class="text-red-500 text-xs mt-1">{{ $message }}</p> @enderror
                        </div>
                        <div>
                            <label class="block text-sm font-medium text-[#0c2340]/70 mb-2">Subject</label>
                            <input type="text" name="subject" required class="w-full bg-[#f5f1ea] border-none rounded-xl px-4 py-3 focus:ring-2 focus:ring-[#c9a84c]" placeholder="How can we help?">
                            @error('subject') <p class="text-red-500 text-xs mt-1">{{ $message }}</p> @enderror
                        </div>
                    </div>

                    <div>
                        <label class="block text-sm font-medium text-[#0c2340]/70 mb-2">Message</label>
                        <textarea name="message" required rows="5" class="w-full bg-[#f5f1ea] border-none rounded-xl px-4 py-3 focus:ring-2 focus:ring-[#c9a84c]" placeholder="Your message here..."></textarea>
                        @error('message') <p class="text-red-500 text-xs mt-1">{{ $message }}</p> @enderror
                    </div>

                    <button type="submit" class="bg-[#0c2340] text-white px-8 py-3 rounded-full hover:bg-[#c9a84c] transition-colors shadow-lg hover:shadow-xl font-medium inline-flex items-center gap-2">
                        Send Message
                        <i data-feather="send" class="w-4 h-4"></i>
                    </button>
                </form>
            </div>
        </div>
    </div>
</section>
@endsection
