@extends('layouts.user')

@section('title')
    Fund AI Bot
@endsection

@section('content')

<!-- Start Hero -->
<section class="relative lg:pb-24 pb-16 md:mt-[84px] mt-[70px]">
            <div class="relative md:container container-fluid">
                <div class="relative overflow-hidden md:rounded-md shadow dark:shadow-gray-700 h-52 bg-[url('../../assets/images/hero/pages.html')] bg-center bg-no-repeat bg-cover" 
                style="background-image: url('{{ asset('images/profile-1.jpg') }}');"></div>
            </div><!--end container-->

            <div class="container relative mt-16 md:mt-24">
                <div class="md:flex">
                    <div class="lg:w-1/4 md:w-1/3 md:px-3">
                        <div class="relative -mt-32 md:-mt-48">
                            <div class="p-6 bg-white rounded-md shadow dark:shadow-gray-800 dark:bg-slate-900">
                                <div class="mb-5 text-center profile-pic">
                                    <!-- <input id="pro-img" name="profile-image" type="file" class="hidden" onchange="loadFile(event)" /> -->
                                    <div>
                                        <div class="relative mx-auto h-28 w-28">
                                            <img src="{{ asset('images/avatar-1.png') }}" class="rounded-full shadow dark:shadow-gray-800 ring-4 ring-slate-50 dark:ring-slate-800" id="profile-image" alt="">
                                            <label class="absolute inset-0 cursor-pointer" for="pro-img"></label>
                                        </div>

                                        <div class="mt-4">
                                            <h5 class="text-lg font-semibold">{{ auth()->user()->username }}</h5>
                                            <p class="text-slate-400">{{ auth()->user()->email }}</p>
                                        </div>
                                    </div>
                                </div>

                                <!-- Side Nav -->
                                <x-side-nav/>
                                
                            </div>
                        </div>
                    </div>

                    <x-alert/>
                    
                    <div class="mt-6 lg:w-3/4 md:w-2/3 md:px-3 md:mt-0">
                        <div class="pt-4 bg-white rounded-md shadow dark:shadow-gray-800 dark:bg-slate-900">
                           
                        <div class="2xl:flex 2xl:space-x-[48px]">
                            <div class="2xl:w-[424px]">
                                <div class="w-full rounded-xl bg-white dark:bg-darkblack-600 px-4 md:px-7 py-11 mb-[48px]">
                                    <div class="px-4 py-8 pb-12 border rounded-lg md:px-7 border-bgray-300 dark:border-darkblack-400">
                                    <h3 class="text-2xl font-semibold text-bgray-900 dark:text-white">
                                        {{ $investment->plan?->name }} Balance
                                    </h3>
                                    <h2
                                        class="mb-2 text-3xl font-bold sm:text-4xl font-poppins text-bgray-900 dark:text-white"
                                    >
                                        ${{ number_format($investment->balance, 2) }}
                                        <span
                                        class="text-base font-medium uppercase text-bgray-500"
                                        >USDT</span
                                        >
                                    </h2>
                                    <div class="flex gap-4">
                                        <span class="text-base font-medium text-bgray-500 dark:text-darkblack-300"
                                        >{{ now()->format('d F Y') }}</span
                                        >
                                            <span class="flex">
                                            @if(auth()->user()->balance > 0)
                                            <span class="text-base font-semibold text-success-300"
                                                >Active</span
                                            >
                                            @else
                                            <span class="text-base font-semibold" style="color: #ff2424;"
                                                >In-Active</span
                                            >
                                            @endif
                                        </span>
                                    </div>
                                </div>
                            </div>


                            
                            <div id="deposit" class="relative w-full px-4 py-5 mt-6 mb-8 bg-white rounded-lg dark:bg-darkblack-600 dark:border dark:border-darkblack-400 md:px-7">
                                <div class="w-full mb-8 my-wallet">
                                    <div class="flex items-center justify-between mb-3">
                                        <h3 class="text-lg font-bold text-slate-600 dark:text-white">
                                        Withdraw funds from AI Bot balance to main wallet
                                        </h3>
                                    </div>
                                </div>
                                <div class="w-full">
                                    <h3 class="mb-4 text-lg font-light text-slate-400 dark:text-white">
                                        Enter amount to withdraw to main wallet
                                    </h3>

                                    <form class="" method="post" action="{{ route('ai-withdraw', $investment->id) }}">
                                        @csrf
                                        <div
                                        class="w-full rounded-lg border border-bgray-200 dark:border-darkblack-400 focus-within:border-success-300 p-4 h-[98px] flex flex-col justify-between"
                                        >
                                        <p class="text-sm font-medium text-bgray-600 dark:text-bgray-50">
                                            Enter amount
                                        </p>
                                        <div
                                            class="w-full h-[35px] flex justify-between items-center"
                                        >
                                            <span class="text-2xl font-bold text-bgray-900 dark:text-white">$</span>
                                            <label class="w-full">
                                            <input
                                                type="number" id="amount" name="amount" required
                                                class="w-full p-0 text-2xl font-bold border-none focus:outline-none dark:bg-darkblack-600 focus:ring-0 dark:border-darkblack-400 text-bgray-900 dark:text-white required"
                                            />
                                            </label>
                                            <div>
                                            </div>
                                        </div>
                                        </div>
                                        <button type="submit"
                                            class="w-full py-4 font-bold text-white transition-all rounded-lg modal-open hover:bg-success-400 mt-7"
                                            style="background-color: #660066;">
                                            Withdraw Amount To Wallet
                                        </button>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>

                    </div>
                </div><!--end grid-->
            </div><!--end container-->
        </section><!--end section-->
        <!-- End Hero -->

@endsection