<x-admin-layout title="Contact Submission">
    <x-admin.form-panel :back-route="route('admin.contact-submissions.index')">
        <div class="space-y-4">
            <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
                <div>
                    <p class="text-sm text-gray-500">Name</p>
                    <p class="font-medium text-gray-800">{{ trim($item->first_name.' '.$item->last_name) }}</p>
                </div>
                <div>
                    <p class="text-sm text-gray-500">Email</p>
                    <p class="font-medium text-gray-800">{{ $item->email }}</p>
                </div>
                <div>
                    <p class="text-sm text-gray-500">Phone</p>
                    <p class="font-medium text-gray-800">{{ $item->phone ?? '—' }}</p>
                </div>
                <div>
                    <p class="text-sm text-gray-500">Interest</p>
                    <p class="font-medium text-gray-800">{{ $item->interest }}</p>
                </div>
                <div>
                    <p class="text-sm text-gray-500">Submitted</p>
                    <p class="font-medium text-gray-800">{{ $item->created_at?->format('Y-m-d H:i') }}</p>
                </div>
                <div>
                    <p class="text-sm text-gray-500">IP Address</p>
                    <p class="font-medium text-gray-800">{{ $item->ip_address ?? '—' }}</p>
                </div>
            </div>
            <div>
                <p class="text-sm text-gray-500">Message</p>
                <p class="mt-1 text-gray-800 whitespace-pre-wrap">{{ $item->message }}</p>
            </div>
            <div class="flex gap-3 pt-4 border-t border-gray-100">
                <form action="{{ route('admin.contact-submissions.destroy', $item) }}" method="POST" onsubmit="return confirm('Delete?')">
                    @csrf
                    @method('DELETE')
                    <button type="submit" class="admin-btn-secondary text-red-600 border-red-200 hover:bg-red-50">Delete</button>
                </form>
            </div>
        </div>
    </x-admin.form-panel>
</x-admin-layout>
