<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>System Error Alert</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
        }
        .header {
            background: #dc3545;
            color: white;
            padding: 20px;
            text-align: center;
            border-radius: 5px 5px 0 0;
        }
        .content {
            background: #f8f9fa;
            padding: 20px;
            border: 1px solid #dee2e6;
            border-top: none;
            border-radius: 0 0 5px 5px;
        }
        .error-level {
            display: inline-block;
            background: #dc3545;
            color: white;
            padding: 5px 10px;
            border-radius: 3px;
            font-weight: bold;
            text-transform: uppercase;
        }
        .timestamp {
            color: #6c757d;
            font-size: 0.9em;
            margin-bottom: 15px;
        }
        .message-box {
            background: white;
            border: 1px solid #dee2e6;
            border-left: 4px solid #dc3545;
            padding: 15px;
            margin: 15px 0;
            border-radius: 3px;
        }
        .context-box {
            background: #e9ecef;
            border: 1px solid #dee2e6;
            padding: 15px;
            margin: 15px 0;
            border-radius: 3px;
            font-family: monospace;
            font-size: 0.9em;
            white-space: pre-wrap;
        }
        .footer {
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid #dee2e6;
            text-align: center;
            color: #6c757d;
            font-size: 0.8em;
        }
    </style>
</head>
<body>
    <div class="header">
        <h1>🚨 System Error Alert</h1>
        <p>{{ $appName }} - {{ $environment }} Environment</p>
    </div>

    <div class="content">
        <div class="timestamp">
            <strong>Timestamp:</strong> {{ $timestamp->setTimezone('Asia/Karachi')->format('Y-m-d H:i:s T') }}
        </div>

        <div>
            <span class="error-level">{{ $level }}</span>
        </div>

        <div class="message-box">
            <strong>Error Message:</strong><br>
            {{ $message }}
        </div>

        @if(!empty($context))
        <div class="context-box">
            <strong>Context:</strong><br>
            {{ json_encode($context, JSON_PRETTY_PRINT) }}
        </div>
        @endif

        <div class="footer">
            <p>This is an automated error notification from {{ $appName }}.</p>
            <p>Please investigate this issue promptly to ensure system stability.</p>
        </div>
    </div>
</body>
</html>
