namespace TrackQrApi.Features.Email.Templates;

public static class EmailTemplates
{
    public static (string Subject, string HtmlBody, string TextBody) PasswordReset(string resetUrl)
    {
        var subject = "Reset your TrakQR password";

        var htmlBody = $@"
<!DOCTYPE html>
<html>
<head>
    <meta charset=""utf-8"">
    <meta name=""viewport"" content=""width=device-width, initial-scale=1.0"">
    <title>Reset Your Password</title>
</head>
<body style=""margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background-color: #f5f5f5;"">
    <table role=""presentation"" width=""100%"" cellspacing=""0"" cellpadding=""0"" style=""max-width: 600px; margin: 0 auto; padding: 40px 20px;"">
        <tr>
            <td style=""background-color: #ffffff; border-radius: 16px; padding: 40px; box-shadow: 0 4px 12px rgba(0,0,0,0.05);"">
                <table width=""100%"" cellspacing=""0"" cellpadding=""0"">
                    <tr>
                        <td style=""text-align: center; padding-bottom: 30px;"">
                            <span style=""display: inline-block; background: #1a1a1a; color: #fff4ec; padding: 12px 16px; border-radius: 12px; font-weight: bold; font-size: 18px;"">TQ</span>
                        </td>
                    </tr>
                    <tr>
                        <td style=""text-align: center; padding-bottom: 20px;"">
                            <h1 style=""margin: 0; font-size: 24px; color: #1a1a1a;"">Reset your password</h1>
                        </td>
                    </tr>
                    <tr>
                        <td style=""text-align: center; padding-bottom: 30px; color: #666666; line-height: 1.6;"">
                            <p style=""margin: 0;"">We received a request to reset your password. Click the button below to choose a new password.</p>
                        </td>
                    </tr>
                    <tr>
                        <td style=""text-align: center; padding-bottom: 30px;"">
                            <a href=""{resetUrl}"" style=""display: inline-block; background: #ff6a3d; color: #ffffff; text-decoration: none; padding: 14px 32px; border-radius: 12px; font-weight: 600; font-size: 16px;"">Reset Password</a>
                        </td>
                    </tr>
                    <tr>
                        <td style=""text-align: center; color: #999999; font-size: 14px; line-height: 1.6;"">
                            <p style=""margin: 0;"">This link will expire in 1 hour.</p>
                            <p style=""margin: 10px 0 0 0;"">If you didn't request this, you can safely ignore this email.</p>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td style=""text-align: center; padding-top: 30px; color: #999999; font-size: 12px;"">
                <p style=""margin: 0;"">&copy; TrakQR. All rights reserved.</p>
            </td>
        </tr>
    </table>
</body>
</html>";

        var textBody = $@"Reset Your Password

We received a request to reset your TrakQR password.

Click the link below to reset your password:
{resetUrl}

This link will expire in 1 hour.

If you didn't request this, you can safely ignore this email.

- The TrakQR Team";

        return (subject, htmlBody, textBody);
    }

    public static (string Subject, string HtmlBody, string TextBody) EmailVerification(string verifyUrl)
    {
        var subject = "Verify your TrakQR email";

        var htmlBody = $@"
<!DOCTYPE html>
<html>
<head>
    <meta charset=""utf-8"">
    <meta name=""viewport"" content=""width=device-width, initial-scale=1.0"">
    <title>Verify Your Email</title>
</head>
<body style=""margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background-color: #f5f5f5;"">
    <table role=""presentation"" width=""100%"" cellspacing=""0"" cellpadding=""0"" style=""max-width: 600px; margin: 0 auto; padding: 40px 20px;"">
        <tr>
            <td style=""background-color: #ffffff; border-radius: 16px; padding: 40px; box-shadow: 0 4px 12px rgba(0,0,0,0.05);"">
                <table width=""100%"" cellspacing=""0"" cellpadding=""0"">
                    <tr>
                        <td style=""text-align: center; padding-bottom: 30px;"">
                            <span style=""display: inline-block; background: #1a1a1a; color: #fff4ec; padding: 12px 16px; border-radius: 12px; font-weight: bold; font-size: 18px;"">TQ</span>
                        </td>
                    </tr>
                    <tr>
                        <td style=""text-align: center; padding-bottom: 20px;"">
                            <h1 style=""margin: 0; font-size: 24px; color: #1a1a1a;"">Verify your email</h1>
                        </td>
                    </tr>
                    <tr>
                        <td style=""text-align: center; padding-bottom: 30px; color: #666666; line-height: 1.6;"">
                            <p style=""margin: 0;"">Thanks for signing up! Please verify your email address to get started with TrakQR.</p>
                        </td>
                    </tr>
                    <tr>
                        <td style=""text-align: center; padding-bottom: 30px;"">
                            <a href=""{verifyUrl}"" style=""display: inline-block; background: #ff6a3d; color: #ffffff; text-decoration: none; padding: 14px 32px; border-radius: 12px; font-weight: 600; font-size: 16px;"">Verify Email</a>
                        </td>
                    </tr>
                    <tr>
                        <td style=""text-align: center; color: #999999; font-size: 14px; line-height: 1.6;"">
                            <p style=""margin: 0;"">This link will expire in 24 hours.</p>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td style=""text-align: center; padding-top: 30px; color: #999999; font-size: 12px;"">
                <p style=""margin: 0;"">&copy; TrakQR. All rights reserved.</p>
            </td>
        </tr>
    </table>
</body>
</html>";

        var textBody = $@"Verify Your Email

Thanks for signing up for TrakQR!

Please verify your email address by clicking the link below:
{verifyUrl}

This link will expire in 24 hours.

- The TrakQR Team";

        return (subject, htmlBody, textBody);
    }

