
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Pesanan Selesai - {{ config('app.name') }}</title>
    <style>
        body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; color: #333; max-width: 600px; margin: 0 auto; background-color: #f8f9fa; }
        .container { background: white; margin: 20px; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); overflow: hidden; }
        .header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 30px; text-align: center; }
        .content { padding: 30px; }
        .order-id { background: #e3f2fd; padding: 15px; border-radius: 8px; margin-bottom: 20px; font-weight: bold; }
        table { width: 100%; border-collapse: collapse; margin: 20px 0; }
        th, td { padding: 12px; text-align: left; border-bottom: 1px solid #eee; }
        th { background: #f8f9fa; font-weight: 600; }
        .total { font-size: 1.2em; font-weight: bold; color: #28a745; text-align: right; margin-top: 20px; }
        .footer { background: #f8f9fa; padding: 20px; text-align: center; color: #6c757d; font-size: 0.9em; }
        .status-completed { background: #d4edda; color: #155724; padding: 5px 10px; border-radius: 20px; font-weight: bold; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>🎉 Pesanan Anda Selesai!</h1>
            <p>Terima kasih telah memesan di {{ config('app.name') }}</p>
        </div>
        
        <div class="content">
            <div class="order-id">
<strong>ID Pesanan:</strong> #{{ $order->id }}<br>
                <strong>No. Meja:</strong> {{ $order->table_number ?? 'N/A' }}<br>
                <strong>Tanggal:</strong> {{ $order->created_at->format('d M Y H:i') }}<br>
                <strong>Status:</strong> <span class="status-completed">SELESAI</span>
            </div>
            
            <h3>Detail Pesanan</h3>
            <table>
                <thead>
                    <tr>
                        <th>Menu</th>
                        <th>Qty</th>
                        <th>Harga</th>
                        <th>Subtotal</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach($order->orderItems as $item)
                    <tr>
                        <td>
                            <strong>{{ $item->menu->name }}</strong><br>
                            <small>{{ $item->menu->description }}</small>
                        </td>
                        <td>{{ $item->quantity }}</td>
                        <td>Rp {{ number_format($item->price, 0, ',', '.') }}</td>
                        <td>Rp {{ number_format($item->price * $item->quantity, 0, ',', '.') }}</td>
                    </tr>
                    @endforeach
                </tbody>
            </table>
            
            <div class="total">
                Total: Rp {{ number_format($order->total_price, 0, ',', '.') }}
            </div>
            
            @if($order->notes)
            <div style="margin-top: 20px; padding: 15px; background: #fff3cd; border-radius: 8px;">
                <strong>Catatan:</strong> {{ $order->notes }}
            </div>
            @endif
            
            <div style="margin-top: 30px; text-align: center;">
                <p>Silakan lakukan pembayaran sesuai metode yang dipilih.</p>
                <p>Metode Pembayaran: {{ ucfirst(str_replace('_', ' ', $order->payment_method)) }}</p>
            </div>
        </div>
        
        <div class="footer">
            <p>&copy; {{ date('Y') }} {{ config('app.name') }}. Pesan Anda sangat berharga bagi kami!</p>
        </div>
    </div>
</body>
</html>

