<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Make Payment | IMMIA FINANCE LIMITED</title>
    
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    
    <style>
        :root {
            --zedbank-blue: #0077C5;
            --zedbank-blue-dark: #005A94;
        }

        .bg-zedbank-blue { background-color: var(--zedbank-blue); }
        .bg-zedbank-blue-dark { background-color: var(--zedbank-blue-dark); }
        .text-zedbank-blue { color: var(--zedbank-blue); }

        .sidebar { transition: all 0.3s ease; }
        @media (max-width: 768px) {
            .sidebar { transform: translateX(-100%); }
            .sidebar.active { transform: translateX(0); }
        }
        
        .method-card { transition: all 0.2s ease; border: 1px solid #e5e7eb; }
        .method-card:hover { 
            border-color: var(--zedbank-blue); 
            background-color: #f0f9ff;
            transform: translateY(-1px);
        }
        .method-card:active { transform: scale(0.98); }
    </style>
</head>
<body class="bg-gray-50">
    <?php
        $customer = Auth::guard('customer')->user();
        $hasProfilePicture = $customer->docpath && Storage::disk('public')->exists($customer->docpath);
        $profilePictureUrl = $hasProfilePicture ? asset('storage/' . $customer->docpath) : 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?auto=format&fit=crop&w=500&q=60';
    ?>

    <button id="mobile-menu-button" class="lg:hidden fixed top-4 left-4 z-50 bg-zedbank-blue text-white p-3 rounded-lg shadow-lg">
        <i class="fas fa-bars"></i>
    </button>

    <div id="sidebar" class="sidebar fixed inset-y-0 left-0 z-40 w-64 bg-zedbank-blue shadow-lg text-white">
        <div class="p-6 border-b border-zedbank-blue-dark">
            <div class="flex items-center space-x-3">
                <div class="w-10 h-10 bg-white rounded-lg flex items-center justify-center">
                    <i class="fas fa-hand-holding-usd text-zedbank-blue text-lg"></i>
                </div>
                <div>
                    <h1 class="text-xl font-bold">IMMIA FINANCE</h1>
                    <p class="text-blue-100 text-xs">Client Portal</p>
                </div>
            </div>
        </div>
        
        <nav class="p-4 space-y-2">
            <a href="<?php echo e(route('customer.dashboard')); ?>" class="flex items-center space-x-3 p-3 hover:bg-zedbank-blue-dark rounded-lg font-medium">
                <i class="fas fa-tachometer-alt w-5"></i>
                <span>Dashboard</span>
            </a>
            <a href="<?php echo e(route('customer.applications.index')); ?>" class="flex items-center space-x-3 p-3 hover:bg-zedbank-blue-dark rounded-lg font-medium">
                <i class="fas fa-file-invoice-dollar w-5"></i>
                <span>My Applications</span>
                <?php if(count($activeApplications) > 0): ?>
                <span class="ml-auto bg-white text-zedbank-blue text-xs px-2 py-1 rounded-full"><?php echo e(count($activeApplications)); ?></span>
                <?php endif; ?>
            </a>
            <a href="<?php echo e(route('customer.loans.index')); ?>" class="flex items-center space-x-3 p-3 hover:bg-zedbank-blue-dark rounded-lg font-medium">
                <i class="fas fa-hand-holding-usd w-5"></i>
                <span>My Loans</span>
                <?php if($loanStats['active_loans_count'] > 0): ?>
                <span class="ml-auto bg-green-400 text-white text-xs px-2 py-1 rounded-full font-bold"><?php echo e($loanStats['active_loans_count']); ?></span>
                <?php endif; ?>
            </a>
            <a href="<?php echo e(route('customer.loan.application.show')); ?>" class="flex items-center space-x-3 p-3 hover:bg-zedbank-blue-dark rounded-lg font-medium">
                <i class="fas fa-paper-plane w-5"></i>
                <span>Apply for Loan</span>
            </a>
            <a href="<?php echo e(route('customer.payments.method')); ?>" class="flex items-center space-x-3 p-3 bg-zedbank-blue-dark rounded-lg font-medium">
                <i class="fas fa-money-bill-wave w-5"></i>
                <span>Make Payment</span>
            </a>
            <a href="<?php echo e(route('customer.transactions.history')); ?>" class="flex items-center space-x-3 p-3 hover:bg-zedbank-blue-dark rounded-lg font-medium">
                <i class="fas fa-history w-5"></i>
                <span>Transaction History</span>
            </a>
            <a href="<?php echo e(route('customer.profile.show')); ?>" class="flex items-center space-x-3 p-3 hover:bg-zedbank-blue-dark rounded-lg font-medium">
                <i class="fas fa-user-cog w-5"></i>
                <span>Profile Settings</span>
            </a>
            <form method="POST" action="<?php echo e(route('customer.logout')); ?>" class="mt-8">
                <?php echo csrf_field(); ?>
                <button type="submit" class="flex items-center space-x-3 p-3 hover:bg-red-600 rounded-lg font-medium w-full text-left">
                    <i class="fas fa-sign-out-alt w-5"></i>
                    <span>Logout</span>
                </button>
            </form>
        </nav>
    </div>

    <div class="lg:ml-64">
        <header class="bg-zedbank-blue shadow-sm border-b border-zedbank-blue-dark">
            <div class="flex justify-between items-center px-4 sm:px-6 py-4">
                <div class="min-w-0 flex-1">
                    <h1 class="text-xl font-bold text-white">Make Payment</h1>
                    <p class="text-blue-50 text-sm">Select your preferred payment provider</p>
                </div>
                <div class="flex items-center space-x-4">
                    <div class="flex items-center space-x-3 p-2 rounded-lg bg-zedbank-blue-dark text-white">
                        <div class="w-8 h-8 rounded-full overflow-hidden border border-white">
                            <img src="<?php echo e($profilePictureUrl); ?>" alt="Profile" class="w-full h-full object-cover">
                        </div>
                        <span class="font-medium hidden sm:block"><?php echo e($customer->customer); ?></span>
                    </div>
                </div>
            </div>
        </header>

        <main class="p-4 sm:p-8 flex justify-center">
            <div class="w-full max-w-xl bg-white rounded-3xl shadow-sm border border-gray-100 overflow-hidden">
                <div class="p-8">
                    <div class="text-center mb-10 bg-blue-50 p-6 rounded-2xl">
                        <p class="text-xs font-bold text-zedbank-blue uppercase tracking-widest mb-1">Total Payable</p>
                        <h2 class="text-4xl font-black text-gray-900">
                            ZMW <?php echo e(number_format($selectedAmount ?? ($loanStats['total_next_due_amount'] ?? 0), 2)); ?>

                        </h2>
                    </div>

                    <div class="space-y-4">
                        <p class="text-[10px] font-bold text-gray-400 uppercase tracking-widest ml-1">Zambian Mobile Money</p>
                        
                        <button onclick="processPayment('MTN')" class="w-full method-card flex items-center justify-between p-5 rounded-2xl bg-white group text-left">
                            <div class="flex items-center">
                                <div class="w-12 h-12 bg-yellow-400 rounded-xl flex items-center justify-center shadow-sm">
                                    <span class="font-black italic text-[10px]">MTN</span>
                                </div>
                                <div class="ml-4">
                                    <h3 class="font-bold text-gray-800">MTN Mobile Money</h3>
                                    <p class="text-[10px] text-gray-400 font-bold uppercase">Push STK enabled</p>
                                </div>
                            </div>
                            <i class="fas fa-chevron-right text-gray-300 group-hover:text-zedbank-blue transition-colors"></i>
                        </button>

                        <button onclick="processPayment('Airtel')" class="w-full method-card flex items-center justify-between p-5 rounded-2xl bg-white group text-left">
                            <div class="flex items-center">
                                <div class="w-12 h-12 bg-red-600 rounded-xl flex items-center justify-center shadow-sm text-white">
                                    <span class="font-black italic text-[10px]">airtel</span>
                                </div>
                                <div class="ml-4">
                                    <h3 class="font-bold text-gray-800">Airtel Money</h3>
                                    <p class="text-[10px] text-gray-400 font-bold uppercase">Push STK enabled</p>
                                </div>
                            </div>
                            <i class="fas fa-chevron-right text-gray-300 group-hover:text-zedbank-blue transition-colors"></i>
                        </button>

                        <button onclick="processPayment('Zamtel')" class="w-full method-card flex items-center justify-between p-5 rounded-2xl bg-white group text-left">
                            <div class="flex items-center">
                                <div class="w-12 h-12 bg-green-600 rounded-xl flex items-center justify-center shadow-sm text-white text-xl">
                                    <i class="fas fa-mobile-alt"></i>
                                </div>
                                <div class="ml-4">
                                    <h3 class="font-bold text-gray-800">Zamtel Kwacha</h3>
                                    <p class="text-[10px] text-gray-400 font-bold uppercase">Reference Required</p>
                                </div>
                            </div>
                            <i class="fas fa-chevron-right text-gray-300 group-hover:text-zedbank-blue transition-colors"></i>
                        </button>
                    </div>

                    <div class="mt-10 pt-6 border-t border-gray-50 flex items-center justify-center space-x-2 text-gray-400">
                        <i class="fas fa-lock text-xs"></i>
                        <span class="text-[10px] font-bold uppercase tracking-widest">Secured via Lipila Payments Gateway</span>
                    </div>
                </div>
            </div>
        </main>
    </div>

    <form id="pay-form" action="<?php echo e(route('customer.payments.details')); ?>" method="POST" class="hidden">
        <?php echo csrf_field(); ?>
        <input type="hidden" name="provider" id="provider-input">
        <input type="hidden" name="amount" value="<?php echo e($selectedAmount ?? ($loanStats['total_next_due_amount'] ?? 0)); ?>">
    </form>

    <script>
        document.getElementById('mobile-menu-button').addEventListener('click', function() {
            document.getElementById('sidebar').classList.toggle('active');
        });

        // Submits selected method to the Details screen
        function processPayment(provider) {
            document.getElementById('provider-input').value = provider;
            document.getElementById('pay-form').submit();
        }
    </script>
</body>
</html><?php /**PATH /home/topacvbu/public_html/zedbankos.cloud/customer-portal/resources/views/customer/payment_method.blade.php ENDPATH**/ ?>