<!-- Main Content -->



<style>
    @media (max-width:780px) {

        .divblock {

            display: block !important;

        }



        .card-2 {

            margin-top: 20px !important;

        }



        .btn-secondary {

            width: 25%;

        }

    }

    /* Modal Background */
    .custom-modal {
        display: <?= (!empty($id)) ? 'block' : 'none'; ?> !important;
        position: fixed;
        z-index: 9999;
        left: 0;
        overflow-y: scroll;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(5px);
        margin-bottom: 50px;
    }

    /* Modal Content Box */
    .modal-content {
        background-color: #1a1a1a;
        margin: 50px auto;
        padding: 30px;
        border: 1px solid rgba(153, 69, 255, 0.3);
        width: 90%;
        max-width: 500px;
        border-radius: 1.5rem;
        color: white;
        box-shadow: 0 0 20px rgba(153, 69, 255, 0.2);
        text-align: center;
    }

    .modal-content p {
        font-size: 0.95rem;
        color: rgba(255, 255, 255, 0.8);
        line-height: 1.6;
        margin-bottom: 15px;
    }

    /* .modal-content b {
        color: #14F195;
    } */

    .btn-dark-custom {
        background-color: #000;
        color: white;
        padding: 12px 25px;
        border-radius: 0.75rem;
        border: 1px solid #333;
        cursor: pointer;
        transition: 0.3s;
        text-decoration: none;
        display: inline-block;
    }

    .btn-dark-custom:hover {
        background-color: #222;
    }
</style>

