<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>You're Invited to SmoothSchedule</title>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f5f5f5;
        }
        .container {
            background-color: #ffffff;
            border-radius: 8px;
            padding: 40px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        .header {
            text-align: center;
            margin-bottom: 30px;
        }
        .logo {
            font-size: 24px;
            font-weight: bold;
            color: #6366f1;
        }
        h1 {
            color: #1f2937;
            font-size: 24px;
            margin-bottom: 20px;
        }
        p {
            color: #4b5563;
            margin-bottom: 15px;
        }
        .personal-message {
            background-color: #f3f4f6;
            border-left: 4px solid #6366f1;
            padding: 15px 20px;
            margin: 20px 0;
            border-radius: 0 8px 8px 0;
            font-style: italic;
        }
        .cta-button {
            display: inline-block;
            background-color: #6366f1;
            color: #ffffff !important;
            text-decoration: none;
            padding: 14px 32px;
            border-radius: 8px;
            font-weight: 600;
            font-size: 16px;
            margin: 20px 0;
        }
        .cta-button:hover {
            background-color: #4f46e5;
        }
        .cta-container {
            text-align: center;
            margin: 30px 0;
        }
        .details {
            background-color: #fafafa;
            border-radius: 8px;
            padding: 20px;
            margin: 20px 0;
        }
        .details-row {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid #e5e7eb;
        }
        .details-row:last-child {
            border-bottom: none;
        }
        .details-label {
            color: #6b7280;
            font-size: 14px;
        }
        .details-value {
            color: #1f2937;
            font-weight: 500;
        }
        .footer {
            text-align: center;
            margin-top: 40px;
            padding-top: 20px;
            border-top: 1px solid #e5e7eb;
            color: #9ca3af;
            font-size: 14px;
        }
        .link-fallback {
            font-size: 12px;
            color: #6b7280;
            word-break: break-all;
            margin-top: 20px;
        }
        .expire-notice {
            color: #dc2626;
            font-size: 14px;
            margin-top: 10px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="logo">SmoothSchedule</div>
        </div>

        <h1>You're Invited!</h1>

        <p>Hi there,</p>

        <p>
            <strong>{{ inviter_name }}</strong> has invited you to create your business on SmoothSchedule,
            the modern scheduling platform that helps you manage appointments, staff, and customers effortlessly.
        </p>

        {% if personal_message %}
        <div class="personal-message">
            "{{ personal_message }}"
            <br><br>
            <small>— {{ inviter_name }}</small>
        </div>
        {% endif %}

        <div class="details">
            <div class="details-row">
                <span class="details-label">Suggested Business Name</span>
                <span class="details-value">{{ suggested_business_name }}</span>
            </div>
            <div class="details-row">
                <span class="details-label">Subscription Plan</span>
                <span class="details-value">{{ invitation.get_subscription_tier_display }}</span>
            </div>
        </div>

        <div class="cta-container">
            <a href="{{ invitation_url }}" class="cta-button">Accept Invitation & Get Started</a>
        </div>

        <p class="link-fallback">
            If the button doesn't work, copy and paste this link into your browser:<br>
            {{ invitation_url }}
        </p>

        <p class="expire-notice">
            This invitation expires on {{ expires_at|date:"F j, Y" }} at {{ expires_at|time:"g:i A" }}.
        </p>

        <div class="footer">
            <p>
                This email was sent by SmoothSchedule.<br>
                If you didn't expect this invitation, you can safely ignore this email.
            </p>
            <p>&copy; {% now "Y" %} SmoothSchedule. All rights reserved.</p>
        </div>
    </div>
</body>
</html>
