<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ $notification->title }}</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: #333;
            background-color: #f5f5f5;
            margin: 0;
            padding: 0;
        }
        .container {
            max-width: 600px;
            margin: 20px auto;
            background-color: #ffffff;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        .header {
            background-color: #1A3A5C;
            color: #ffffff;
            padding: 30px;
            text-align: center;
        }
        .header h1 {
            margin: 0;
            font-size: 24px;
            font-weight: 600;
        }
        .header .subtitle {
            margin-top: 5px;
            font-size: 14px;
            opacity: 0.9;
        }
        .content {
            padding: 30px;
        }
        .greeting {
            font-size: 18px;
            margin-bottom: 20px;
        }
        .notification-box {
            background-color: #f8f9fa;
            border-left: 4px solid #1A3A5C;
            padding: 20px;
            margin: 20px 0;
            border-radius: 0 4px 4px 0;
        }
        .notification-title {
            font-size: 16px;
            font-weight: 600;
            color: #1A3A5C;
            margin-bottom: 10px;
        }
        .notification-body {
            font-size: 14px;
            color: #555;
        }
        .action-button {
            display: inline-block;
            background-color: #1A3A5C;
            color: #ffffff !important;
            text-decoration: none;
            padding: 12px 30px;
            border-radius: 4px;
            margin-top: 20px;
            font-weight: 500;
        }
        .action-button:hover {
            background-color: #0A1929;
        }
        .footer {
            background-color: #f8f9fa;
            padding: 20px 30px;
            text-align: center;
            font-size: 12px;
            color: #888;
        }
        .footer a {
            color: #1A3A5C;
            text-decoration: none;
        }
        .divider {
            height: 1px;
            background-color: #e0e0e0;
            margin: 20px 0;
        }
        .info-row {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            font-size: 13px;
        }
        .info-label {
            color: #888;
        }
        .info-value {
            color: #333;
            font-weight: 500;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>Absen Nizhamia</h1>
            <div class="subtitle">Sistem Presensi Karyawan</div>
        </div>

        <div class="content">
            <div class="greeting">
                Halo, <strong>{{ $user->name }}</strong>
            </div>

            <p>Anda memiliki notifikasi baru:</p>

            <div class="notification-box">
                <div class="notification-title">{{ $notification->title }}</div>
                <div class="notification-body">{{ $notification->body }}</div>
            </div>

            @if($notification->data)
            <div class="divider"></div>
            <div class="info-section">
                <strong>Detail:</strong>
                @foreach($notification->data as $key => $value)
                <div class="info-row">
                    <span class="info-label">{{ ucfirst(str_replace('_', ' ', $key)) }}</span>
                    <span class="info-value">{{ is_array($value) ? json_encode($value) : $value }}</span>
                </div>
                @endforeach
            </div>
            @endif

            @if($notification->action_url)
            <div style="text-align: center;">
                <a href="{{ $notification->action_url }}" class="action-button">Lihat Detail</a>
            </div>
            @endif

            <div class="divider"></div>

            <p style="font-size: 13px; color: #888;">
                Notifikasi ini dikirim pada {{ $notification->created_at->format('d M Y, H:i') }} WIB.
            </p>
        </div>

        <div class="footer">
            <p>&copy; {{ date('Y') }} Absen Nizhamia. All rights reserved.</p>
            <p>
                Email ini dikirim secara otomatis. Mohon tidak membalas email ini.
            </p>
        </div>
    </div>
</body>
</html>