<div style="padding-top: 140px; padding-bottom: 80px; min-height: 100vh;">

    <div class="container">

        <!-- Header -->

        <div class="text-center" style="margin-bottom: 30px;"> <?php if ($this->session->flashdata()) {

                                                                    echo Helpers::showFlash($this->session->flashdata("response"));
                                                                } ?></div>

        <!-- <div class="text-center" style="margin-bottom: 3rem;">

            <h1 style="font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem;">

                Deposit <span class="gradient-text">SOL</span>

            </h1>

            <p style="color: rgba(255,255,255,0.7); font-size: 1.25rem;">

                Send SOL to start earning daily rewards

            </p>

        </div> -->



        <?php

        $adminData = Helpers::getAdmin(true);

        ?>

        <!-- Stats -->

        <!-- <div class="grid grid-2" style="margin-bottom: 3rem; max-width: 900px; margin-left: auto; margin-right: auto;">

            <div class="card" style="position: relative; overflow: hidden;">

                <div style="position: absolute; top: 0; right: 0; width: 128px; height: 128px; background: linear-gradient(135deg, var(--solana-purple), var(--solana-cyan)); opacity: 0.1; filter: blur(40px); border-radius: 50%;"></div>

                <div style="position: relative;">

                    <div style="display: flex; justify-content: space-between; margin-bottom: 1rem;">

                        <div>

                            <p style="color: rgba(255,255,255,0.6); font-size: 0.875rem; margin-bottom: 0.5rem;">Your Balance</p>

                            <h3 style="font-size: 2rem; font-weight: 700;"><?= MemberHelper::user_wallet(); ?> SOL</h3>

                        </div>

                        <div style="padding: 0.75rem; background: rgba(255,255,255,0.05); border-radius: 0.75rem; height: fit-content;">

                            💰

                        </div>

                    </div>

                </div>

            </div>



            <div class="card" style="position: relative; overflow: hidden;">

                <div style="position: absolute; top: 0; right: 0; width: 128px; height: 128px; background: linear-gradient(135deg, var(--solana-purple), var(--solana-cyan)); opacity: 0.1; filter: blur(40px); border-radius: 50%;"></div>

                <div style="position: relative;">

                    <div style="display: flex; justify-content: space-between; margin-bottom: 1rem;">

                        <div>

                            <p style="color: rgba(255,255,255,0.6); font-size: 0.875rem; margin-bottom: 0.5rem;">Today Earnings</p>

                            <h3 style="font-size: 2rem; font-weight: 700;"><?= MemberHelper::user_daily_earnings(); ?> SOL</h3>

                        </div>

                        <div style="padding: 0.75rem; background: rgba(255,255,255,0.05); border-radius: 0.75rem; height: fit-content;">

                            ✓

                        </div>

                    </div>

                </div>

            </div>

        </div> -->



        <!-- Main Content Grid -->

        <div class="divblock" style="display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; max-width: 1200px; margin: 0 auto;">

            <!-- QR Code Section -->

            <div>
                <div class="card">

                    <h2 style="font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem;">Your Deposit Address</h2>



                    <!-- QR Code -->

                    <div style="text-align: center; margin-bottom: 1.5rem;">

                        <div style="background: transparent; padding: 1rem; border-radius: 1rem; display: inline-block;">

                            <div id="" style="width: 200px;height:200px;border:white 1px solid"><img src="<?= base_url() ?>uploads/files/qr/<?= $adminData['id']; ?>/<?= $adminData['usdt_qr']; ?>" alt="" style="width: 100%;"></div>

                        </div>

                    </div>

                    <form action="<?= base_url("confirm_deposit") ?>" method="post">

                        <!-- Address Display -->

                        <div style="margin-bottom: 1.5rem;">

                            <label style="font-size: 0.875rem; color: rgba(255,255,255,0.6); display: block; margin-bottom: 0.5rem;">Ripple Address</label>

                            <div style="display: flex; gap: 0.5rem;">

                                <div class="glass" style="flex: 1; padding: 1rem; border-radius: 0.75rem; font-family: monospace; font-size: 0.875rem; word-break: break-all;">

                                    <?= $adminData['btc_address']; ?>

                                </div>

                                <button class="btn btn-secondary" style="padding: 1rem;" onclick="copyAddress()">

                                    <span id="copyBtn">Copy</span>

                                </button>

                            </div>

                        </div>

                        <div class="input-group">

                            <label class="input-label">Enter Amount (XRP)</label>

                            <input type="number" class="input" name="amount" placeholder="Enter Amount (XRP)" required>

                        </div>

                        <!-- Finish Button -->

                        <button class="btn btn-primary" type="submit" style="width: 100%;max-width:unset!important">

                            Finish Deposit

                        </button>

                    </form>

                    <!-- Success Message -->

                    <!-- <div id="successMessage" class="hidden" style="margin-top: 1rem; padding: 1rem; background: rgba(20, 241, 149, 0.1); border: 1px solid rgba(20, 241, 149, 0.3); border-radius: 0.75rem;">

                    <div style="display: flex; align-items: start; gap: 0.75rem;">

                        <div style="color: #14F195; font-size: 1.25rem;">✓</div>

                        <div>

                            <div style="color: #14F195; font-weight: 600; margin-bottom: 0.25rem;">Deposit Confirmed!</div>

                            <div style="font-size: 0.875rem; color: rgba(255,255,255,0.8);">Your SOL is now staking and earning rewards.</div>
                        </div>

                    </div>

                </div> -->

                </div>
                <div class="card" style="background: linear-gradient(135deg, rgba(153, 69, 255, 0.1), rgba(0, 212, 255, 0.1)); border: 1px solid rgba(153, 69, 255, 0.3); text-align: center;margin-top:30px">

                    <div style="font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5rem;" class="gradient-text">2%</div>

                    <div style="color: rgba(255,255,255,0.8); margin-bottom: 0.5rem;">Monthly earnings</div>

                    <div style="font-size: 0.875rem; color: rgba(255,255,255,0.6);">Rewards compound daily and are automatically added to your balance</div>

                </div>
            </div>


            <!-- Instructions Section -->

            <div class="card-2" style="display: flex; flex-direction: column; gap: 1.5rem;">

                <!-- How to Deposit -->

                <div class="card">

                    <h3 style="font-size: 1.25rem; font-weight: 700; margin-bottom: 1.5rem;">How to Deposit</h3>



                    <div style="display: flex; gap: 0.75rem; margin-bottom: 1.5rem;">

                        <div style="width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--solana-purple), var(--solana-blue)); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;">1</div>

                        <div>

                            <div style="font-weight: 600; margin-bottom: 0.25rem;">Send XRP</div>

                            <div style="font-size: 0.875rem; color: rgba(255,255,255,0.7);">Transfer XRP from your wallet to the address above</div>

                        </div>

                    </div>



                    <div style="display: flex; gap: 0.75rem; margin-bottom: 1.5rem;">

                        <div style="width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--solana-purple), var(--solana-blue)); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;">2</div>

                        <div>

                            <div style="font-weight: 600; margin-bottom: 0.25rem;">Enter Amount</div>

                            <div style="font-size: 0.875rem; color: rgba(255,255,255,0.7);">Enter the amount you have sent in the field.</div>

                        </div>

                    </div>



                    <div style="display: flex; gap: 0.75rem; margin-bottom: 1.5rem;">

                        <div style="width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--solana-purple), var(--solana-blue)); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;">3</div>

                        <div>

                            <div style="font-weight: 600; margin-bottom: 0.25rem;">Click Finish Deposit</div>

                            <div style="font-size: 0.875rem; color: rgba(255,255,255,0.7);">After sending XRP, press "Finish Deposit" to complete the process</div>

                        </div>

                    </div>



                    <div style="display: flex; gap: 0.75rem;">

                        <div style="width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--solana-purple), var(--solana-blue)); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;">4</div>

                        <div>

                            <div style="font-weight: 600; margin-bottom: 0.25rem;">Wait for Confirmation</div>

                            <div style="font-size: 0.875rem; color: rgba(255,255,255,0.7);">Transactions usually confirms in few minutes</div>

                        </div>

                    </div>

                </div>


                <div class="card-2" style="display: flex; flex-direction: column; gap: 1.5rem;">



                    <div class="card" style="height: 100%;overflow-y:scroll;max-height:432px;overflow-y:scroll;">



                        <h3 style="font-size: 1.25rem; font-weight: 700; margin-bottom: 1.5rem;">Recent Deposits</h3>



                        <div style="display: flex; flex-direction: column; gap: 1rem;">



                            <?php $i = 1;



                            if (!empty($history)) {


                                foreach ($history as $row) {   ?>



                                    <div class="glass" style="padding: 1rem; border-radius: 0.75rem;">



                                        <div style="display: flex; justify-content: space-between; margin-bottom: 0.75rem;">



                                            <div>



                                                <div style="font-weight: 600; margin-bottom: 0.25rem;"><?= $row['amount']; ?> XRP</div>



                                                <!-- <div style="font-size: 0.875rem; color: rgba(255,255,255,0.6);"><?= $row['wallet_address']; ?></div> -->



                                            </div>



                                            <?php if ($row['status'] == '0') { ?>



                                                <div style="color: #ffa500; font-weight: 600; font-size: 0.875rem;">⏳ Pending</div>



                                            <?php } ?>



                                            <?php if ($row['status'] == '1') { ?>



                                                <div style="color: #14F195; font-weight: 600; font-size: 0.875rem;">✓ Confirmed</div>



                                            <?php } ?>



                                            <?php if ($row['status'] == '2') { ?>



                                                <div style="color: #ff7f76; font-weight: 600; font-size: 0.875rem;">❌ Unconfirmed</div>



                                            <?php } ?>



                                        </div>



                                        <div style="display: flex; justify-content: space-between; font-size: 0.875rem; color: rgba(255,255,255,0.6);">



                                            <div><?= date('j-M-Y', strtotime($row['date'])) ?></div>
                                            <!-- <a href="#" style="color: var(--solana-cyan); text-decoration: none;">View on Solscan</a> -->



                                        </div>



                                    </div>



                                <?php



                                }
                            } else { ?>



                                <div>Data not found...</div>



                            <?php } ?>



                        </div>



                    </div>







                </div>
                <!-- Important Notes -->

                <!-- <div class="card">

                    <div style="display: flex; gap: 0.75rem;">

                        <div style="color: var(--solana-cyan); font-size: 1.25rem; flex-shrink: 0;">ℹ️</div>

                        <div>

                            <h3 style="font-size: 1.125rem; font-weight: 700; margin-bottom: 1rem;">Important Notes</h3>

                            <ul style="list-style: none; padding: 0; color: rgba(255,255,255,0.7); font-size: 0.875rem; line-height: 1.8;">

                                <li>• Minimum deposit: 10 SOL</li>

                                <li>• Network fees apply (paid to Solana validators)</li>

                                <li>• Always double-check the address before sending</li>

                                <li>• Deposits are irreversible once confirmed</li>

                                <li>• Contact support if you need assistance</li>

                            </ul>

                        </div>

                    </div>

                </div> -->



                <!-- APY Info -->



            </div>

        </div>

    </div>

