
    <!-- ═══════════════════════════════ MOBILE BOTTOM NAV ═══════════════════════════════ -->
    <div class="fixed bottom-0 left-0 right-0 z-30 md:hidden" x-data="{ fabOpen: false }">
        <div class="relative flex items-center justify-around bg-slate-900/95 backdrop-blur-lg px-2 py-3 border-t border-slate-800">
            <a href="deposit.php" class="flex flex-col items-center gap-0.5 text-slate-400 hover:text-emerald-400 transition">
                <i data-lucide="plus-circle" class="w-5 h-5"></i>
                <span class="text-[10px] font-medium">Deposit</span>
            </a>
            <a href="TradingMarket.php" class="flex flex-col items-center gap-0.5 text-slate-400 hover:text-blue-400 transition">
                <i data-lucide="bar-chart-2" class="w-5 h-5"></i>
                <span class="text-[10px] font-medium">Trade</span>
            </a>
            
            <button @click="fabOpen=!fabOpen" class="relative -top-5 w-14 h-14 rounded-full bg-gradient-to-r from-blue-600 to-indigo-600 text-white flex items-center justify-center shadow-lg shadow-blue-600/30 border-4 border-slate-950 hover:scale-105 active:scale-95 transition-transform">
                <i data-lucide="layout-grid" class="w-6 h-6"></i>
            </button>
            
            <a href="SupportCenter.php" class="flex flex-col items-center gap-0.5 text-slate-400 hover:text-amber-400 transition">
                <i data-lucide="help-circle" class="w-5 h-5"></i>
                <span class="text-[10px] font-medium">Support</span>
            </a>
            <a href="dashboard.php" class="flex flex-col items-center gap-0.5 text-blue-400">
                <i data-lucide="home" class="w-5 h-5"></i>
                <span class="text-[10px] font-medium">Home</span>
            </a>
        </div>

        <!-- FAB Menu -->
        <div x-show="fabOpen" @click.away="fabOpen=false" x-cloak
             class="fixed inset-0 bg-black/80 backdrop-blur-sm z-40 flex items-end justify-center pb-24 px-4"
             x-transition:enter="transition ease-out duration-200" x-transition:enter-start="opacity-0" x-transition:enter-end="opacity-100"
             x-transition:leave="transition ease-in duration-150" x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0">
            <div class="w-full max-w-sm bg-slate-900 border border-slate-800 rounded-3xl p-5 shadow-2xl animate-slide-up">
                <div class="flex justify-between items-center mb-4">
                    <h3 class="text-lg font-bold text-white">Quick Menu</h3>
                    <button @click="fabOpen=false" class="p-2 rounded-full bg-slate-800 text-slate-400 hover:text-white transition-colors">
                        <i data-lucide="x" class="w-5 h-5"></i>
                    </button>
                </div>
                <div class="grid grid-cols-3 gap-3">
                    <a href="buy-plan.php" class="flex flex-col items-center gap-2 p-4 rounded-2xl bg-slate-800 hover:bg-slate-700 transition">
                        <i data-lucide="target" class="w-6 h-6 text-emerald-400"></i>
                        <span class="text-xs text-slate-300">Invest</span>
                    </a>
                    <a href="withdrawals.php" class="flex flex-col items-center gap-2 p-4 rounded-2xl bg-slate-800 hover:bg-slate-700 transition">
                        <i data-lucide="wallet" class="w-6 h-6 text-rose-400"></i>
                        <span class="text-xs text-slate-300">Withdraw</span>
                    </a>
                    <a href="copy trade.php" class="flex flex-col items-center gap-2 p-4 rounded-2xl bg-slate-800 hover:bg-slate-700 transition">
                        <i data-lucide="copy" class="w-6 h-6 text-blue-400"></i>
                        <span class="text-xs text-slate-300">Copy</span>
                    </a>
                    <a href="AItradingBot.php" class="flex flex-col items-center gap-2 p-4 rounded-2xl bg-slate-800 hover:bg-slate-700 transition">
                        <i data-lucide="bot" class="w-6 h-6 text-purple-400"></i>
                        <span class="text-xs text-slate-300">AI Bot</span>
                    </a>
                    <a href="ReferralProgram.php" class="flex flex-col items-center gap-2 p-4 rounded-2xl bg-slate-800 hover:bg-slate-700 transition">
                        <i data-lucide="users" class="w-6 h-6 text-amber-400"></i>
                        <span class="text-xs text-slate-300">Refer</span>
                    </a>
                    <a href="ProfileSettings.php" class="flex flex-col items-center gap-2 p-4 rounded-2xl bg-slate-800 hover:bg-slate-700 transition">
                        <i data-lucide="settings" class="w-6 h-6 text-slate-400"></i>
                        <span class="text-xs text-slate-300">Settings</span>
                    </a>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    
    <script>
        function walletConnectManager() {
            return {
                darkMode: localStorage.theme === 'dark' || !localStorage.theme,
                sidebarOpen: false,
                hideBalance: localStorage.getItem('hideBalance') === 'true',
                showOtherWallets: false,
                showDetailsForm: false,
                selectedWallet: '',
                isConnecting: false,
                noticeClosed: false,
                walletDetails: {
                    address: '',
                    label: '',
                    network: ''
                },

                init() {
                    this.$watch('darkMode', val => {
                        localStorage.setItem('theme', val ? 'dark' : 'light');
                        document.documentElement.classList.toggle('dark', val);
                    });
                    
                    this.$nextTick(() => {
                        if (typeof lucide !== 'undefined') lucide.createIcons();
                    });
                },

                toggleBalance() {
                    this.hideBalance = !this.hideBalance;
                    localStorage.setItem('hideBalance', this.hideBalance);
                },

                selectWallet(wallet) {
                    this.selectedWallet = wallet;
                    this.showOtherWallets = false;
                    this.showDetailsForm = true;
                    this.walletDetails = { address: '', label: '', network: '' };
                    this.$nextTick(() => {
                        if (typeof lucide !== 'undefined') lucide.createIcons();
                    });
                },

                pasteAddress() {
                    navigator.clipboard.readText().then(text => {
                        this.walletDetails.address = text.trim();
                    }).catch(() => {
                        Swal.fire({
                            icon: 'error',
                            title: 'Paste Failed',
                            text: 'Please manually paste your wallet address',
                            confirmButtonColor: '#ef4444',
                            background: '#0f172a',
                            color: '#fff'
                        });
                    });
                },

                async connectWallet() {
                    if (!this.walletDetails.address || !this.walletDetails.network) {
                        Swal.fire({
                            icon: 'warning',
                            title: 'Missing Information',
                            text: 'Please fill in all required fields',
                            confirmButtonColor: '#f59e0b',
                            background: '#0f172a',
                            color: '#fff'
                        });
                        return;
                    }

                    this.isConnecting = true;
                    
                    const formData = new FormData();
                    formData.append('connect_wallet', '1');
                    formData.append('wallet_type', this.selectedWallet);
                    formData.append('wallet_address', this.walletDetails.address);
                    formData.append('wallet_network', this.walletDetails.network);
                    formData.append('wallet_name', this.walletDetails.label);
                    
                    try {
                        const response = await fetch('', {
                            method: 'POST',
                            body: formData
                        });
                        
                        const result = await response.json();
                        
                        if (result.success) {
                            await Swal.fire({
                                icon: 'success',
                                title: 'Wallet Connected!',
                                text: 'Your ' + this.selectedWallet + ' has been successfully connected.',
                                confirmButtonText: 'Continue',
                                confirmButtonColor: '#10b981',
                                background: '#0f172a',
                                color: '#fff',
                                timer: 2000,
                                timerProgressBar: true
                            });
                            window.location.reload();
                        } else {
                            throw new Error(result.error || 'Connection failed');
                        }
                    } catch (error) {
                        Swal.fire({
                            icon: 'error',
                            title: 'Connection Failed',
                            text: error.message || 'Could not connect wallet. Please try again.',
                            confirmButtonColor: '#ef4444',
                            background: '#0f172a',
                            color: '#fff'
                        });
                    } finally {
                        this.isConnecting = false;
                    }
                },

                async disconnectWallet() {
                    const result = await Swal.fire({
                        icon: 'warning',
                        title: 'Disconnect Wallet?',
                        text: 'This will permanently remove your wallet from our system. You can reconnect anytime.',
                        showCancelButton: true,
                        confirmButtonText: 'Yes, Disconnect',
                        cancelButtonText: 'Cancel',
                        confirmButtonColor: '#ef4444',
                        cancelButtonColor: '#374151',
                        background: '#0f172a',
                        color: '#fff'
                    });

                    if (result.isConfirmed) {
                        const formData = new FormData();
                        formData.append('disconnect_wallet', '1');
                        
                        try {
                            const response = await fetch('', {
                                method: 'POST',
                                body: formData
                            });
                            const data = await response.json();
                            
                            if (data.success) {
                                await Swal.fire({
                                    icon: 'success',
                                    title: 'Disconnected',
                                    text: 'Your wallet has been removed successfully.',
                                    confirmButtonColor: '#10b981',
                                    background: '#0f172a',
                                    color: '#fff',
                                    timer: 1500,
                                    showConfirmButton: false
                                });
                                window.location.reload();
                            } else {
                                throw new Error(data.error || 'Disconnect failed');
                            }
                        } catch (e) {
                            Swal.fire({
                                icon: 'error',
                                title: 'Error',
                                text: 'Failed to disconnect wallet. Please try again.',
                                confirmButtonColor: '#ef4444',
                                background: '#0f172a',
                                color: '#fff'
                            });
                        }
                    }
                }
            };
        }

        function copyAddress(address) {
            navigator.clipboard.writeText(address).then(() => {
                Swal.fire({
                    icon: 'success',
                    title: 'Copied!',
                    text: 'Wallet address copied to clipboard',
                    toast: true,
                    position: 'top-end',
                    showConfirmButton: false,
                    timer: 2000,
                    background: '#0f172a',
                    color: '#fff'
                });
            });
        }

        document.addEventListener('DOMContentLoaded', function() {
            if (typeof lucide !== 'undefined') lucide.createIcons();
        });
        document.addEventListener('alpine:init', () => Alpine.nextTick(() => lucide.createIcons()));
    </script>

    <!-- Chaport Chat -->
    <script>
    (function(w,d){
        w.chaportConfig = { appId:'69184d13ffad4bc7d0a4d7f7' };
        if(w.chaport)return;
        var s=d.createElement('script');
        s.type='text/javascript';
        s.async=true;
        s.src='https://app.chaport.com/javascripts/insert.js';
        d.getElementsByTagName('script')[0].parentNode.insertBefore(s,d.getElementsByTagName('script')[0]);
    })(window,document);
    </script>