<?php $__env->startSection('body'); ?>

<?php if($recipient === 'client'): ?>
    
    <div class="alert-box alert-success">
        <strong style="color:#15803d;font-size:1rem;">✅ Payment Confirmed!</strong>
        <p style="margin:0.4rem 0 0;color:#166534;">
            Your payment of <strong>₦<?php echo e(number_format($invoice->total, 2)); ?></strong> has been received successfully.
        </p>
    </div>

    <h2>Thank you for your payment!</h2>
    <p>
        This is your payment receipt for invoice <strong><?php echo e($invoice->invoice_number); ?></strong>
        from <strong><?php echo e($invoice->user->business_name); ?></strong>.
    </p>

<?php else: ?>
    
    <div class="alert-box alert-success">
        <strong style="color:#15803d;font-size:1rem;">💰 Payment Received!</strong>
        <p style="margin:0.4rem 0 0;color:#166534;">
            <strong><?php echo e($invoice->client->display_name); ?></strong> has paid
            <strong>₦<?php echo e(number_format($invoice->total, 2)); ?></strong> for
            invoice <strong><?php echo e($invoice->invoice_number); ?></strong>.
        </p>
    </div>

    <h2>You've been paid 🎉</h2>
    <p>
        Great news! A payment has been confirmed on your InvoTrack account.
        Login to view the full payment details.
    </p>
<?php endif; ?>


<div style="background:#f8fafc;border-radius:8px;padding:1.25rem;margin:1.25rem 0;border:1px solid #e2e8f0;">
    <div class="info-grid">
        <div class="info-item">
            <label>Invoice Number</label>
            <div class="value" style="font-family:monospace;"><?php echo e($invoice->invoice_number); ?></div>
        </div>
        <div class="info-item">
            <label>Amount Paid</label>
            <div class="value" style="color:#16a34a;font-size:1.1rem;">₦<?php echo e(number_format($invoice->total, 2)); ?></div>
        </div>
        <div class="info-item">
            <label>Payment Date</label>
            <div class="value"><?php echo e($invoice->paid_at?->format('d/m/Y H:i') ?? now()->format('d/m/Y H:i')); ?></div>
        </div>
        <div class="info-item">
            <label>Payment Method</label>
            <div class="value">Paystack</div>
        </div>
        <?php if($recipient === 'client'): ?>
        <div class="info-item">
            <label>Business</label>
            <div class="value"><?php echo e($invoice->user->business_name); ?></div>
        </div>
        <?php else: ?>
        <div class="info-item">
            <label>Client</label>
            <div class="value"><?php echo e($invoice->client->display_name); ?></div>
        </div>
        <?php endif; ?>
    </div>
</div>

<?php if($recipient === 'owner'): ?>
    <div style="text-align:center;margin:1.5rem 0;">
        <a href="<?php echo e(route('invoices.show', $invoice)); ?>" class="btn-pay" style="background:#1d4ed8;">
            View Invoice →
        </a>
    </div>
<?php else: ?>
    <p style="font-size:0.875rem;color:#64748b;">
        Please keep this email as your payment receipt.
        If you have any questions, contact <strong><?php echo e($invoice->user->business_name); ?></strong>
        <?php if($invoice->user->email): ?> at <a href="mailto:<?php echo e($invoice->user->email); ?>" style="color:#00a651;"><?php echo e($invoice->user->email); ?></a> <?php endif; ?>.
    </p>
<?php endif; ?>

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

<?php echo $__env->make('emails.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\Bunmi\Desktop\crud\resources\views/emails/payment_received.blade.php ENDPATH**/ ?>