@extends('layouts.site')

@section('meta')
    <meta name="description" content="Training registration confirmation">
@endsection

@section('content')
{{-- Hero Section --}}
<div class="bg-gradient-to-r from-green-600 to-green-700 shadow-lg">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
        <div class="flex items-center gap-6">
            <div class="hidden md:flex w-20 h-20 rounded-xl shadow-lg bg-white/20 items-center justify-center flex-shrink-0">
                <i class="fas fa-check-circle text-white text-3xl"></i>
            </div>
            <div>
                <h1 class="text-3xl md:text-4xl font-serif font-bold text-white">Registration Confirmed</h1>
                <p class="text-green-100 mt-2">Your training application has been received successfully.</p>
            </div>
        </div>
    </div>
</div>

{{-- Breadcrumb --}}
<div class="bg-gray-50 border-b border-gray-200">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-3">
        <nav class="flex items-center space-x-2 text-sm text-gray-600" aria-label="Breadcrumb">
            <a href="{{ url('/') }}" class="hover:text-green-600 transition flex items-center">
                <i class="fas fa-home mr-1"></i>Home
            </a>
            <i class="fas fa-chevron-right text-gray-400 text-xs"></i>
            <a href="{{ route('public.training.index') }}" class="hover:text-green-600 transition">Training Programs</a>
            <i class="fas fa-chevron-right text-gray-400 text-xs"></i>
            <span class="text-gray-900 font-medium">Registration Confirmed</span>
        </nav>
    </div>
</div>

<section class="bg-gray-50 py-12">
    <div class="container mx-auto px-4">
        <div class="max-w-lg mx-auto text-center">
            <div class="bg-white rounded-2xl shadow-lg p-8">
                {{-- Success Icon --}}
                <div class="w-24 h-24 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6">
                    <i class="fas fa-check-circle text-green-500 text-5xl"></i>
                </div>

                <h1 class="text-2xl font-bold text-gray-800 mb-3">Registration Submitted!</h1>
                <p class="text-gray-600 mb-6">
                    Thank you for registering for <strong>{{ $package->name }}</strong>. 
                    Your application has been received.
                </p>

                {{-- Registration Details --}}
                <div class="bg-gray-50 rounded-lg p-4 mb-6 text-left">
                    <h3 class="font-semibold text-gray-800 mb-3 text-center">Registration Summary</h3>
                    <div class="space-y-2 text-sm">
                        <div class="flex justify-between">
                            <span class="text-gray-500">Program:</span>
                            <span class="font-medium text-gray-800">{{ $package->name }}</span>
                        </div>
                        <div class="flex justify-between">
                            <span class="text-gray-500">Name:</span>
                            <span class="text-gray-800">{{ $registration->user->name }}</span>
                        </div>
                        <div class="flex justify-between">
                            <span class="text-gray-500">Email:</span>
                            <span class="text-gray-800">{{ $registration->user->email }}</span>
                        </div>
                        <div class="flex justify-between">
                            <span class="text-gray-500">Date:</span>
                            <span class="text-gray-800">{{ $registration->registration_date->format('M d, Y') }}</span>
                        </div>
                        @if(!$package->is_free)
                            <div class="flex justify-between">
                                <span class="text-gray-500">Fee:</span>
                                <span class="font-medium text-gray-800">{{ number_format($package->fee_amount, 0) }} UGX</span>
                            </div>
                        @endif
                    </div>
                </div>

                {{-- Status Info --}}
                @if($package->requires_approval)
                    <div class="bg-yellow-50 border border-yellow-200 rounded-lg p-4 mb-6">
                        <div class="flex items-start gap-3">
                            <i class="fas fa-clock text-yellow-600 mt-1"></i>
                            <div class="text-left">
                                <p class="font-medium text-yellow-800">Awaiting Approval</p>
                                <p class="text-sm text-yellow-700">
                                    Your registration is being reviewed. You will receive an email notification 
                                    once your registration is approved.
                                </p>
                            </div>
                        </div>
                    </div>
                @else
                    <div class="bg-green-50 border border-green-200 rounded-lg p-4 mb-6">
                        <div class="flex items-center justify-center gap-2">
                            <i class="fas fa-check-circle text-green-600"></i>
                            <span class="font-medium text-green-800">Your registration is confirmed!</span>
                        </div>
                    </div>
                @endif

                {{-- Next Steps --}}
                <div class="text-left mb-6">
                    <h4 class="font-medium text-gray-800 mb-3">What's Next?</h4>
                    <ul class="space-y-2 text-sm text-gray-600">
                        <li class="flex items-start gap-2">
                            <i class="fas fa-check text-green-500 mt-1"></i>
                            Check your email for a confirmation message
                        </li>
                        <li class="flex items-start gap-2">
                            <i class="fas fa-check text-green-500 mt-1"></i>
                            You will receive training schedule details
                        </li>
                        @if($package->generates_certificate)
                            <li class="flex items-start gap-2">
                                <i class="fas fa-check text-green-500 mt-1"></i>
                                Certificate will be issued upon completion
                            </li>
                        @endif
                    </ul>
                </div>

                {{-- Actions --}}
                <div class="flex flex-col sm:flex-row gap-3">
                    <a href="{{ route('public.training.index') }}" 
                       class="flex-1 text-center px-6 py-3 bg-green-600 text-white rounded-lg hover:bg-green-700 transition">
                        <i class="fas fa-list mr-2"></i>
                        Browse Programs
                    </a>
                    <a href="{{ route('home') }}" 
                       class="flex-1 text-center px-6 py-3 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition">
                        <i class="fas fa-home mr-2"></i>
                        Go Home
                    </a>
                </div>
            </div>

            {{-- Confirmation Note --}}
            <div class="mt-6 text-sm text-gray-500">
                <p>
                    <i class="fas fa-envelope mr-1"></i>
                    A confirmation email has been sent to {{ $registration->user->email }}
                </p>
            </div>
        </div>
    </div>
</section>
@endsection