</div>


<div class="custom-modal">
    <div class="modal-content">
        <!-- <div style="font-size: 3rem; margin-bottom: 1rem;">⏳</div> -->
        <h2 style="margin-bottom: 1.5rem; font-weight: 700;">Notice</h2>

        <p>Defilenders will receive your payment once it is confirmed on the Ripple blockchain network.</p>
        <p>This may take only a few minutes upto several hours, depending on the blockchain.</p>
        <p>Once payment is approved, you will automatically find the amount credited to your top up balance ready to use.</p>
        <p>If your top up balance was not credited within 24 hours, please contact the support team via the support panel on your back office.</p>

        <p>Thank you<br><b class="text-primary">Defilenders</b> Finance Team</p>

        <a href="<?= base_url() ?>main_wallet" class="btn-dark-custom mt-3">
            Go Back To Dashboard
        </a>
    </div>
</div>

<script>
    // Generate QR Code

    const depositAddress = '<?= $adminData['btc_address']; ?>';

    new QRCode(document.getElementById("qrcode"), {

        text: depositAddress,

        width: 220,

        height: 220,

        colorDark: "#000000",

        colorLight: "#ffffff",

        correctLevel: QRCode.CorrectLevel.H

    });



    function copyAddress() {

        copyToClipboard(depositAddress, document.getElementById('copyBtn'));

    }



    // function finishDeposit() {

    //     document.getElementById('successMessage').classList.remove('hidden');

    //     showNotification('Deposit confirmed successfully!');

    // }
</script>