<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <style>
        body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
        }
        .header {
            background-color: #10b981;
            color: white;
            padding: 20px;
            text-align: center;
            border-radius: 5px;
        }
        .content {
            background-color: #f9fafb;
            padding: 20px;
            margin-top: 20px;
            border-radius: 5px;
        }
        .summary-box {
            background-color: white;
            padding: 20px;
            margin: 15px 0;
            text-align: center;
            border-radius: 5px;
            border: 2px solid #10b981;
        }
        .summary-box h2 {
            margin: 0;
            color: #10b981;
            font-size: 36px;
        }
        .summary-box p {
            margin: 5px 0;
            color: #6b7280;
        }
        .projects-table {
            width: 100%;
            background-color: white;
            margin: 15px 0;
            border-radius: 5px;
            overflow: hidden;
        }
        .projects-table table {
            width: 100%;
            border-collapse: collapse;
        }
        .projects-table th {
            background-color: #e0f2fe;
            padding: 12px;
            text-align: left;
            font-weight: bold;
        }
        .projects-table td {
            padding: 12px;
            border-bottom: 1px solid #e5e7eb;
        }
        .projects-table tr:last-child td {
            border-bottom: none;
        }
        .button {
            display: inline-block;
            padding: 12px 24px;
            background-color: #3b82f6;
            color: white;
            text-decoration: none;
            border-radius: 5px;
            margin-top: 15px;
        }
        .footer {
            text-align: center;
            color: #6b7280;
            font-size: 12px;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #e5e7eb;
        }
    </style>
</head>
<body>
    <div class="header">
        <h1>📊 {{ _('Your Weekly Summary') }}</h1>
        <p>{{ start_date }} to {{ end_date }}</p>
    </div>
    
    <div class="content">
        <p>Hello {{ user.display_name }},</p>
        
        <p>Here's your time tracking summary for the past week:</p>
        
        <div class="summary-box">
            <p>Total Hours Worked</p>
            <h2>{{ "%.1f"|format(hours_worked) }}</h2>
            <p>hours</p>
        </div>
        
        <h3 style="margin-top: 30px;">{{ _('Hours by Project') }}</h3>
        
        <div class="projects-table">
            <table>
                <thead>
                    <tr>
                        <th>Project</th>
                        <th style="text-align: right;">Hours</th>
                    </tr>
                </thead>
                <tbody>
                    {% for project in projects_data %}
                    <tr>
                        <td>{{ project.name }}</td>
                        <td style="text-align: right;"><strong>{{ "%.1f"|format(project.hours) }}</strong></td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
        
        <p style="margin-top: 20px;">Keep up the great work! 🎉</p>
        
        <center>
            <a href="{{ url_for('reports.reports', _external=True) }}" class="button">
                View Detailed Reports
            </a>
        </center>
    </div>
    
    <div class="footer">
        <p>TimeTracker - Time Tracking & Project Management</p>
        <p>To manage your notification preferences, visit your user settings.</p>
    </div>
</body>
</html>

