<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Memory Limit Reached</title>
</head>
<body style="margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background-color: #0F0F0F;">
    <table role="presentation" style="width: 100%; border-collapse: collapse; background-color: #0F0F0F;">
        <tr>
            <td align="center" style="padding: 40px 20px;">
                <table role="presentation" style="max-width: 600px; width: 100%; border-collapse: collapse; background-color: #1A1A1A; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);">
                    <!-- Header -->
                    <tr>
                        <td style="padding: 40px 40px 20px; text-align: center; border-bottom: 3px solid #EF4444;">
                            <h1 style="margin: 0; font-size: 32px; font-weight: 700; color: #8B5CF6;">
                                🧠 Remembra
                            </h1>
                        </td>
                    </tr>

                    <!-- Body -->
                    <tr>
                        <td style="padding: 40px;">
                            <!-- Alert Icon -->
                            <div style="text-align: center; margin-bottom: 20px;">
                                <span style="font-size: 48px;">🚨</span>
                            </div>

                            <h2 style="margin: 0 0 20px; font-size: 26px; font-weight: 700; color: #FFFFFF; text-align: center;">
                                Memory Limit Reached
                            </h2>
                            
                            <!-- Alert Box -->
                            <div style="background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%); border-left: 4px solid #EF4444; padding: 20px; margin: 30px 0; border-radius: 8px;">
                                <p style="margin: 0; font-size: 16px; line-height: 1.7; color: #991B1B;">
                                    <strong style="color: #7F1D1D;">Action Required:</strong> Your memory storage is full. New memories will be rejected until you take action.
                                </p>
                            </div>

                            <!-- Usage Stats -->
                            <div style="background-color: #252525; border-radius: 8px; padding: 25px; margin: 25px 0;">
                                <div style="margin-bottom: 20px;">
                                    <p style="margin: 0 0 8px; font-size: 14px; color: #A0A0A0; text-transform: uppercase; letter-spacing: 1px;">
                                        Current Usage
                                    </p>
                                    <p style="margin: 0; font-size: 32px; font-weight: 700; color: #EF4444;">
                                        {current_usage:,} <span style="font-size: 18px; color: #666;">/ {limit:,}</span>
                                    </p>
                                </div>

                                <!-- Progress Bar -->
                                <div style="background-color: #0F0F0F; border-radius: 20px; height: 12px; overflow: hidden; margin: 15px 0;">
                                    <div style="background: linear-gradient(90deg, #EF4444 0%, #DC2626 100%); height: 100%; width: 100%; border-radius: 20px;"></div>
                                </div>

                                <p style="margin: 15px 0 0; font-size: 14px; color: #888;">
                                    Plan: <span style="color: #FFFFFF;">{plan}</span>
                                </p>
                            </div>

                            <h3 style="margin: 30px 0 15px; font-size: 20px; font-weight: 600; color: #FFFFFF;">
                                What You Can Do
                            </h3>

                            <div style="margin: 20px 0;">
                                <!-- Option 1 -->
                                <div style="background: linear-gradient(135deg, #2A1A4A 0%, #1F1333 100%); border: 1px solid #8B5CF6; border-radius: 8px; padding: 20px; margin-bottom: 15px;">
                                    <p style="margin: 0 0 8px; font-size: 18px; font-weight: 600; color: #FFFFFF;">
                                        ⬆️ Upgrade Your Plan
                                    </p>
                                    <p style="margin: 0; font-size: 15px; color: #D0D0D0; line-height: 1.6;">
                                        Get more storage and unlock additional features. Plans start at $49/month for 100,000 memories.
                                    </p>
                                </div>

                                <!-- Option 2 -->
                                <div style="background-color: #252525; border: 1px solid #333; border-radius: 8px; padding: 20px;">
                                    <p style="margin: 0 0 8px; font-size: 18px; font-weight: 600; color: #FFFFFF;">
                                        🗑️ Delete Old Memories
                                    </p>
                                    <p style="margin: 0; font-size: 15px; color: #D0D0D0; line-height: 1.6;">
                                        Free up space by removing memories you no longer need from your dashboard.
                                    </p>
                                </div>
                            </div>

                            <!-- CTA Button -->
                            <div style="text-align: center; margin: 40px 0 30px;">
                                <a href="{upgrade_url}" style="display: inline-block; background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%); color: #FFFFFF; text-decoration: none; padding: 16px 40px; border-radius: 8px; font-weight: 600; font-size: 16px; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);">
                                    Upgrade Now →
                                </a>
                            </div>

                            <div style="text-align: center; margin: 20px 0;">
                                <a href="{dashboard_url}" style="color: #8B5CF6; text-decoration: none; font-size: 15px;">
                                    Manage Memories →
                                </a>
                            </div>
                        </td>
                    </tr>

                    <!-- Footer -->
                    <tr>
                        <td style="padding: 30px 40px; background-color: #0F0F0F; border-top: 1px solid #333;">
                            <p style="margin: 0 0 10px; font-size: 14px; color: #666; line-height: 1.6;">
                                Need help deciding? Reply to this email and we'll help you choose the right plan.
                            </p>
                            <p style="margin: 0; font-size: 13px; color: #555;">
                                Remembra &copy; 2026 | 
                                <a href="https://app.remembra.dev/settings" style="color: #666; text-decoration: none;">Preferences</a> | 
                                <a href="https://app.remembra.dev/unsubscribe" style="color: #666; text-decoration: none;">Unsubscribe</a>
                            </p>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</body>
</html>
