@extends('layouts.app')
@section('title', 'Contact — MUVR Labs')
@section('content')

<section class="page-hero-light py-5 px-4 px-lg-5">
    <div class="container-fluid">
        <div class="text-brand fw-700 mb-1" style="font-size:.7rem;letter-spacing:2px;text-transform:uppercase">Get In Touch</div>
        <h1 class="fw-800 mb-2" style="font-size:1.6rem;color:var(--brand-dark)">Contact Us</h1>
        <p class="sec-intro">Let us know your requirement and our team will get in touch.</p>
    </div>
</section>

<section class="py-5 px-4 px-lg-5">
    <div class="container-fluid">
        @if(session('success'))
        <div class="alert alert-success mb-4">{{ session('success') }}</div>
        @endif
        <div class="row g-5">
            <div class="col-lg-8">
                <div class="fw-800 mb-4" style="font-size:1rem;color:var(--brand-dark)">Send an Enquiry</div>
                <form method="POST" action="{{ route('enquiry.store') }}" class="p-4 rounded-3" style="background:#f8fafc;border:1px solid var(--border-light)">
                    @csrf
                    <div class="row g-3 mb-3">
                        <div class="col-md-6">
                            <label class="form-label">Name *</label>
                            <input type="text" name="name" class="form-control" required value="{{ old('name') }}">
                        </div>
                        <div class="col-md-6">
                            <label class="form-label">Company</label>
                            <input type="text" name="company" class="form-control" value="{{ old('company') }}">
                        </div>
                        <div class="col-md-6">
                            <label class="form-label">Email *</label>
                            <input type="email" name="email" class="form-control" required value="{{ old('email') }}">
                        </div>
                        <div class="col-md-6">
                            <label class="form-label">Phone</label>
                            <input type="text" name="phone" class="form-control" value="{{ old('phone') }}">
                        </div>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">Requirement Type</label>
                        <div class="row g-2">
                            @foreach(['product' => 'Product Enquiry', 'custom_test_rig' => 'Custom Test Rig', 'engineering_development' => 'Engineering Development', 'partnership' => 'Partnership', 'general' => 'General Enquiry'] as $val => $label)
                            <div class="col-auto">
                                <input type="radio" class="btn-check" name="enquiry_type" id="type_{{ $val }}" value="{{ $val }}" {{ (old('enquiry_type', request('type', 'general')) == $val) ? 'checked' : '' }}>
                                <label class="btn btn-sm" for="type_{{ $val }}" style="border:1px solid #e2e8f0;color:#374151;font-size:.8rem">{{ $label }}</label>
                            </div>
                            @endforeach
                        </div>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">Message *</label>
                        <textarea name="message" class="form-control" rows="5" placeholder="Describe your requirement..." required>{{ old('message') }}</textarea>
                    </div>
                    <button type="submit" class="btn btn-brand px-5">Submit Enquiry</button>
                </form>
            </div>

            <div class="col-lg-4">
                <div class="d-flex flex-column gap-3">
                    @if(!empty($settings['contact_email']))
                    <div class="p-3 rounded-3" style="background:#fff;border:1px solid var(--border-light)">
                        <div class="text-brand fw-700 mb-1" style="font-size:.7rem;letter-spacing:1px;text-transform:uppercase">Email</div>
                        <div class="fw-600" style="font-size:.9rem;color:#374151">{{ $settings['contact_email'] }}</div>
                        <div style="font-size:.78rem;color:#64748b;margin-top:2px">We respond within 1 business day</div>
                    </div>
                    @endif
                    <div class="p-3 rounded-3" style="background:#fff;border:1px solid var(--border-light)">
                        <div class="text-brand fw-700 mb-1" style="font-size:.7rem;letter-spacing:1px;text-transform:uppercase">Products & Sales</div>
                        <div class="fw-600" style="font-size:.9rem;color:#374151">Enquire via form</div>
                        <div style="font-size:.78rem;color:#64748b;margin-top:2px">For AERONIX A100 & ASTM D6646 Rig</div>
                    </div>
                    <div class="p-3 rounded-3" style="background:#fff;border:1px solid var(--border-light)">
                        <div class="text-brand fw-700 mb-1" style="font-size:.7rem;letter-spacing:1px;text-transform:uppercase">Engineering Projects</div>
                        <div class="fw-600" style="font-size:.9rem;color:#374151">Custom requirements</div>
                        <div style="font-size:.78rem;color:#64748b;margin-top:2px">Discuss your development project</div>
                    </div>
                    @if(!empty($settings['google_maps_embed']))
                    <div class="rounded-3 overflow-hidden" style="height:200px">
                        {!! $settings['google_maps_embed'] !!}
                    </div>
                    @else
                    <div class="d-flex align-items-center justify-content-center rounded-3" style="height:120px;background:linear-gradient(135deg,#e8f0fe,#dbeafe);border:1px solid #bfdbfe">
                        <span style="font-size:.85rem;color:#3b82f6;font-weight:600"><i class="bi bi-geo-alt me-1"></i>MUVR Labs Location</span>
                    </div>
                    @endif
                </div>
            </div>
        </div>
    </div>
</section>
@endsection
