<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ subject }}</title>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
            line-height: 1.6;
            color: #333;
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f8f9fa;
        }
        .container {
            background: white;
            border-radius: 8px;
            padding: 40px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        .header {
            text-align: center;
            margin-bottom: 30px;
        }
        .logo {
            font-size: 24px;
            font-weight: bold;
            color: #2563eb;
            margin-bottom: 10px;
        }
        .main-content {
            margin: 30px 0;
        }
        .main-html-content {
            text-align: center;
            margin: 20px 0;
        }
        .button {
            display: inline-block;
            background: #2563eb;
            color: white;
            padding: 12px 24px;
            text-decoration: none;
            border-radius: 6px;
            font-weight: 500;
            margin: 20px 0;
        }
        .button:hover {
            background: #1d4ed8;
        }
        .secondary-text {
            background: #f1f5f9;
            border-left: 4px solid #2563eb;
            padding: 15px;
            margin: 20px 0;
            border-radius: 4px;
            color: #475569;
        }
        .footer {
            text-align: center;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #e5e7eb;
            color: #6b7280;
            font-size: 14px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="logo">🚀 UnrealON</div>
            <h1>{{ subject }}</h1>
        </div>

        <p>Hello {{ user.get_full_name|default:user.username }},</p>
        
        {% if main_text %}
        <div class="main-content">
            <p>{{ main_text }}</p>
        </div>
        {% endif %}

        {% if main_html_content %}
        <div class="main-html-content">
            {{ main_html_content|safe }}
        </div>
        {% endif %}

        {% if button_text and button_url %}
        <div style="text-align: center; margin: 30px 0;">
            <a href="{{ button_url }}" class="button">{{ button_text }}</a>
        </div>
        {% endif %}

        {% if secondary_text %}
        <div class="secondary-text">
            {{ secondary_text }}
        </div>
        {% endif %}

        <div class="footer">
            <p>This is an automated message from UnrealON.</p>
            <p>Please do not reply to this email.</p>
        </div>
    </div>
</body>
</html>
