<?php
/**
 * CUSTOMER ORDER CANCELLATION EMAIL TEMPLATE
 * File: templates/email/order-cancellation-customer.php
 */

// Email content
ob_start();
?>

<div class="alert alert-danger">
    <strong>Order Cancelled</strong><br>
    Your order has been cancelled and a full refund has been processed.
</div>

<div class="order-summary">
    <h3>Cancellation Details</h3>
    <p><strong>Order Number:</strong> #<?= $order_number ?></p>
    <p><strong>Item:</strong> <?= htmlspecialchars($item_title) ?></p>
    <p><strong>Cancelled By:</strong> <?= htmlspecialchars($cancelled_by) ?> (<?= $cancelled_by_type ?>)</p>
    <p><strong>Reason:</strong> <?= htmlspecialchars($reason) ?></p>
</div>

<table class="table">
    <tr>
        <th colspan="2" style="background: #f8f9fa;">Refund Summary</th>
    </tr>
    <tr style="font-weight: bold; font-size: 16px;">
        <td>Refund Amount</td>
        <td style="text-align: right; color: #28a745;">₦<?= number_format($refund_amount, 2) ?></td>
    </tr>
</table>

<div class="alert alert-success">
    <strong>Refund Processed Successfully!</strong><br>
    The full amount of <strong>₦<?= number_format($refund_amount, 2) ?></strong> has been refunded to your wallet and is now available for:
    <ul style="margin: 10px 0 0 20px;">
        <li>Withdrawal to your bank account</li>
        <li>Use for future rentals on our platform</li>
    </ul>
</div>

<div class="alert alert-info">
    <strong>What's Next?</strong>
    <ul style="margin: 10px 0 0 20px;">
        <li>Check your wallet balance in your customer dashboard</li>
        <li>Withdraw funds to your bank account anytime</li>
        <li>Browse and book other amazing items on our platform</li>
        <li>Contact support if you have any questions</li>
    </ul>
</div>

<p>We're sorry this booking didn't work out. We hope to serve you better next time!</p>

<?php
$content = ob_get_clean();

// Prepare email data
$email_data = [
    'title' => 'Order Cancelled - #' . $order_number,
    'greeting' => "Hello {$customer_name}!",
    'content' => $content,
    'action_url' => APP_URL . '/customer/wallet.php',
    'action_text' => 'View Wallet',
    'secondary_action_url' => APP_URL . '/items.php',
    'secondary_action_text' => 'Browse Items',
    'footer_note' => 'Need help? Contact our 24/7 customer support team.',
    'signature' => "Best regards,<br>The " . APP_NAME . " Team<br>support@rentidium.com"
];

// Include layout
include 'layout.php';
?>