<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Kwitansi Booking - {{ $booking->invoice_id }}</title>
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <style>
        /* Reset dan Base Styles */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Poppins', sans-serif;
            background-color: #f9fafb;
            color: #374151;
            line-height: 1.6;
            padding: 20px;
        }

        .container {
            max-width: 800px;
            margin: 0 auto;
        }

        /* Receipt Container */
        .receipt-container {
            background-color: white;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
            border-radius: 8px;
            overflow: hidden;
            border-top: 4px solid #4f46e5;
        }

        /* Header Styles */
        .header {
            position: relative;
            background: linear-gradient(to right, #eef2ff, #f5f3ff);
            padding: 32px;
        }

        .watermark {
            position: absolute;
            opacity: 0.1;
            font-size: 120px;
            font-weight: 700;
            transform: rotate(-30deg);
            top: 30%;
            left: 15%;
            z-index: 0;
            color: #818cf8; /* indigo-200 equivalent */
        }

        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            position: relative;
            z-index: 1;
        }

        .logo-container {
            text-align: right;
        }

        .logo {
            height: 64px;
            margin: 0 auto;
        }

        .title {
            font-size: 24px;
            font-weight: 700;
            color: #312e81; /* indigo-800 equivalent */
            margin-bottom: 4px;
        }

        .invoice-id {
            color: #4f46e5; /* indigo-600 equivalent */
            font-size: 16px;
        }

        .company-name {
            margin-top: 8px;
            color: #374151; /* gray-700 equivalent */
            font-weight: 500;
        }

        /* Section Styles */
        .section {
            padding: 32px;
            border-bottom: 1px solid #e5e7eb; /* gray-200 equivalent */
        }

        .section:last-child {
            border-bottom: none;
        }

        .section-title {
            font-size: 20px;
            font-weight: 600;
            color: #1f2937; /* gray-800 equivalent */
            margin-bottom: 16px;
        }

        /* Grid Layout */
        .grid {
            display: grid;
            gap: 16px;
        }

        .grid-cols-2 {
            grid-template-columns: repeat(2, 1fr);
        }

        .grid-cols-3 {
            grid-template-columns: repeat(3, 1fr);
        }

        /* Text Styles */
        .text-gray-600 {
            color: #4b5563;
        }

        .text-gray-800 {
            color: #1f2937;
        }

        .font-medium {
            font-weight: 500;
        }

        .font-semibold {
            font-weight: 600;
        }

        /* Table Styles */
        .table-container {
            overflow-x: auto;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            min-width: 600px;
        }

        th, td {
            padding: 12px 16px;
            text-align: left;
            font-size: 14px;
        }

        thead th {
            background-color: #4f46e5;
            color: white;
            font-weight: 500;
        }

        tbody tr:nth-child(even) {
            background-color: #f9fafb;
        }

        tbody tr:hover {
            background-color: #f9fafb; /* gray-50 equivalent */
        }

        .text-right {
            text-align: right;
        }

        .font-bold {
            font-weight: 700;
        }

        .text-indigo-700 {
            color: #4338ca;
        }

        /* Rekening Card */
        .rekening-card {
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 16px;
            transition: border-color 0.2s;
        }

        .rekening-card:hover {
            border-color: #a5b4fc; /* indigo-300 equivalent */
        }

        .card-header {
            display: flex;
            align-items: center;
            margin-bottom: 8px;
        }

        .card-icon {
            background-color: #f3f4f6; /* gray-100 equivalent */
            padding: 8px;
            border-radius: 8px;
            margin-right: 12px;
        }

        .icon-placeholder {
            background-color: #e5e7eb; /* gray-200 equivalent */
            border: 2px dashed #9ca3af; /* gray-400 equivalent */
            border-radius: 8px;
            width: 64px;
            height: 64px;
        }

        .bank-name {
            font-weight: 600;
            color: #1f2937; /* gray-800 equivalent */
            font-size: 16px;
        }

        .norek {
            color: #4b5563; /* gray-600 equivalent */
            font-size: 14px;
        }

        .atas-nama {
            font-size: 14px;
            color: #374151; /* gray-700 equivalent */
            margin-top: 4px;
        }

        /* Info Payment */
        .payment-info {
            background-color: #eef2ff; /* indigo-50 equivalent */
            border-radius: 8px;
            padding: 16px;
        }

        .payment-title {
            font-size: 18px;
            font-weight: 600;
            color: #312e81; /* indigo-800 equivalent */
            margin-bottom: 8px;
        }

        .payment-text {
            color: #374151; /* gray-700 equivalent */
        }

        /* Footer */
        .footer {
            text-align: center;
            margin-top: 32px;
        }

        .footer-text {
            color: #4b5563; /* gray-600 equivalent */
        }

        .company-title {
            font-size: 20px;
            font-weight: 700;
            color: #312e81; /* indigo-800 equivalent */
            margin: 16px 0 4px;
        }

        .company-subtitle {
            color: #4b5563; /* gray-600 equivalent */
            margin-bottom: 16px;
        }

        .contact-info {
            display: flex;
            justify-content: center;
            gap: 24px;
            margin-top: 16px;
        }

        .contact-item {
            display: flex;
            align-items: center;
            color: #4b5563; /* gray-600 equivalent */
        }

        .contact-icon {
            width: 20px;
            height: 20px;
            margin-right: 4px;
            color: #6b7280; /* gray-500 equivalent */
        }

        /* Responsive */
        @media (max-width: 768px) {
            .grid-cols-2,
            .grid-cols-3 {
                grid-template-columns: 1fr;
            }
            
            .header-content {
                flex-direction: column;
                align-items: center;
                text-align: center;
            }
            
            .logo-container {
                text-align: center;
                margin-top: 20px;
            }
            
            .contact-info {
                flex-direction: column;
                align-items: center;
                gap: 12px;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="receipt-container">
            <!-- Header dengan watermark -->
            <div class="header">
                <div class="watermark">MIDHOUSE</div>
                <div class="header-content">
                    <div>
                        <h1 class="title">KWITANSI BOOKING</h1>
                        <p class="invoice-id">Invoice: {{ $booking->invoice_id }}</p>
                    </div>
                    <div class="logo-container">
                        <!-- <img src="https://midhouse.id/assets/midhouse-lg-BTn6Gm79.png" alt="MidHouse Logo" class="logo"> -->
                        <p class="company-name">MidHouse</p>
                    </div>
                </div>
            </div>

            <!-- Informasi Pelanggan -->
            <div class="section">
                <h2 class="section-title">Informasi Pelanggan</h2>
                <div class="grid grid-cols-2">
                    <div>
                        <p class="text-gray-600"><span class="font-medium text-gray-800">Nama:</span> {{ $booking->user->name }}</p>
                        <p class="text-gray-600"><span class="font-medium text-gray-800">Email:</span> {{ $booking->user->email }}</p>
                    </div>
                    <div>
                        <p class="text-gray-600"><span class="font-medium text-gray-800">Tanggal Check-in:</span> {{ $booking->checkin }}</p>
                        <p class="text-gray-600"><span class="font-medium text-gray-800">Durasi:</span> {{ $booking->quantity }} bulan</p>
                    </div>
                </div>
            </div>

            <!-- Detail Kamar -->
            <div class="section">
                <h2 class="section-title">Detail Kamar</h2>
                @if($booking->room)
                <div class="table-container">
                    <table>
                        <thead>
                            <tr>
                                <th>Kode Kamar</th>
                                <!-- <th>Harga/Bulan</th> -->
                                <th>Jumlah</th>
                                <th>Subtotal</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>{{ $booking->room->kode_kamar }}</td>
                                <!-- <td>Rp {{ number_format($booking->room->property_type?->harga, 0, ',', '.') }}</td> -->
                                <td>{{ $booking->quantity }}</td>
                                <td class="font-medium">Rp {{ number_format($booking->total_price, 0, ',', '.') }}</td>
                            </tr>
                            <tr>
                                <td colspan="2" class="text-right font-medium text-gray-700">Total</td>
                                <td class="font-bold text-indigo-700">Rp {{ number_format($booking->total_price, 0, ',', '.') }}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                @else
                <p class="text-gray-600 italic">Detail kamar tidak tersedia</p>
                @endif
            </div>

            <!-- Rekening Pembayaran -->
            <div class="section">
                <h2 class="section-title">Rekening Pembayaran</h2>
                <div class="grid grid-cols-3">
                    @foreach($rekenings as $rekening)
                    <div class="rekening-card">
                        <div class="card-header">
                            <div class="card-icon">
                                <div class="icon-placeholder"></div>
                            </div>
                            <div>
                                <h3 class="bank-name">{{ $rekening->bank_name }}</h3>
                                <p class="norek">{{ $rekening->norek }}</p>
                            </div>
                        </div>
                        <p class="atas-nama"><span class="font-medium">Atas Nama:</span> {{ $rekening->atas_nama }}</p>
                    </div>
                    @endforeach
                </div>
            </div>

            <!-- Informasi Pembayaran -->
            <div class="section">
                <div class="payment-info">
                    <h3 class="payment-title">Informasi Pembayaran</h3>
                    <p class="payment-text">
                        Silakan lakukan pembayaran ke salah satu rekening di atas dan konfirmasi melalui menu pembayaran di aplikasi MidHouse.
                        Pembayaran harus dilakukan dalam waktu 24 jam setelah booking dibuat.
                    </p>
                </div>
                <div class="footer">
                    <p class="footer-text">Terima kasih telah mempercayakan hunian Anda kepada kami</p>
                    <div>
                        <p class="company-title">MidHouse Universe</p>
                        <p class="company-subtitle">Solusi Kost Terbaik di Kota Malang</p>
                        <div class="contact-info">
                            <div class="contact-item">
                                <svg class="contact-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" />
                                </svg>
                                <a href="https://api.whatsapp.com/send/?phone=6285137104648&text=Halo+admin%21+saya+dapat+informasi+dari%0Awww.midhouse.id%0ABoleh+konsultasi+lebih+lanjut%3F&type=phone_number&app_absent=0" style="text-decoration: none">+62 851 3710 4648</a>
                            </div>
                            <div class="contact-item">
                                <svg class="contact-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
                                </svg>
                                <span>midhouse.mlg@gmail.com</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>