<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>PBM DATA HUB</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.css">
    <script src="https://js.paystack.co/v1/inline.js"></script>
    <style>
        body {
            font-family: 'Poppins', sans-serif;
            background-color: #1a202c;
            color: #e2e8f0;
        }
        .spinner {
            width: 50px;
            height: 50px;
            border: 3px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            border-top-color: #fff;
            animation: spin 1s ease-in-out infinite;
        }
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        .btn-hover:hover {
            filter: brightness(110%);
            transform: translateY(-2px);
            transition: all 0.3s ease;
        }
        .active-nav {
            background-color: rgba(255, 255, 255, 0.1);
            border-radius: 9999px;
        }
        .glass-effect {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border-radius: 10px;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }
    </style>
</head>
<body class="flex flex-col items-center justify-between min-h-screen text-sm sm:text-base">
    <!-- Navbar -->
    <nav class="bg-gray-800 w-full py-4 flex justify-center items-center fixed top-0 z-10 glass-effect">
        <h1 class="text-yellow-400 text-xl sm:text-2xl font-bold">
            <span class="material-icons mr-2 align-middle">bolt</span>PBM DATA HUB
        </h1>
    </nav>

    <!-- Main Content -->
    <div id="main-content" class="glass-effect p-6 rounded-lg shadow-lg w-full max-w-md mt-20 mx-4 mb-24 hidden">
        <!-- Home Section -->
        <div id="home-section" class="hidden">
            <h2 class="text-white text-2xl font-semibold mb-4">
                <span class="material-icons mr-2 align-middle">home</span>Home
            </h2>
            <div id="user-greeting" class="text-yellow-400 text-lg mb-6"></div>
            <div class="grid grid-cols-2 gap-4 mb-6">
                <div class="glass-effect p-4 rounded-lg">
                    <p class="text-gray-300 text-sm">Total Spent</p>
                    <p id="total-spent" class="text-white text-lg font-semibold"></p>
                </div>
                <div class="glass-effect p-4 rounded-lg">
                    <p class="text-gray-300 text-sm">Orders Made</p>
                    <p id="orders-made" class="text-white text-lg font-semibold"></p>
                </div>
                <div class="glass-effect p-4 rounded-lg">
                    <p class="text-gray-300 text-sm">Data Activated</p>
                    <p id="data-activated" class="text-white text-lg font-semibold"></p>
                </div>
                <div class="glass-effect p-4 rounded-lg">
                    <p class="text-gray-300 text-sm">Last Order</p>
                    <p id="last-order" class="text-white text-lg font-semibold"></p>
                </div>
            </div>
            <div class="flex space-x-4">
                <button id="purchase-button" class="flex-1 bg-blue-600 text-white px-4 py-3 rounded-full text-sm btn-hover flex items-center justify-center transition-all duration-300">
                    <span class="material-icons mr-2">start</span>DATA OFFERS
                </button>
                <a href="agent.html" class="flex-1">
                    <button class="w-full bg-green-600 text-white px-4 py-3 rounded-full text-sm btn-hover flex items-center justify-center transition-all duration-300">
                        <span class="material-icons mr-2">support_agent</span>Agent Portal
                    </button>
                </a>
            </div>
        </div>

        <!-- Bundle Purchase Section -->
        <div id="bundle-purchase-section" class="hidden">
            <div class="flex items-center mb-4">
                <img src="https://storage.googleapis.com/a1aa/image/05S6wOFvzhqLJp5bN2mUJ44neY6ge1sDZrNMviWL3Bv3tifnA.jpg" alt="MTN logo" class="w-12 h-12 rounded-full" width="48" height="48"/>
                <h1 class="text-yellow-400 text-xl font-bold ml-3">MTN OFFERS</h1>
            </div>
            <div class="bg-red-600 text-white p-3 rounded-lg mb-4">
                <span class="material-icons mr-2 align-middle">info</span>
                Your bundle will arrive within the next 5 - 20 minutes after a purchase.
            </div>
            <div class="mb-4">
                <label for="phone-number" class="block text-gray-300 mb-2">
                    <span class="material-icons mr-2 align-middle">phone</span>PHONE NUMBER
                </label>
                <input type="text" id="phone-number" class="w-full p-3 bg-gray-700 text-gray-300 rounded-lg text-sm" placeholder="Enter phone number"/>
            </div>
            <div class="mb-4">
                <label for="network" class="block text-gray-300 mb-2">
                    <span class="material-icons mr-2 align-middle">network_cell</span>NETWORK
                </label>
                <select id="network" class="w-full p-3 bg-gray-700 text-gray-300 rounded-lg text-sm">
                    <option value="">Select Network</option>
                    <option value="mtn">MTN</option>
                    <option value="at">AirtelTigo</option>
                </select>
            </div>
            <div id="bundle-volume-container"></div>
            <div id="bundle-price" class="mb-4 text-gray-300 font-semibold"></div>
            <button id="send-bundle" class="w-full bg-red-600 text-white px-4 py-3 rounded-full text-sm btn-hover transition-all duration-300">
                <span class="material-icons mr-2 align-middle">send</span>Send Bundle
            </button>
            <div id="loader" class="hidden mt-4 flex justify-center">
                <div class="spinner"></div>
            </div>
        </div>

        <!-- Order Receipt Section -->
        <div id="order-receipt" class="hidden bg-white text-gray-800 p-6 rounded-lg mt-4">
            <h3 class="text-2xl font-semibold mb-4">Order Receipt</h3>
            <div id="receipt-content" class="space-y-2"></div>
        </div>
    </div>

    <!-- Bottom Bar Navigation -->
    <div class="bg-gray-800 w-full py-4 flex justify-around items-center fixed bottom-0 z-10 glass-effect">
        <a href="#" id="home-icon" class="text-gray-400 hover:text-yellow-400 p-2 flex flex-col items-center transition-colors duration-300">
            <span class="material-icons text-2xl">home</span>
            <span class="text-xs mt-1">Home</span>
        </a>
        <a href="#" id="data-icon" class="text-gray-400 hover:text-yellow-400 p-2 flex flex-col items-center transition-colors duration-300">
            <span class="material-icons text-2xl">wifi</span>
            <span class="text-xs mt-1">Data</span>
        </a>
        <a href="#" id="profile-icon" class="text-gray-400 hover:text-yellow-400 p-2 flex flex-col items-center transition-colors duration-300">
            <span class="material-icons text-2xl">person</span>
            <span class="text-xs mt-1">Profile</span>
        </a>
        <a href="#" id="orders-icon" class="text-gray-400 hover:text-yellow-400 p-2 flex flex-col items-center transition-colors duration-300">
            <span class="material-icons text-2xl">inventory</span>
            <span class="text-xs mt-1">Orders</span>
        </a>
        <a href="#" id="agent-icon" class="text-gray-400 hover:text-yellow-400 p-2 flex flex-col items-center transition-colors duration-300">
            <span class="material-icons text-2xl">support_agent</span>
            <span class="text-xs mt-1">Report</span>
        </a>
        <a href="#" id="logout" class="text-gray-400 hover:text-yellow-400 p-2 flex flex-col items-center transition-colors duration-300">
            <span class="material-icons text-2xl">logout</span>
            <span class="text-xs mt-1">Logout</span>
        </a>
    </div>

    <!-- Login Page -->
    <div id="login-page" class="glass-effect p-6 rounded-lg shadow-lg w-full max-w-md mt-20 mx-4 mb-24">
        <h2 class="text-white text-2xl font-semibold mb-4">
            <span class="material-icons mr-2 align-middle">login</span>Login
        </h2>
        <div class="mb-4">
            <label for="login-email" class="block text-gray-300 mb-2">
                <span class="material-icons mr-2 align-middle">email</span>Email
            </label>
            <input type="email" id="login-email" class="w-full p-3 bg-gray-700 text-gray-300 rounded-lg text-sm" placeholder="Enter your email"/>
        </div>
        <div class="mb-4">
            <label for="login-password" class="block text-gray-300 mb-2">
                <span class="material-icons mr-2 align-middle">lock</span>Password
            </label>
            <input type="password" id="login-password" class="w-full p-3 bg-gray-700 text-gray-300 rounded-lg text-sm" placeholder="Enter your password"/>
        </div>
        <div class="flex space-x-2">
            <button id="login-button" class="flex-1 bg-green-600 text-white px-4 py-3 rounded-full text-sm btn-hover transition-all duration-300">
                <span class="material-icons mr-2 align-middle">login</span>Login
            </button>
            <button id="go-to-signup" class="flex-1 bg-blue-600 text-white px-4 py-3 rounded-full text-sm btn-hover transition-all duration-300">
                <span class="material-icons mr-2 align-middle">person_add</span>Sign Up
            </button>
            <button id="go-to-reset" class="flex-1 bg-yellow-600 text-white px-4 py-3 rounded-full text-sm btn-hover transition-all duration-300">
                <span class="material-icons mr-2 align-middle">key</span>Reset
            </button>
        </div>
    </div>

    <!-- Sign Up Page -->
    <div id="signup-page" class="glass-effect p-6 rounded-lg shadow-lg w-full max-w-md mt-20 mx-4 mb-24 hidden">
        <h2 class="text-white text-2xl font-semibold mb-4">
            <span class="material-icons mr-2 align-middle">person_add</span>Sign Up
        </h2>
        <div class="mb-4">
            <label for="signup-name" class="block text-gray-300 mb-2">
                <span class="material-icons mr-2 align-middle">person</span>Name
            </label>
            <input type="text" id="signup-name" class="w-full p-3 bg-gray-700 text-gray-300 rounded-lg text-sm" placeholder="Enter your name"/>
        </div>
        <div class="mb-4">
            <label for="signup-email" class="block text-gray-300 mb-2">
                <span class="material-icons mr-2 align-middle">email</span>Email
            </label>
            <input type="email" id="signup-email" class="w-full p-3 bg-gray-700 text-gray-300 rounded-lg text-sm" placeholder="Enter your email"/>
        </div>
        <div class="mb-4">
            <label for="signup-phone" class="block text-gray-300 mb-2">
                <span class="material-icons mr-2 align-middle">phone</span>Phone
            </label>
            <input type="tel" id="signup-phone" class="w-full p-3 bg-gray-700 text-gray-300 rounded-lg text-sm" placeholder="Enter your phone number"/>
        </div>
        <div class="mb-4">
            <label for="signup-password" class="block text-gray-300 mb-2">
                <span class="material-icons mr-2 align-middle">lock</span>Password
            </label>
            <input type="password" id="signup-password" class="w-full p-3 bg-gray-700 text-gray-300 rounded-lg text-sm" placeholder="Enter your password"/>
        </div>
        <div class="mb-4">
            <label for="signup-confirm-password" class="block text-gray-300 mb-2">
                <span class="material-icons mr-2 align-middle">lock</span>Confirm Password
            </label>
            <input type="password" id="signup-confirm-password" class="w-full p-3 bg-gray-700 text-gray-300 rounded-lg text-sm" placeholder="Confirm your password"/>
        </div>
        <div class="flex space-x-2">
            <button id="signup-button" class="flex-1 bg-green-600 text-white px-4 py-3 rounded-full text-sm btn-hover transition-all duration-300">
                <span class="material-icons mr-2 align-middle">person_add</span>Sign Up
            </button>
            <button id="go-to-login" class="flex-1 bg-blue-600 text-white px-4 py-3 rounded-full text-sm btn-hover transition-all duration-300">
                <span class="material-icons mr-2 align-middle">login</span>Login
            </button>
        </div>
    </div>

    <!-- Reset Password Page -->
    <div id="reset-page" class="glass-effect p-6 rounded-lg shadow-lg w-full max-w-md mt-20 mx-4 mb-24 hidden">
        <h2 class="text-white text-2xl font-semibold mb-4">
            <span class="material-icons mr-2 align-middle">key</span>Reset Password
        </h2>
        <div class="mb-4">
            <label for="reset-email" class="block text-gray-300 mb-2">
                <span class="material-icons mr-2 align-middle">email</span>Email
            </label>
            <input type="email" id="reset-email" class="w-full p-3 bg-gray-700 text-gray-300 rounded-lg text-sm" placeholder="Enter your email"/>
        </div>
        <div class="flex space-x-2">
            <button id="reset-button" class="flex-1 bg-yellow-600 text-white px-4 py-3 rounded-full text-sm btn-hover transition-all duration-300">
                <span class="material-icons mr-2 align-middle">key</span>Reset
            </button>
            <button id="go-to-login-from-reset" class="flex-1 bg-blue-600 text-white px-4 py-3 rounded-full text-sm btn-hover transition-all duration-300">
                <span class="material-icons mr-2 align-middle">arrow_back</span>Back
            </button>
        </div>
    </div>

    <script>
        var s=document.createElement('script');s.src='pathenv.js';s.type='module';document.body.appendChild(s);
    </script>

    <!-- Profile Page -->
    <div id="profile-page" class="glass-effect p-6 rounded-lg shadow-lg w-full max-w-md mt-20 mx-4 mb-24 hidden">
        <h2 class="text-white text-2xl font-semibold mb-4">
            <span class="material-icons mr-2 align-middle">person</span>Profile
        </h2>
        <div id="profile-info" class="text-gray-300 mb-6"></div>
        <div id="edit-profile" class="mt-6">
            <h3 class="text-white text-xl font-semibold mb-4">Edit Profile</h3>
            <div class="mb-4">
                <label for="edit-name" class="block text-gray-300 mb-2">
                    <span class="material-icons mr-2 align-middle">person</span>Name
                </label>
                <input type="text" id="edit-name" class="w-full p-3 bg-gray-700 text-gray-300 rounded-lg text-sm" placeholder="Enter your name"/>
            </div>
            <div class="mb-4">
                <label for="edit-phone" class="block text-gray-300 mb-2">
                    <span class="material-icons mr-2 align-middle">phone</span>Phone
                </label>
                <input type="tel" id="edit-phone" class="w-full p-3 bg-gray-700 text-gray-300 rounded-lg text-sm" placeholder="Enter your phone number"/>
            </div>
            <button id="save-profile" class="w-full bg-green-600 text-white px-4 py-3 rounded-full text-sm btn-hover transition-all duration-300">
                <span class="material-icons mr-2 align-middle">save</span>Save Changes
            </button>
            <p id="edit-count" class="text-gray-400 mt-4 text-xs">Edits remaining: 3</p>
        </div>
    </div>

    <!-- Orders Page -->
    <div id="orders-page" class="glass-effect p-6 rounded-lg shadow-lg w-full max-w-md mt-20 mx-4 mb-24 hidden">
        <h2 class="text-white text-2xl font-semibold mb-4">
            <span class="material-icons mr-2 align-middle">inventory</span>Your Orders
        </h2>
        <div id="orders-list" class="text-gray-300 space-y-4 max-h-96 overflow-y-auto pr-2"></div>
    </div>

    <!-- Agent Page -->
    <div id="agent-page" class="glass-effect p-6 rounded-lg shadow-lg w-full max-w-md mt-20 mx-4 mb-24 hidden">
        <h2 class="text-white text-2xl font-semibold mb-4">
            <span class="material-icons mr-2 align-middle">support_agent</span>Agent Support
        </h2>
        <div class="text-gray-300 mb-6">
            <p>Need help? Contact our support team:</p>
            <p class="mt-3"><span class="material-icons mr-2 align-middle">phone</span>Phone: 054 608 2554</p>
            <p class="mt-2"><span class="material-icons mr-2 align-middle">email</span>Email: support@pbmdatahub.com</p>
        </div>
        <div class="mt-6">
            <h3 class="text-white text-xl font-semibold mb-4">Report to us</h3>
            <textarea id="support-message" class="w-full p-3 bg-gray-700 text-gray-300 rounded-lg text-sm" rows="4" placeholder="You can report failed and delayed orders, Bugs or system issues!"></textarea>
            <button id="send-support-message" class="w-full mt-4 bg-blue-600 text-white px-4 py-3 rounded-full text-sm btn-hover transition-all duration-300">
                <span class="material-icons mr-2 align-middle">send</span>Send Message
            </button>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.js"></script>
</body>
</html>