    public static (string Subject, string HtmlBody, string TextBody) Welcome(string userName, string dashboardUrl)
    {
        var subject = "Welcome to TrakQR!";

        var htmlBody = $@"
<!DOCTYPE html>
<html>
<head>
    <meta charset=""utf-8"">
    <meta name=""viewport"" content=""width=device-width, initial-scale=1.0"">
    <title>Welcome to TrakQR</title>
</head>
<body style=""margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background-color: #f5f5f5;"">
    <table role=""presentation"" width=""100%"" cellspacing=""0"" cellpadding=""0"" style=""max-width: 600px; margin: 0 auto; padding: 40px 20px;"">
        <tr>
            <td style=""background-color: #ffffff; border-radius: 16px; padding: 40px; box-shadow: 0 4px 12px rgba(0,0,0,0.05);"">
                <table width=""100%"" cellspacing=""0"" cellpadding=""0"">
                    <tr>
                        <td style=""text-align: center; padding-bottom: 30px;"">
                            <span style=""display: inline-block; background: #1a1a1a; color: #fff4ec; padding: 12px 16px; border-radius: 12px; font-weight: bold; font-size: 18px;"">TQ</span>
                        </td>
                    </tr>
                    <tr>
                        <td style=""text-align: center; padding-bottom: 20px;"">
                            <h1 style=""margin: 0; font-size: 24px; color: #1a1a1a;"">Welcome to TrakQR!</h1>
                        </td>
                    </tr>
                    <tr>
                        <td style=""text-align: center; padding-bottom: 30px; color: #666666; line-height: 1.6;"">
                            <p style=""margin: 0;"">Hi {userName},</p>
                            <p style=""margin: 10px 0 0 0;"">You're all set! Start creating short links and beautiful QR codes with powerful analytics.</p>
                        </td>
                    </tr>
                    <tr>
                        <td style=""text-align: center; padding-bottom: 30px;"">
                            <a href=""{dashboardUrl}"" style=""display: inline-block; background: #ff6a3d; color: #ffffff; text-decoration: none; padding: 14px 32px; border-radius: 12px; font-weight: 600; font-size: 16px;"">Go to Dashboard</a>
                        </td>
                    </tr>
                    <tr>
                        <td style=""padding: 20px; background: #f9f9f9; border-radius: 12px;"">
                            <h3 style=""margin: 0 0 15px 0; font-size: 16px; color: #1a1a1a;"">Get started:</h3>
                            <ul style=""margin: 0; padding-left: 20px; color: #666666; line-height: 1.8;"">
                                <li>Create your first short link</li>
                                <li>Design a custom QR code</li>
                                <li>Track clicks and scans in real-time</li>
                            </ul>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td style=""text-align: center; padding-top: 30px; color: #999999; font-size: 12px;"">
                <p style=""margin: 0;"">&copy; TrakQR. All rights reserved.</p>
            </td>
        </tr>
    </table>
</body>
</html>";

        var textBody = $@"Welcome to TrakQR!

Hi {userName},

You're all set! Start creating short links and beautiful QR codes with powerful analytics.

Get started:
- Create your first short link
- Design a custom QR code
- Track clicks and scans in real-time

Go to your dashboard: {dashboardUrl}

- The TrakQR Team";

        return (subject, htmlBody, textBody);
    }
}