<x-front-layout>
    <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10 lg:py-0 min-h-[85vh] flex items-center">
        <div class="w-full">
            <div class="grid grid-cols-1 lg:grid-cols-12 gap-10 lg:gap-16 items-center">
                
                <!-- Left: Success Message -->
                <div class="lg:col-span-7">
                    <div class="flex items-center gap-3 mb-5">
                        <x-heroicon-s-check-circle class="w-10 h-10 sm:w-12 sm:h-12 text-green-500 drop-shadow-sm flex-shrink-0" />
                        <h1 class="text-2xl sm:text-3xl lg:text-4xl font-extrabold text-gray-900 tracking-tight leading-tight whitespace-nowrap lg:whitespace-normal">Transaksi Berhasil!</h1>
                    </div>
                    
                    <p class="text-base text-gray-600 mb-8 leading-relaxed max-w-lg">
                        Terima kasih! Pembayaran Anda untuk <strong>{{ $order->product->name ?? 'Produk Premium' }}</strong> telah masuk ke antrean verifikasi kami.
                    </p>
                    
                    <div class="inline-flex flex-col mb-8 p-4 bg-orange-50/50 rounded-xl border border-orange-100 w-auto">
                        <span class="text-[10px] sm:text-xs font-bold text-orange-500 uppercase tracking-widest mb-1.5">Nomor Pesanan</span>
                        <span class="text-xl sm:text-2xl font-mono font-bold text-orange-700 select-all">{{ $order->order_code }}</span>
                    </div>

                    <div class="flex flex-col sm:flex-row gap-3">
                        <a href="{{ route('dashboard.order.show', $order) }}" class="inline-flex items-center justify-center px-6 py-3.5 text-sm font-bold rounded-xl text-white bg-orange-600 hover:bg-orange-700 transition shadow-sm">
                            <x-heroicon-s-eye class="w-4 h-4 mr-2 opacity-80" />
                            Cek Status di Dashboard
                        </a>
                        <a href="{{ route('home') }}" class="inline-flex items-center justify-center px-6 py-3.5 text-sm font-bold rounded-xl text-gray-700 bg-white hover:bg-gray-50 border border-gray-200 transition shadow-sm">
                            Pilih Produk Lainnya
                        </a>
                    </div>
                </div>

                <!-- Right: Instructions / Next Steps -->
                <div class="lg:col-span-5 bg-gray-50 rounded-2xl p-6 sm:p-8 border border-gray-100">
                    <h3 class="font-bold text-base sm:text-lg text-gray-900 mb-6 pb-4 border-b border-gray-200/70">Langkah Selanjutnya</h3>
                    
                    <ul class="space-y-6">
                        <li class="flex gap-4">
                            <div class="flex-shrink-0 w-8 h-8 rounded-lg bg-white border border-gray-200 flex items-center justify-center text-orange-600 text-sm font-bold shadow-sm">1</div>
                            <div>
                                <h4 class="font-bold text-sm text-gray-900">Verifikasi Admin</h4>
                                <p class="text-xs text-gray-500 mt-1 leading-relaxed">Laporan pembayaran akan dicek manual dalam waktu maksimal 1x24 jam.</p>
                            </div>
                        </li>
                        <li class="flex gap-4">
                            <div class="flex-shrink-0 w-8 h-8 rounded-lg bg-white border border-gray-200 flex items-center justify-center text-orange-600 text-sm font-bold shadow-sm">2</div>
                            <div>
                                <h4 class="font-bold text-sm text-gray-900">Persetujuan Kelayakan</h4>
                                <p class="text-xs text-gray-500 mt-1 leading-relaxed">Setelah dana terverifikasi sah, status otomatis akan diverifikasi menjadi "Lunas".</p>
                            </div>
                        </li>
                        <li class="flex gap-4">
                            <div class="flex-shrink-0 w-8 h-8 rounded-lg bg-white border border-gray-200 flex items-center justify-center text-orange-600 text-sm font-bold shadow-sm">3</div>
                            <div>
                                <h4 class="font-bold text-sm text-gray-900">Akses Unduhan Final</h4>
                                <p class="text-xs text-gray-500 mt-1 leading-relaxed">Produk siap diunduh sepenuhnya dan selamanya lewat panel Dashboard Anda.</p>
                            </div>
                        </li>
                    </ul>

                    @if(\App\Models\Setting::where('key', 'whatsapp_number')->value('value'))
                    @php
                        $waClean = preg_replace('/[^0-9]/', '', \App\Models\Setting::where('key', 'whatsapp_number')->value('value'));
                        $waLink = "https://wa.me/{$waClean}?text=".urlencode("Halo Admin, tolong segera dicek pesanan saya dengan Order ID: {$order->order_code}. Terima kasih!");
                    @endphp
                    <div class="mt-8 pt-6 border-t border-gray-200/70">
                        <a href="{{ $waLink }}" target="_blank" class="w-full flex items-center justify-center px-6 py-4 bg-[#25D366] text-white text-sm font-extrabold rounded-xl hover:bg-[#1ebd59] transition-all shadow-[0_4px_14px_rgba(37,211,102,0.4)] hover:shadow-[0_6px_20px_rgba(37,211,102,0.5)] transform hover:-translate-y-0.5">
                            <x-heroicon-s-chat-bubble-oval-left-ellipsis class="w-6 h-6 mr-2 animate-bounce" style="animation-duration: 2s;" /> 
                            Konfirmasi Cepat via WA
                        </a>
                        <p class="text-center text-[11px] font-medium text-gray-400 mt-3">Butuh diproses lebih instan? Beri tahu Admin CS kami sekarang juga!</p>
                    </div>
                    @endif
                </div>

            </div>
        </div>
    </div>
</x-front-layout>

