<?php
include($_SERVER['DOCUMENT_ROOT'] . "/include/vendor/autoload.php");

use PHPMailer\PHPMailer\PHPMailer;

require_once($_SERVER['DOCUMENT_ROOT'] . "/include/config.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/include/Email/smtp.php");

class USER
{
    private $conn;
}

class pageTitle
{
    public $dashboard = 'Dashboard';
    public function getDashboard()
    {
        return $this->dashboard;
    }
}

class emailMessage
{
    // ─── Shared base template wrapper ────────────────────────────────────────────
    private function baseTemplate($title, $preheader, $content, $APP_NAME, $APP_URL, $SITE_ADDRESS)
    {
        return "<!doctype html>
<html lang='en'>
<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <title>$title</title>
    <style>
        body, table, td, a { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
        table, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; }
        img { border: 0; height: auto; line-height: 100%; outline: none; text-decoration: none; }
        body { margin: 0 !important; padding: 0 !important; background-color: #f0f4f8; }
        .email-wrapper { background-color: #f0f4f8; padding: 40px 20px; }
        .email-container { max-width: 580px; margin: 0 auto; }
        .email-header { text-align: center; padding: 0 0 24px 0; }
        .email-header h1 { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 22px; font-weight: 700; color: #1a202c; letter-spacing: -0.5px; }
        .email-body { background-color: #ffffff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
        .email-top-bar { height: 4px; background: linear-gradient(90deg, #3b82f6, #6366f1); }
        .email-content { padding: 40px 40px 32px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }
        .greeting { font-size: 20px; font-weight: 600; color: #1a202c; margin: 0 0 16px; }
        .body-text { font-size: 15px; color: #4a5568; line-height: 1.7; margin: 0 0 20px; }
        .detail-card { background-color: #f7fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px 24px; margin: 24px 0; }
        .detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #edf2f7; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 14px; }
        .detail-row:last-child { border-bottom: none; padding-bottom: 0; }
        .detail-label { color: #718096; font-weight: 500; }
        .detail-value { color: #1a202c; font-weight: 600; text-align: right; }
        .amount-highlight { font-size: 28px; font-weight: 700; color: #1a202c; text-align: center; padding: 20px; background: #f7fafc; border-radius: 8px; margin: 24px 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }
        .status-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
        .status-processing { background-color: #ebf8ff; color: #2b6cb0; }
        .status-completed { background-color: #f0fff4; color: #276749; }
        .status-pending { background-color: #fffaf0; color: #c05621; }
        .otp-box { text-align: center; margin: 24px 0; }
        .otp-code { display: inline-block; font-size: 36px; font-weight: 700; color: #3b82f6; letter-spacing: 8px; background: #eff6ff; border: 2px dashed #bfdbfe; border-radius: 10px; padding: 16px 32px; font-family: 'Courier New', monospace; }
        .alert-box { border-left: 4px solid #f59e0b; background-color: #fffbeb; border-radius: 0 8px 8px 0; padding: 14px 16px; margin: 20px 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 14px; color: #92400e; }
        .alert-box-blue { border-left: 4px solid #3b82f6; background-color: #eff6ff; border-radius: 0 8px 8px 0; padding: 14px 16px; margin: 20px 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 14px; color: #1e40af; }
        .divider { border: none; border-top: 1px solid #e2e8f0; margin: 28px 0; }
        .sign-off { font-size: 14px; color: #718096; line-height: 1.6; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }
        .email-footer { text-align: center; padding: 24px 20px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }
        .footer-text { font-size: 12px; color: #a0aec0; line-height: 1.6; margin: 0 0 8px; }
        .footer-link { color: #718096; text-decoration: none; }
        .footer-link:hover { text-decoration: underline; }
        @media only screen and (max-width: 600px) {
            .email-content { padding: 28px 24px 24px !important; }
            .amount-highlight { font-size: 22px !important; }
            .otp-code { font-size: 28px !important; letter-spacing: 4px !important; padding: 12px 20px !important; }
        }
    </style>
</head>
<body>
<span style='display:none;font-size:1px;color:#f0f4f8;max-height:0;'>$preheader</span>
<div class='email-wrapper'>
    <div class='email-container'>

        <!-- Header -->
        <div class='email-header'>
            <h1>$APP_NAME</h1>
        </div>

        <!-- Body -->
        <div class='email-body'>
            <div class='email-top-bar'></div>
            <div class='email-content'>
                $content
                <hr class='divider'>
                <p class='sign-off'>Warm regards,<br><strong>$APP_NAME Team</strong></p>
            </div>
        </div>

        <!-- Footer -->
        <div class='email-footer'>
            <p class='footer-text'>$APP_NAME &bull; $SITE_ADDRESS</p>
            <p class='footer-text'>
                &copy; " . date('Y') . " <a href='$APP_URL' class='footer-link'>$APP_NAME</a>. All rights reserved.
            </p>
        </div>

    </div>
</div>
</body>
</html>";
    }

    // ─── Helper: detail row ───────────────────────────────────────────────────────
    private function detailRow($label, $value)
    {
        return "<table role='presentation' width='100%' cellpadding='0' cellspacing='0' style='margin:6px 0;'>
            <tr>
                <td style='font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;font-size:14px;color:#718096;font-weight:500;padding:6px 0;border-bottom:1px solid #edf2f7;width:50%;'>$label</td>
                <td style='font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;font-size:14px;color:#1a202c;font-weight:600;padding:6px 0;border-bottom:1px solid #edf2f7;text-align:right;'>$value</td>
            </tr>
        </table>";
    }

    // ─── 1. Login Notification ────────────────────────────────────────────────────
    public function LoginMsg($full_name, $user_acctno, $APP_NAME, $APP_NUMBER, $APP_EMAIL, $APP_URL, $SITE_ADDRESS)
    {
        $content = "
            <p class='greeting'>Hello, $full_name</p>
            <p class='body-text'>We noticed a new sign-in to your <strong>$APP_NAME</strong> account. Here are the details:</p>

            <div class='detail-card'>
                " . $this->detailRow('Account Number', $user_acctno) . "
                " . $this->detailRow('Status', 'New Login Detected') . "
            </div>

            <p class='body-text'>If this was you, no action is needed — you're all set!</p>

            <div class='alert-box'>
                <strong>Not you?</strong> Contact our support team immediately at <strong>$APP_NUMBER</strong> or email <strong>$APP_EMAIL</strong> to secure your account.
            </div>
        ";

        return $this->baseTemplate("New Login Detected - $APP_NAME", "A new sign-in was detected on your account.", $content, $APP_NAME, $APP_URL, $SITE_ADDRESS);
    }

    // ─── 2. Deposit Notification ──────────────────────────────────────────────────
    public function DepositMsg($full_name, $amount, $trans_type, $trans_status, $refrence_id, $APP_NAME, $APP_URL, $SITE_ADDRESS)
    {
        $formattedAmount = number_format((float)$amount, 2);

        $content = "
            <p class='greeting'>Hello, $full_name</p>
            <p class='body-text'>Your deposit has been received and is being processed. Here is a summary of the transaction:</p>

            <div style='text-align:center;margin:24px 0;'>
                <div style='font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;font-size:13px;color:#718096;margin-bottom:6px;text-transform:uppercase;letter-spacing:1px;'>Amount Deposited</div>
                <div style='font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;font-size:32px;font-weight:700;color:#1a202c;'>\$$formattedAmount</div>
            </div>

            <div class='detail-card'>
                " . $this->detailRow('Transaction Type', ucwords($trans_type)) . "
                " . $this->detailRow('Reference ID', "#$refrence_id") . "
                " . $this->detailRow('Status', ucwords($trans_status)) . "
            </div>

            <p class='body-text'>If you did not initiate this transaction, please contact support immediately.</p>
        ";

        return $this->baseTemplate("Deposit Notification - $APP_NAME", "Your deposit of \$$formattedAmount has been received.", $content, $APP_NAME, $APP_URL, $SITE_ADDRESS);
    }

    // ─── 3. Withdrawal Notification ──────────────────────────────────────────────
    public function WithdrawMsg($full_name, $amount, $trans_type, $trans_status, $refrence_id, $APP_NAME, $APP_URL, $SITE_ADDRESS)
    {
        $formattedAmount = number_format((float)$amount, 2);

        $content = "
            <p class='greeting'>Hello, $full_name</p>
            <p class='body-text'>A withdrawal has been processed on your account. Here is a summary:</p>

            <div style='text-align:center;margin:24px 0;'>
                <div style='font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;font-size:13px;color:#718096;margin-bottom:6px;text-transform:uppercase;letter-spacing:1px;'>Amount Withdrawn</div>
                <div style='font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;font-size:32px;font-weight:700;color:#e53e3e;'>\$$formattedAmount</div>
            </div>

            <div class='detail-card'>
                " . $this->detailRow('Transaction Type', ucwords($trans_type)) . "
                " . $this->detailRow('Reference ID', "#$refrence_id") . "
                " . $this->detailRow('Status', ucwords($trans_status)) . "
            </div>

            <div class='alert-box'>
                If you did not authorize this withdrawal, please contact our support team right away.
            </div>
        ";

        return $this->baseTemplate("Withdrawal Notification - $APP_NAME", "A withdrawal of \$$formattedAmount was processed on your account.", $content, $APP_NAME, $APP_URL, $SITE_ADDRESS);
    }

    // ─── 4. Wire Transfer Notification ───────────────────────────────────────────
    public function WireMsg($full_name, $amount, $account_type, $trans_type, $refrence_id, $swift_code, $routine_number, $bank_country, $bank_name, $trans_status, $account_number, $account_name, $APP_NAME, $APP_URL, $SITE_ADDRESS)
    {
        $formattedAmount = number_format((float)$amount, 2);

        $content = "
            <p class='greeting'>Hello, $full_name</p>
            <p class='body-text'>Your wire transfer has been submitted successfully. Below are the full details of the transaction:</p>

            <div style='text-align:center;margin:24px 0;'>
                <div style='font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;font-size:13px;color:#718096;margin-bottom:6px;text-transform:uppercase;letter-spacing:1px;'>Transfer Amount</div>
                <div style='font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;font-size:32px;font-weight:700;color:#1a202c;'>\$$formattedAmount</div>
            </div>

            <div class='detail-card'>
                " . $this->detailRow('Beneficiary Name', $account_name) . "
                " . $this->detailRow('Account Number', $account_number) . "
                " . $this->detailRow('Account Type', ucwords($account_type)) . "
                " . $this->detailRow('Bank Name', $bank_name) . "
                " . $this->detailRow('Bank Country', $bank_country) . "
                " . ($swift_code ? $this->detailRow('SWIFT / BIC Code', $swift_code) : '') . "
                " . ($routine_number ? $this->detailRow('Routing Number', $routine_number) : '') . "
                " . $this->detailRow('Transfer Type', ucwords($trans_type)) . "
                " . $this->detailRow('Reference ID', "#$refrence_id") . "
                " . $this->detailRow('Status', ucwords($trans_status)) . "
            </div>

            <div class='alert-box-blue'>
                Wire transfers may take 1–3 business days to complete depending on the receiving bank.
            </div>

            <p class='body-text'>If you did not authorize this transaction, please contact our support team immediately.</p>
        ";

        return $this->baseTemplate("Wire Transfer Notification - $APP_NAME", "Your wire transfer of \$$formattedAmount is $trans_status.", $content, $APP_NAME, $APP_URL, $SITE_ADDRESS);
    }

    // ─── 5. Registration Welcome ──────────────────────────────────────────────────
    public function RegisterMsg($full_name, $acct_no, $acct_status, $APP_NAME, $APP_URL, $SITE_ADDRESS)
    {
        $content = "
            <p class='greeting'>Welcome, $full_name!</p>
            <p class='body-text'>Thank you for joining <strong>$APP_NAME</strong>. Your account has been created successfully. Here are your account details:</p>

            <div class='detail-card'>
                " . $this->detailRow('Account Number', $acct_no) . "
                " . $this->detailRow('Account Status', ucwords($acct_status)) . "
            </div>

            <div class='alert-box-blue'>
                Keep your account number safe and never share your login credentials with anyone.
            </div>

            <p class='body-text'>If you need any assistance, our support team is always here to help. Visit us at <a href='$APP_URL' style='color:#3b82f6;text-decoration:none;font-weight:600;'>$APP_URL</a>.</p>
        ";

        return $this->baseTemplate("Welcome to $APP_NAME", "Your $APP_NAME account is ready.", $content, $APP_NAME, $APP_URL, $SITE_ADDRESS);
    }

    // ─── 6. Local Transfer Notification ───────────────────────────────────────
    public function DomMsg($full_name, $amount, $account_number, $account_name, $account_type, $bank_country, $trans_type, $refrence_id, $trans_status, $APP_NAME, $APP_URL, $SITE_ADDRESS)
    {
        $formattedAmount = number_format((float)$amount, 2);

        $content = "
            <p class='greeting'>Hello, $full_name</p>
            <p class='body-text'>Your Local transfer has been submitted. Here is a full summary of the transaction:</p>

            <div style='text-align:center;margin:24px 0;'>
                <div style='font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;font-size:13px;color:#718096;margin-bottom:6px;text-transform:uppercase;letter-spacing:1px;'>Transfer Amount</div>
                <div style='font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;font-size:32px;font-weight:700;color:#1a202c;'>\$$formattedAmount</div>
            </div>

            <div class='detail-card'>
                " . $this->detailRow('Beneficiary Name', $account_name) . "
                " . $this->detailRow('Account Number', $account_number) . "
                " . $this->detailRow('Account Type', ucwords($account_type)) . "
                " . $this->detailRow('Country', $bank_country) . "
                " . $this->detailRow('Transfer Type', ucwords($trans_type)) . "
                " . $this->detailRow('Reference ID', "#$refrence_id") . "
                " . $this->detailRow('Status', ucwords($trans_status)) . "
            </div>

            <p class='body-text'>If you did not authorize this transaction, please contact our support team immediately.</p>
        ";

        return $this->baseTemplate("Local Transfer Notification - $APP_NAME", "Your Local transfer of \$$formattedAmount is $trans_status.", $content, $APP_NAME, $APP_URL, $SITE_ADDRESS);
    }

    // ─── 7. OTP / Pin Request ─────────────────────────────────────────────────────
    public function pinRequest($full_name, $acct_otp, $APP_NAME, $APP_URL, $SITE_ADDRESS)
    {
        $content = "
            <p class='greeting'>Hello, $full_name</p>
            <p class='body-text'>You requested a one-time verification code to complete your transaction. Use the code below:</p>

            <div class='otp-box'>
                <div class='otp-code'>$acct_otp</div>
            </div>

            <div class='alert-box'>
                <strong>This code expires in 10 minutes.</strong> Never share this code with anyone — $APP_NAME will never ask for it.
            </div>

            <p class='body-text'>If you did not request this code, please ignore this email or contact support if you have concerns.</p>
        ";

        return $this->baseTemplate("Your Verification Code - $APP_NAME", "Your one-time verification code is inside.", $content, $APP_NAME, $APP_URL, $SITE_ADDRESS);
    }

    // ─── 8. Interbank Transfer Notification ──────────────────────────────────────
    public function InterMsg($full_name, $amount, $account_number, $account_name, $refrence_id, $trans_type, $trans_status, $APP_NAME, $APP_URL, $SITE_ADDRESS)
    {
        $formattedAmount = number_format((float)$amount, 2);

        $content = "
            <p class='greeting'>Hello, $full_name</p>
            <p class='body-text'>Your interbank transfer has been submitted. Here is a summary of the transaction:</p>

            <div style='text-align:center;margin:24px 0;'>
                <div style='font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;font-size:13px;color:#718096;margin-bottom:6px;text-transform:uppercase;letter-spacing:1px;'>Transfer Amount</div>
                <div style='font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;font-size:32px;font-weight:700;color:#1a202c;'>\$$formattedAmount</div>
            </div>

            <div class='detail-card'>
                " . $this->detailRow('Beneficiary Name', $account_name) . "
                " . $this->detailRow('Account Number', $account_number) . "
                " . $this->detailRow('Transfer Type', ucwords($trans_type)) . "
                " . $this->detailRow('Reference ID', "#$refrence_id") . "
                " . $this->detailRow('Status', ucwords($trans_status)) . "
            </div>

            <p class='body-text'>If you did not authorize this transaction, please contact our support team immediately.</p>
        ";

        return $this->baseTemplate("Interbank Transfer Notification - $APP_NAME", "Your interbank transfer of \$$formattedAmount is $trans_status.", $content, $APP_NAME, $APP_URL, $SITE_ADDRESS);
    }

    // ─── 9. Stock Purchase Notification ──────────────────────────────────────────
    public function StockMsg($full_name, $amount, $account_name, $APP_NAME, $trans_type, $trans_status, $refrence_id, $APP_URL, $SITE_ADDRESS)
    {
        $formattedAmount = number_format((float)$amount, 2);

        $content = "
            <p class='greeting'>Hello, $full_name</p>
            <p class='body-text'>Your stock purchase order has been placed. Here is a summary:</p>

            <div class='detail-card'>
                " . $this->detailRow('Stock / Asset', $account_name) . "
                " . $this->detailRow('Amount', "\$$formattedAmount") . "
                " . $this->detailRow('Transaction Type', ucwords($trans_type)) . "
                " . $this->detailRow('Reference ID', "#$refrence_id") . "
                " . $this->detailRow('Status', ucwords($trans_status)) . "
            </div>

            <div class='alert-box-blue'>
                Stock orders may take time to settle depending on market conditions.
            </div>

            <p class='body-text'>If you did not place this order, please contact our support team immediately.</p>
        ";

        return $this->baseTemplate("Stock Purchase Notification - $APP_NAME", "Your stock purchase of \$$formattedAmount is $trans_status.", $content, $APP_NAME, $APP_URL, $SITE_ADDRESS);
    }

    // ─── 10. Loan Request Notification ───────────────────────────────────────────
    public function LoanMsg($full_name, $amount, $user_acctno, $trans_type, $trans_status, $APP_NAME, $APP_URL, $SITE_ADDRESS)
    {
        $formattedAmount = number_format((float)$amount, 2);

        $content = "
            <p class='greeting'>Hello, $full_name</p>
            <p class='body-text'>Your loan request has been received and is currently under review. Here are the details:</p>

            <div class='detail-card'>
                " . $this->detailRow('Loan Amount', "\$$formattedAmount") . "
                " . $this->detailRow('Account Number', $user_acctno) . "
                " . $this->detailRow('Request Type', ucwords($trans_type)) . "
                " . $this->detailRow('Status', ucwords($trans_status)) . "
            </div>

            <div class='alert-box-blue'>
                Our team will review your application and get back to you shortly.
            </div>

            <p class='body-text'>If you have any questions about your loan application, please do not hesitate to reach out to our support team.</p>
        ";

        return $this->baseTemplate("Loan Request Notification - $APP_NAME", "Your loan request of \$$formattedAmount is $trans_status.", $content, $APP_NAME, $APP_URL, $SITE_ADDRESS);
    }

    // ─── 11. Password Change Notification ────────────────────────────────────────
    public function PasswordMsg($full_name, $user_acctno, $APP_NAME, $APP_URL, $SITE_ADDRESS)
    {
        $content = "
            <p class='greeting'>Hello, $full_name</p>
            <p class='body-text'>Your <strong>$APP_NAME</strong> account password was recently changed.</p>

            <div class='detail-card'>
                " . $this->detailRow('Account Number', $user_acctno) . "
                " . $this->detailRow('Action', 'Password Changed') . "
            </div>

            <p class='body-text'>If this was you, no further action is required — you're all set.</p>

            <div class='alert-box'>
                <strong>Not you?</strong> Contact our support team immediately to regain access and secure your account.
            </div>
        ";

        return $this->baseTemplate("Password Changed - $APP_NAME", "Your account password was recently changed.", $content, $APP_NAME, $APP_URL, $SITE_ADDRESS);
    }

    // ─── 12. PIN Change Notification ─────────────────────────────────────────────
    public function PinMsg($full_name, $user_acctno, $APP_NAME, $APP_URL, $SITE_ADDRESS)
    {
        $content = "
            <p class='greeting'>Hello, $full_name</p>
            <p class='body-text'>Your <strong>$APP_NAME</strong> account PIN was recently changed.</p>

            <div class='detail-card'>
                " . $this->detailRow('Account Number', $user_acctno) . "
                " . $this->detailRow('Action', 'PIN Changed') . "
            </div>

            <p class='body-text'>If this was you, no further action is required — you're all set.</p>

            <div class='alert-box'>
                <strong>Not you?</strong> Contact our support team immediately to secure your account.
            </div>
        ";

        return $this->baseTemplate("PIN Changed - $APP_NAME", "Your account PIN was recently changed.", $content, $APP_NAME, $APP_URL, $SITE_ADDRESS);
    }

    // ─── 13. Card Request Notification ───────────────────────────────────────────
    public function CardMsg($full_name, $card_name, $user_acctno, $amount, $card_status, $APP_NAME, $APP_URL, $SITE_ADDRESS)
    {
        $formattedAmount = number_format((float)$amount, 2);

        $content = "
            <p class='greeting'>Hello, $full_name</p>
            <p class='body-text'>Your card request has been processed. Here are the details:</p>

            <div class='detail-card'>
                " . $this->detailRow('Card Type', $card_name) . "
                " . $this->detailRow('Account Number', $user_acctno) . "
                " . $this->detailRow('Fee Charged', "\$$formattedAmount") . "
                " . $this->detailRow('Status', ucwords($card_status)) . "
            </div>

            <div class='alert-box-blue'>
                Your card will be processed and delivered as per our standard timelines.
            </div>

            <p class='body-text'>If you did not make this request, please contact our support team immediately.</p>
        ";

        return $this->baseTemplate("Card Request Notification - $APP_NAME", "Your card request is $card_status.", $content, $APP_NAME, $APP_URL, $SITE_ADDRESS);
    }

    // ─── 14. Support Ticket Notification ─────────────────────────────────────────
    public function TicketMsg($full_name, $user_acctno, $ticket_message, $ticket_status, $APP_NAME, $APP_URL, $SITE_ADDRESS)
    {
        $content = "
            <p class='greeting'>Hello, $full_name</p>
            <p class='body-text'>We have an update on your support ticket. Here are the details:</p>

            <div class='detail-card'>
                " . $this->detailRow('Account Number', $user_acctno) . "
                " . $this->detailRow('Ticket Status', ucwords($ticket_status)) . "
            </div>

            <div style='background:#f7fafc;border:1px solid #e2e8f0;border-radius:8px;padding:16px 20px;margin:20px 0;'>
                <div style='font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;font-size:12px;color:#718096;text-transform:uppercase;letter-spacing:0.5px;margin-bottom:8px;font-weight:600;'>Message from Support</div>
                <div style='font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;font-size:15px;color:#2d3748;line-height:1.6;'>$ticket_message</div>
            </div>

            <p class='body-text'>If you have further questions, please reply to this email or visit our support portal.</p>
        ";

        return $this->baseTemplate("Support Ticket Update - $APP_NAME", "There is an update on your support ticket.", $content, $APP_NAME, $APP_URL, $SITE_ADDRESS);
    }
}