@extends('layouts.marketing')

@section('title', __('marketing.success.title'))

@section('content')
<div class="min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8">
    @auth
        @if(auth()->user()->email_verified_at)
            <script @if(isset($cspNonce) || request()->attributes->get('csp_script_nonce')) nonce="{{ $cspNonce ?? request()->attributes->get('csp_script_nonce') }}" @endif>
                window.location.href = '/event-admin';
            </script>
            <div class="text-center">
                <div class="spinner-border animate-spin inline-block w-8 h-8 border border-2 border-blue-600 border-t-transparent rounded-full" role="status">
                    <span class="sr-only">{{ __('marketing.success.loading') }}</span>
                </div>
                <p class="mt-2 text-gray-600">{{ __('marketing.success.redirecting') }}</p>
            </div>
        @else
            <div class="max-w-md w-full bg-white rounded-lg shadow-md p-8">
                <div class="text-center">
                    <h2 class="text-2xl font-bold text-gray-900 mb-4">
                        {{ __('marketing.success.verify_email') }}
                    </h2>
                    <p class="text-gray-600 mb-6">
                        {{ __('marketing.success.check_email') }}
                    </p>
                    <form method="POST" action="{{ route('verification.send') }}">
                        @csrf
                        <button type="submit" class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-md font-medium transition duration-300">
                            {{ __('auth.resend_verification') }}
                        </button>
                    </form>
                    <p class="mt-4 text-sm text-gray-600">
                        {{ __('auth.have_account') }} <a href="{{ route('login') }}" class="text-blue-600 hover:text-blue-500">{{ __('auth.login') }}</a>
                    </p>
                </div>
            </div>
        @endif
    @else
        <div class="max-w-md w-full bg-white rounded-lg shadow-md p-8">
            <div class="text-center">
                <h2 class="text-2xl font-bold text-gray-900 mb-4">
                    {{ __('marketing.success.complete_purchase') }}
                </h2>
                <p class="text-gray-600 mb-6">
                    {{ __('marketing.success.login_to_continue') }}
                </p>
                <a href="{{ route('login') }}" class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-md font-medium transition duration-300 block mb-2">
                    {{ __('auth.login') }}
                </a>
            </div>
        </div>
    @endauth
</div>
@endsection
