<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Team Join Request Update - LeagueLedger</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f9f9f9;
        }
        .container {
            background-color: #ffffff;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            overflow: hidden;
        }
        .header {
            background-color: #2D7738;
            padding: 20px;
            text-align: center;
            color: white;
        }
        .content {
            padding: 30px;
            background-color: #ffffff;
        }
        .status-message {
            margin: 20px 0;
            padding: 15px;
            border-radius: 5px;
        }
        .status-approved {
            background-color: #e8f5e9;
            border-left: 4px solid #2D7738;
        }
        .status-denied {
            background-color: #f5f5f5;
            border-left: 4px solid #9e9e9e;
        }
        .button-container {
            margin: 25px 0;
            text-align: center;
        }
        .button {
            display: inline-block;
            background-color: #2D7738;
            color: white;
            text-decoration: none;
            padding: 12px 25px;
            border-radius: 5px;
            font-weight: 500;
        }
        .next-steps {
            margin-top: 20px;
            padding: 15px;
            background-color: #f5f5f5;
            border-radius: 5px;
        }
        .footer {
            padding: 20px;
            text-align: center;
            font-size: 12px;
            color: #777;
            border-top: 1px solid #eaeaea;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>Team Request {{ "Approved" if is_approved else "Status Update" }}</h1>
        </div>
        
        <div class="content">
            <p>Hello {{ username }},</p>
            
            {% if is_approved %}
            <div class="status-message status-approved">
                <h2>Welcome to the team!</h2>
                <p>Your request to join <strong>{{ team_name }}</strong> has been approved. You are now officially a member of the team.</p>
            </div>
            
            <p>As a team member, you can now:</p>
            <ul>
                <li>Participate in team events</li>
                <li>Contribute to your team's score</li>
                <li>Earn points and achievements together</li>
                <li>Track your team's performance on the leaderboard</li>
            </ul>
            
            <p>Visit your dashboard to see your team's upcoming events and current standings.</p>
            {% else %}
            <div class="status-message status-denied">
                <p>Your request to join <strong>{{ team_name }}</strong> has not been approved at this time.</p>
                <p>Don't worry - there are many teams in LeagueLedger that might be a better fit for you.</p>
            </div>
            
            <div class="next-steps">
                <h3>What's next?</h3>
                <p>You can:</p>
                <ul>
                    <li>Request to join another team</li>
                    <li>Create your own team</li>
                    <li>Explore upcoming pub quiz events in your area</li>
                </ul>
            </div>
            {% endif %}
            
            <div class="button-container">
                <a href="{{ base_url }}/dashboard" class="button">Go to My Dashboard</a>
            </div>
            
            <p>Thank you for being part of the LeagueLedger community!</p>
            
            <p>Best regards,<br>The LeagueLedger Team</p>
        </div>
        
        <div class="footer">
            <p>© 2025 LeagueLedger. All rights reserved.</p>
            <p>This email was sent to update you about your team join request.</p>
        </div>
    </div>
</body>
</html>
