@extends('layouts.master')

@section('title', 'Payment Failed')

@section('content')
<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-lg-6">
            <div class="card shadow-lg text-center">
                <div class="card-body p-5">
                    <div class="mb-4">
                        <i class="bi bi-x-circle-fill text-danger" style="font-size: 5rem;"></i>
                    </div>
                    <h2 class="text-danger mb-3">Payment Failed</h2>
                    <p class="lead text-muted mb-4">
                        Unfortunately, your payment could not be processed
                    </p>

                    @if($transaction->failure_reason)
                        <div class="alert alert-danger mb-4">
                            <strong>Reason:</strong> {{ $transaction->failure_reason }}
                        </div>
                    @endif

                    <div class="bg-light rounded p-4 mb-4">
                        <div class="row g-3">
                            <div class="col-6 text-start">
                                <small class="text-muted">Transaction ID:</small>
                                <p class="mb-0 fw-bold">#{{ $transaction->id }}</p>
                            </div>
                            <div class="col-6 text-end">
                                <small class="text-muted">Attempted Amount:</small>
                                <p class="mb-0 fw-bold">₹{{ number_format($transaction->total_amount, 2) }}</p>
                            </div>
                        </div>
                    </div>

                    <div class="alert alert-info mb-4">
                        <i class="bi bi-info-circle me-2"></i>
                        No charges were made to your account. You can try again or contact support if the issue persists.
                    </div>

                    <div class="d-grid gap-2">
                        <a href="{{ route('seller.promotions.packages') }}" class="btn btn-primary btn-lg">
                            <i class="bi bi-arrow-repeat me-2"></i>Try Again
                        </a>
                        <a href="{{ route('seller.dashboard') }}" class="btn btn-outline-secondary">
                            <i class="bi bi-house me-2"></i>Back to Dashboard
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
