<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ subject }}</title>
</head>
<body style="margin: 0; padding: 0; background-color: #f9fafb; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #111827;">
    <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="background-color: #f9fafb;">
        <tr>
            <td align="center" style="padding: 32px 16px;">
                <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="max-width: 600px; background-color: #ffffff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08);">

                    <!-- Header -->
                    <tr>
                        <td style="padding: 24px 32px; border-bottom: 1px solid #f3f4f6;">
                            {% if logo_url %}
                            <img src="{{ logo_url }}" alt="{{ platform_name }}" style="max-height: 36px; max-width: 140px;">
                            {% else %}
                            <span style="font-family: -apple-system, sans-serif; font-size: 16px; font-weight: 700; color: {{ secondary_color }};">{{ platform_name }}</span>
                            {% endif %}
                        </td>
                    </tr>

                    <!-- Content -->
                    <tr>
                        <td style="padding: 32px; font-size: 15px; line-height: 1.65; color: #374151;">
                            <style>
                                h1 { font-size: 22px; font-weight: 700; color: #111827; margin: 0 0 16px 0; line-height: 1.3; }
                                h2 { font-size: 18px; font-weight: 600; color: #111827; margin: 24px 0 10px 0; }
                                h3 { font-size: 16px; font-weight: 600; color: #374151; margin: 20px 0 8px 0; }
                                p { margin: 0 0 14px 0; }
                                a { color: {{ primary_color }}; text-decoration: none; }
                                ul, ol { padding-left: 20px; margin: 0 0 14px 0; }
                                li { margin-bottom: 6px; }
                                hr { border: none; border-top: 1px solid #e5e7eb; margin: 24px 0; }
                                strong, b { color: #111827; }
                            </style>
                            {{ content }}
                        </td>
                    </tr>

                    <!-- Footer -->
                    <tr>
                        <td style="padding: 16px 32px; background-color: #f9fafb; border-top: 1px solid #f3f4f6; text-align: center; font-size: 12px; color: #9ca3af;">
                            {{ footer_text }}
                            {% if support_email %}
                            &middot; <a href="mailto:{{ support_email }}" style="color: #9ca3af; text-decoration: underline;">Support</a>
                            {% endif %}
                            &middot; <a href="#" style="color: #9ca3af; text-decoration: underline;">Unsubscribe</a>
                        </td>
                    </tr>

                </table>
            </td>
        </tr>
    </table>
</body>
</html>
