<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>TrueTrucker Notification</title>
</head>
<body style="font-family: Arial, sans-serif; color: #111827; line-height: 1.6; margin: 0; padding: 0; background-color: #f3f4f6;">
    <table width="100%" cellpadding="0" cellspacing="0" role="presentation">
        <tr>
            <td align="center" style="padding: 24px;">
                <table width="600" cellpadding="0" cellspacing="0" role="presentation" style="background: #ffffff; border-radius: 16px; overflow: hidden; box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);">
                    <tr>
                        <td style="background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%); padding: 32px 28px; text-align: left; color: white;">
                            <p style="margin: 0; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; opacity: 0.86;">TrueTrucker Alert</p>
                            <h1 style="margin: 10px 0 0 0; font-size: 26px; line-height: 1.1;">New Signup Notification</h1>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding: 32px 30px 24px;">
                            <p style="margin: 0 0 20px 0; font-size: 15px; color: #111827;">A new user has signed up and the admin team has been notified.</p>

                            <table cellpadding="0" cellspacing="0" width="100%" role="presentation" style="border-collapse: collapse;">
                                <tbody>
                                    <tr>
                                        <td style="background: #eef2ff; padding: 16px; border-radius: 12px; color: #4338ca; font-weight: 700; font-size: 14px;">Action</td>
                                        <td style="background: #eef2ff; padding: 16px; border-radius: 12px; color: #1f2937; font-size: 14px;">{{ $action }}</td>
                                    </tr>
                                    <tr>
                                        <td style="height: 12px;">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td style="background: #f8fafc; padding: 16px; border-radius: 12px; color: #6b7280; font-size: 14px;">Actor</td>
                                        <td style="background: #f8fafc; padding: 16px; border-radius: 12px; color: #111827; font-size: 14px;">{{ $actorName }} ({{ $actorRole }})</td>
                                    </tr>
                                </tbody>
                            </table>

                            @if(!empty($details))
                                <div style="margin-top: 24px;">
                                    <h2 style="margin: 0 0 12px 0; font-size: 16px; color: #111827;">Signup Details</h2>
                                    <table cellpadding="0" cellspacing="0" width="100%" role="presentation" style="border-collapse: collapse; background: #ffffff; border: 1px solid #e5e7eb; border-radius: 12px;">
                                        <tbody>
                                            @foreach($details as $key => $value)
                                                <tr style="border-bottom: 1px solid #e5e7eb;">
                                                    <td style="padding: 14px 16px; width: 35%; color: #4b5563; text-transform: capitalize; font-weight: 600;">{{ str_replace('_', ' ', (string) $key) }}</td>
                                                    <td style="padding: 14px 16px; color: #111827;">{{ is_scalar($value) ? $value : json_encode($value) }}</td>
                                                </tr>
                                            @endforeach
                                        </tbody>
                                    </table>
                                </div>
                            @endif
                        </td>
                    </tr>
                    <tr>
                        <td style="background: #f8fafc; padding: 22px 30px; text-align: center; font-size: 13px; color: #6b7280;">
                            <p style="margin: 0;">This message was generated automatically by TrueTrucker.</p>
                            <p style="margin: 8px 0 0 0;"><a href="{{ route('dashboard') }}" style="color: #4f46e5; text-decoration: none;">Open the dashboard</a></p>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</body>
</html>
