<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Visit Notification</title>
    <style>
        body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; }
        .container { max-width: 600px; margin: 0 auto; padding: 20px; }
        .header { background: #2563eb; color: white; padding: 15px; border-radius: 8px 8px 0 0; }
        .content { background: #f9fafb; padding: 20px; border: 1px solid #e5e7eb; border-top: none; border-radius: 0 0 8px 8px; }
        .detail { margin: 10px 0; }
        .label { font-weight: bold; color: #4b5563; }
        .footer { margin-top: 20px; font-size: 12px; color: #6b7280; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h2 style="margin: 0;">
                @if($type === 'reminder')
                    Visit Reminder – Today
                @else
                    New Visit Assigned
                @endif
            </h2>
        </div>
        <div class="content">
            <p>Hello {{ $visit->responsible_staff }},</p>

            @if($type === 'reminder')
                <p><strong>This is a reminder</strong> that you have a scheduled visit for today.</p>
            @else
                <p>A new visit has been assigned to you.</p>
            @endif

            <div class="detail"><span class="label">Client:</span> {{ $visit->client?->name ?? 'N/A' }}</div>
            <div class="detail"><span class="label">Purpose:</span> {{ ucfirst(str_replace('_', ' ', $visit->visit_purpose)) }}</div>
            <div class="detail"><span class="label">Date:</span> {{ $visit->scheduled_date }}</div>
            <div class="detail"><span class="label">Time:</span> {{ $visit->scheduled_time }}</div>
            <div class="detail"><span class="label">Location:</span> {{ $visit->colline }}, {{ $visit->commune }}, {{ $visit->province }}</div>
            @if($visit->notes)
                <div class="detail"><span class="label">Notes:</span> {{ $visit->notes }}</div>
            @endif

            <p style="margin-top: 20px;">Please ensure you are prepared for this visit.</p>
        </div>
        <div class="footer">
            This is an automated message from {{ config('app.name') }}.
        </div>
    </div>
</body>
</html>
