<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Test Report: {{ name }}</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f5f5f5;
        }
        .report-header {
            background-color: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            margin-bottom: 20px;
        }
        .step {
            background-color: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            margin-bottom: 20px;
        }
        .step-header {
            font-size: 1.2em;
            color: #333;
            border-bottom: 2px solid #eee;
            padding-bottom: 10px;
            margin-bottom: 15px;
        }
        .log {
            background-color: #f8f9fa;
            padding: 15px;
            border-radius: 4px;
            margin-bottom: 15px;
        }
        .log-message {
            margin-bottom: 10px;
            color: #444;
        }
        .log-image {
            max-width: 100%;
            height: auto;
            border-radius: 4px;
            margin-top: 10px;
        }
        .timestamp {
            color: #666;
            font-size: 0.9em;
        }
    </style>
</head>
<body>
    <div class="report-header">
        <h1>Test Report: {{ name }}</h1>
        <div class="timestamp">Generated on: {{ now.strftime('%Y-%m-%d %H:%M:%S') }}</div>
    </div>

    {% for step in steps %}
    <div class="step">
        <div class="step-header">Step {{ loop.index }}: {{ pretty_step(step) }}</div>
        {% for report_log in report[loop.index0] %}
        <div class="log">
            <div class="log-message">{{ report_log.log }}</div>
            <img src="data:image/png;base64,{{ report_log.screenshot_b64 }}" alt="Log image" class="log-image">
        </div>
        {% endfor %}
    </div>
    {% endfor %}
</body>
</html>
