<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Pesanan Selesai</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            font-family: 'Arial', sans-serif;
            background: linear-gradient(135deg, #000000 0%, #0a0a1f 100%);
        }
        .container {
            max-width: 600px;
            margin: 40px auto;
            background: rgba(17, 24, 39, 0.95);
            border: 2px solid rgba(34, 211, 238, 0.3);
            border-radius: 16px;
            overflow: hidden;
        }
        .header {
            background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
            padding: 30px;
            text-align: center;
        }
        .header h1 {
            margin: 0;
            color: #ffffff;
            font-size: 28px;
            font-weight: bold;
        }
        .content {
            padding: 30px;
            color: #e5e7eb;
        }
        .success-icon {
            text-align: center;
            font-size: 64px;
            margin: 20px 0;
        }
        .info-box {
            background: rgba(139, 92, 246, 0.1);
            border: 1px solid rgba(139, 92, 246, 0.3);
            border-radius: 12px;
            padding: 20px;
            margin: 20px 0;
        }
        .info-row {
            display: flex;
            justify-content: space-between;
            padding: 12px 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
        .info-row:last-child {
            border-bottom: none;
        }
        .label {
            color: #9ca3af;
            font-size: 14px;
        }
        .value {
            color: #ffffff;
            font-weight: bold;
            font-size: 14px;
        }
        .sn-box {
            background: rgba(99, 102, 241, 0.2);
            border: 2px solid rgba(99, 102, 241, 0.5);
            padding: 20px;
            border-radius: 12px;
            margin-top: 20px;
            text-align: center;
        }
        .sn-label {
            color: #9ca3af;
            font-size: 12px;
            margin-bottom: 8px;
        }
        .sn-code {
            color: #6366f1;
            font-size: 24px;
            font-weight: bold;
            letter-spacing: 2px;
            word-break: break-all;
        }
        .footer {
            background: rgba(0, 0, 0, 0.3);
            padding: 20px;
            text-align: center;
            color: #9ca3af;
            font-size: 12px;
        }
        .thank-you {
            background: rgba(139, 92, 246, 0.1);
            border-radius: 8px;
            padding: 16px;
            margin-top: 20px;
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- Header -->
        <div class="header">
            <h1>🎉 PESANAN SELESAI!</h1>
        </div>

        <!-- Content -->
        <div class="content">
            <div class="success-icon">🚀</div>

            <p style="text-align: center; font-size: 18px;">
                Yeay! Pesanan <strong>{{ $transaction->customer_name }}</strong> sudah selesai!
            </p>
            <p style="text-align: center;">
                Item telah berhasil dikirim ke akun Anda. Silakan cek dan nikmati!
            </p>

            <!-- Order Details -->
            <div class="info-box">
                <div class="info-row">
                    <span class="label">Invoice</span>
                    <span class="value">{{ $transaction->invoice_number }}</span>
                </div>
                <div class="info-row">
                    <span class="label">Produk</span>
                    <span class="value">{{ $transaction->product_name }}</span>
                </div>
                <div class="info-row">
                    <span class="label">ID Akun</span>
                    <span class="value">{{ $transaction->customer_data }}</span>
                </div>
                <div class="info-row">
                    <span class="label">Total</span>
                    <span class="value">Rp {{ number_format($transaction->total_amount, 0, ',', '.') }}</span>
                </div>
            </div>

            <!-- Serial Number / SN (if available) -->
            @if($transaction->provider_sn)
            <div class="sn-box">
                <div class="sn-label">SERIAL NUMBER / KODE VOUCHER</div>
                <div class="sn-code">{{ $transaction->provider_sn }}</div>
            </div>
            @endif

            <!-- Thank You -->
            <div class="thank-you">
                <p style="margin: 0; color: #a78bfa; font-size: 16px; font-weight: bold;">
                    🙏 Terima kasih telah berbelanja di Ryll Store!
                </p>
                <p style="margin: 10px 0 0 0; color: #9ca3af; font-size: 14px;">
                    Jangan lupa kunjungi lagi untuk promo menarik! 🎮
                </p>
            </div>

            <!-- Footer Info -->
            <p style="margin-top: 30px; color: #9ca3af; font-size: 12px; text-align: center;">
                Jika ada kendala atau item belum masuk, hubungi CS kami dengan menyertakan invoice number.
            </p>
        </div>

        <!-- Footer -->
        <div class="footer">
            <p>Email ini dikirim otomatis, mohon tidak membalas.</p>
            <p>Jika ada kendala, hubungi CS kami.</p>
            <p style="margin-top: 10px;">© 2026 Ryll Store - All Rights Reserved</p>
        </div>
    </div>
</body>
</html>
