<!DOCTYPE html>
<html lang="{{ lang }}">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ content.title }}</title>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, 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: 30px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        .header {
            border-bottom: 2px solid #ff9800;
            padding-bottom: 15px;
            margin-bottom: 20px;
        }
        .header h1 {
            color: #ff9800;
            margin: 0;
            font-size: 24px;
        }
        .update-badge {
            display: inline-block;
            background-color: #ff9800;
            color: white;
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: bold;
            margin-bottom: 10px;
        }
        .event-title {
            font-size: 20px;
            font-weight: bold;
            color: #333;
            margin: 15px 0;
        }
        .event-details {
            background-color: #fff8e1;
            border-left: 4px solid #ff9800;
            padding: 15px;
            margin: 20px 0;
        }
        .event-details table {
            width: 100%;
            border-collapse: collapse;
        }
        .event-details td {
            padding: 8px 0;
            vertical-align: top;
        }
        .event-details td:first-child {
            font-weight: bold;
            color: #666;
            width: 120px;
        }
        .description {
            background-color: #fff;
            border: 1px solid #eee;
            padding: 15px;
            margin: 20px 0;
            border-radius: 4px;
        }
        .description h3 {
            margin-top: 0;
            color: #666;
        }
        .instructions {
            background-color: #fff8e1;
            border-radius: 4px;
            padding: 15px;
            margin: 20px 0;
        }
        .instructions p {
            margin: 0;
            color: #e65100;
        }
        .footer {
            border-top: 1px solid #eee;
            padding-top: 15px;
            margin-top: 20px;
            font-size: 12px;
            color: #999;
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>{{ content.heading }}</h1>
        </div>

        <span class="update-badge">{{ content.badge }}</span>

        <p>{{ content.body }}</p>

        <div class="event-title">{{ summary }}</div>

        <div class="event-details">
            <table>
                <tr>
                    <td>{{ labels.when }}</td>
                    <td>
                        {{ start_date }}<br>
                        <strong>{{ time_str }}</strong>
                        {% if start_date != end_date %}<br>{{ labels.until }} {{ end_date }}{% endif %}
                    </td>
                </tr>
                {% if event.location %}
                <tr>
                    <td>{{ labels.location }}</td>
                    <td>{{ event.location }}</td>
                </tr>
                {% endif %}
                {% if event.url %}
                <tr>
                    <td>{{ labels.videoConference }}</td>
                    <td><a href="{{ event.url }}" style="color: #e65100;">{{ event.url }}</a></td>
                </tr>
                {% endif %}
                <tr>
                    <td>{{ labels.organizer }}</td>
                    <td>{{ organizer_display }} &lt;{{ event.organizer_email }}&gt;</td>
                </tr>
            </table>
        </div>

        {% if event.description %}
        <div class="description">
            <h3>{{ labels.description }}</h3>
            <p>{{ event.description|linebreaks }}</p>
        </div>
        {% endif %}

        {% if rsvp_accept_url %}
        <div style="text-align: center; margin: 20px 0;">
            <a href="{{ rsvp_accept_url }}" style="display: inline-block; padding: 10px 24px; margin: 0 6px; background-color: #16a34a; color: white; text-decoration: none; border-radius: 6px; font-weight: bold;">{{ actions.accept }}</a>
            <a href="{{ rsvp_tentative_url }}" style="display: inline-block; padding: 10px 24px; margin: 0 6px; background-color: #d97706; color: white; text-decoration: none; border-radius: 6px; font-weight: bold;">{{ actions.maybe }}</a>
            <a href="{{ rsvp_decline_url }}" style="display: inline-block; padding: 10px 24px; margin: 0 6px; background-color: #dc2626; color: white; text-decoration: none; border-radius: 6px; font-weight: bold;">{{ actions.decline }}</a>
        </div>
        {% endif %}
        <div class="instructions">
            <p>{{ instructions }}</p>
        </div>

        <div class="footer">
            <p>{{ footer }}</p>
        </div>
    </div>
</body>
</html>
