
<?php $__env->startSection('content'); ?>
    <div class="page-container">

        <div class="page-title-head d-flex align-items-sm-center flex-sm-row flex-column gap-2">
            <div class="flex-grow-1">
                <h4 class="fs-18 fw-semibold mb-0"><?php echo e($title); ?></h4>
            </div>

            <div class="text-end">
                <?php if (isset($component)) { $__componentOriginalb2c223f2cabdcb0c6da76bfac943142c = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalb2c223f2cabdcb0c6da76bfac943142c = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dashboard.admin.breadcrumbs','data' => ['breadcrumbs' => $breadcrumbs]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard.admin.breadcrumbs'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['breadcrumbs' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($breadcrumbs)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalb2c223f2cabdcb0c6da76bfac943142c)): ?>
<?php $attributes = $__attributesOriginalb2c223f2cabdcb0c6da76bfac943142c; ?>
<?php unset($__attributesOriginalb2c223f2cabdcb0c6da76bfac943142c); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalb2c223f2cabdcb0c6da76bfac943142c)): ?>
<?php $component = $__componentOriginalb2c223f2cabdcb0c6da76bfac943142c; ?>
<?php unset($__componentOriginalb2c223f2cabdcb0c6da76bfac943142c); ?>
<?php endif; ?>
            </div>
        </div>

        <div class="row">
            <?php echo $__env->make('dashboard.admin.user.partials.account_options_and_status', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

            <div class="col-lg-12">
                <?php if (isset($component)) { $__componentOriginal87dd96fabcb1ce9254eda7ff7199227b = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal87dd96fabcb1ce9254eda7ff7199227b = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dashboard.admin.card','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard.admin.card'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
                    <div class="container-fluid">

                        <!-- Header -->
                        <div class="d-flex justify-content-between align-items-center mb-4">
                            <div>
                                <h3 class="fw-bold"><i class="fa-solid fa-credit-card me-2 text-primary"></i> Card Details
                                </h3>
                                <p class="text-muted mb-0">Detailed information about your virtual card</p>
                            </div>
                            <a href="<?php echo e(route('admin.user.card.index', $user->uuid)); ?>"
                                class="btn btn-outline-secondary btn-sm">
                                <i class="fa-solid fa-arrow-left me-1"></i> Back to Cards
                            </a>
                        </div>

                        <!-- Card Summary -->
                        <div class="card shadow-sm border-0 mb-4">
                            <div class="card-body">
                                <div class="row g-4 align-items-center">
                                    <div class="col-md-8">
                                        <h4 class="fw-bold mb-1"><?php echo e($card->card_type); ?> • <?php echo e($card->card_level); ?></h4>
                                        <p class="mb-2 text-muted">
                                            Reference ID: <span
                                                class="fw-bold">#<?php echo e($card->reference_id ?? $card->id); ?></span>
                                        </p>
                                        <p class="mb-0">
                                            <span class="<?php echo e($card->status->badge()); ?>">
                                                <?php echo e($card->status->label()); ?>

                                            </span>
                                        </p>
                                    </div>
                                    <div class="col-md-4 text-md-end">
                                        <div class="bg-light p-3 rounded text-center">
                                            <div class="fw-bold fs-5"><?php echo e($card->card_number); ?>

                                            </div>
                                            <small class="text-muted">Expires
                                                <?php echo e(formatDate($card->expiry_date) ?? 'N/A'); ?></small>
                                            <br>
                                            <small class="text-muted">CVV: <?php echo e($card->cvv ?? '***'); ?></small>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- Card Information -->
                        <div class="row g-4">
                            <!-- Card Details -->
                            <div class="col-md-6">
                                <div class="card border-0 shadow-sm">
                                    <div class="card-header bg-light">
                                        <h5 class="mb-0 fw-bold"><i class="fa-solid fa-id-card me-2 text-primary"></i> Card
                                            Information</h5>
                                    </div>
                                    <div class="card-body">
                                        <p><strong>Type:</strong> <?php echo e($card->card_type); ?></p>
                                        <p><strong>Level:</strong> <?php echo e($card->card_level); ?></p>
                                        <p><strong>Currency:</strong> <?php echo e(cardCurrency($card->currency, 'name')); ?></p>
                                        <p><strong>Daily Limit:</strong>
                                            <?php echo e(cardCurrency($card->currency)); ?><?php echo e(formatAmount($card->daily_limit)); ?>

                                        </p>
                                    </div>
                                </div>
                            </div>

                            <!-- Billing Information -->
                            <div class="col-md-6">
                                <div class="card border-0 shadow-sm">
                                    <div class="card-header bg-light">
                                        <h5 class="mb-0 fw-bold"><i class="fa-solid fa-file-invoice me-2 text-primary"></i>
                                            Billing Information</h5>
                                    </div>
                                    <div class="card-body">
                                        <p><strong>Cardholder:</strong> <?php echo e($card->card_holder_name); ?></p>
                                        <p><strong>Address:</strong> <?php echo e($card->billing_address); ?></p>
                                        <p><strong>City:</strong> <?php echo e($card->city ?? '-'); ?></p>
                                        <p><strong>ZIP / Postal Code:</strong> <?php echo e($card->zip ?? '-'); ?></p>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>

                    <?php if($card->isPending()): ?>
                        <div class="d-flex justify-content-end">
                            <form action="<?php echo e(route('admin.user.card.approved', [$user->uuid, $card->uuid])); ?>"
                                method="POST">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('PATCH'); ?>

                                <button type="submit" name="status" value="active" class="btn btn-success btn-sm me-2">
                                    <i class="fa-solid fa-check me-1"></i> Approve
                                </button>
                            </form>
                            <form action="<?php echo e(route('admin.user.card.rejected', [$user->uuid, $card->uuid])); ?>"
                                method="POST">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('PATCH'); ?>

                                <button type="submit" name="status" value="rejected" class="btn btn-danger btn-sm me-2">
                                    <i class="fa-solid fa-ban me-1"></i> Reject
                                </button>
                            </form>
                        </div>
                    <?php endif; ?>

                    <?php if($card->isActive()): ?>
                        <div class="d-flex justify-content-end">
                            <form action="<?php echo e(route('admin.user.card.blocked', [$user->uuid, $card->uuid])); ?>"
                                method="POST">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('PATCH'); ?>

                                <button type="submit" name="status" value="blocked" class="btn btn-danger btn-sm me-2">
                                    <i class="fa-solid fa-ban me-1"></i> Block
                                </button>
                            </form>
                        </div>
                    <?php elseif($card->isBlocked()): ?>
                        <div class="d-flex justify-content-end">
                            <form action="<?php echo e(route('admin.user.card.unblocked', [$user->uuid, $card->uuid])); ?>"
                                method="POST">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('PATCH'); ?>

                                <button type="submit" name="status" value="active" class="btn btn-success btn-sm me-2">
                                    <i class="fa-solid fa-check me-1"></i> Unblock
                                </button>
                            </form>
                        </div>
                    <?php endif; ?>

                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal87dd96fabcb1ce9254eda7ff7199227b)): ?>
<?php $attributes = $__attributesOriginal87dd96fabcb1ce9254eda7ff7199227b; ?>
<?php unset($__attributesOriginal87dd96fabcb1ce9254eda7ff7199227b); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal87dd96fabcb1ce9254eda7ff7199227b)): ?>
<?php $component = $__componentOriginal87dd96fabcb1ce9254eda7ff7199227b; ?>
<?php unset($__componentOriginal87dd96fabcb1ce9254eda7ff7199227b); ?>
<?php endif; ?>
            </div>
            <!-- end col -->
        </div>
        <!-- end row -->

    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('dashboard.admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\projects\online-banking-v7.0\resources\views/dashboard/admin/user/card/show.blade.php ENDPATH**/ ?>