<!Doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="msapplication-TileColor" content="#07030c">
    <meta name="theme-color" content="#07030c">
    <title> {{ $page_title }} | {{ site('name') }}</title>

    <link rel="shortcut icon" href="{{ asset('assets/images/' . site('favicon')) }}" type="image/x-icon">
    <link rel="apple-touch-icon" href="{{ asset('assets/images/' . site('favicon')) }}" type="image/x-icon">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10.16.6/dist/sweetalert2.min.css">

    <link rel="stylesheet" href="{{ asset('/assets/templates/lunex/css/output.css') }}">

    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

    <script src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js" defer></script>

    <!-- chart js  -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.1/chart.umd.js"></script>

    <!-- swiper  -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/11.0.5/swiper-bundle.min.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/11.0.5/swiper-bundle.min.css" />

    <!-- font  -->
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link
        href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
        rel="stylesheet" />

    <!-- fontawesome  -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"
        integrity="sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />

    <style>
        .button-spinner {
            border: 4px solid #000000;
            /* Light grey background */
            border-top: 4px solid #a3db2f;
            /* Blue color for the spinner */
            border-radius: 50%;
            width: 25px;
            height: 25px;
            animation: spin 1s linear infinite;
            /* Spinning animation */
            position: absolute;
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        .not-allowed-cursor {
            cursor: not-allowed;
        }

        .disabled-button {
            background-color: #1d1c1c !important;
            cursor: not-allowed !important;
            color: transparent !important;
            font-weight: bold;
            pointer-events: none !important;
            cursor: not-allowed;
            padding: 15px;
        }

        @layer base {

            input[type="number"]::-webkit-inner-spin-button,
            input[type="number"]::-webkit-outer-spin-button {
                -webkit-appearance: none;
                margin: 0;
            }
        }
    </style>

    <style>
        .backdrop-custom {
            inset: 0;
            background-color: rgba(0, 0, 0, 0.3);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            transition: backdrop-filter 0.3s ease-in-out;
        }

        /* .backdrop-custom:hover {
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
        } */
    </style>

    <style>
        /* Logout Button */
        .side-logout,
        .logoutBtn {

            background: #dc2626;
            cursor: pointer;
        }

        .side-logout:hover {
            background: darkred;
        }


        @media (max-width: 1023px) {
            #customSideDropdown {
                top: 5rem;
            }
        }

        @media (min-width: 1024px) {
            #customSideDropdown {
                top: 0px;
            }
        }
    </style>


    @yield('css')

</head>


<body class="bg-black text-gray-300">

    {{-- preloader --}}
    @if (site('preloader') == 1)
        @include('templates.' . site('template') . '.loaders.preloader')
    @endif



    <div x-data="{ isSidebarOpen: false }">
        <!-- Mobile Nav Bar -->
        <div class="lg:hidden flex items-center justify-between p-2 bg-black border-b border-b-gray-800">
            <div class="flex items-center">
                <img src="{{ asset('assets/images/' . site('logo_square')) }}" alt="Logo" class="w-10" />
            </div>

            <div class="flex">
                <div class="relative">
                    <!-- Profile Button mobile and tablet with dropdown -->
                    <div x-data="{ open: false }" class="relative">
                        <button @click="open = !open"
                            class="rounded-full bg-gray-800 p-1 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 mr-1">
                            <img src="{{ asset('storage/profile/' . user()->photo) }}" alt="Profile Icon"
                                class="h-8 w-8 rounded-full" />
                        </button>
                        <!-- Dropdown menu -->
                        <div x-show="open" @click.away="open = false"
                            class="absolute right-0 mt-2 w-48 rounded-md shadow-lg bg-black border border-gray-800 z-20">
                            <div class="py-1">
                                <a href="{{ route('user.profile.index') }}"
                                    class="flex items-center px-4 py-2 text-sm text-white hover:bg-gray-800">
                                    <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none"
                                        viewBox="0 0 24 24" stroke="currentColor">
                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                            d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
                                    </svg>
                                    My Profile
                                </a>
                                <a href="{{ route('user.profile.edit') }}"
                                    class="flex items-center px-4 py-2 text-sm text-white hover:bg-gray-800">
                                    <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none"
                                        viewBox="0 0 24 24" stroke="currentColor">
                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                            d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
                                    </svg>
                                    Edit Profile
                                </a>
                                <a href="{{ route('user.kyc.index') }}"
                                    class="flex items-center px-4 py-2 text-sm text-white hover:bg-gray-800">
                                    <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none"
                                        viewBox="0 0 24 24" stroke="currentColor">
                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                            d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
                                    </svg>
                                    KYC
                                </a>
                                <a role="button"
                                    class="side-logout logout flex items-center px-4 py-2 text-sm text-white">
                                    <div class="flex items-center gap-3">
                                        <div
                                            class="w-8 h-8 flex items-center justify-center rounded-lg shadow-[0px_10px_20px_0px_rgba(0,_0,_0,_0.15)]">
                                            <img src="{{ asset('/assets/templates/lunex/images/logout-icon.svg') }}"
                                                alt="" class="w-5 h-5 invert" />
                                        </div>
                                        <span>Logout</span>
                                    </div>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>

                <button @click="isSidebarOpen = !isSidebarOpen" class="text-gray-300">
                    <!-- Hamburger to X Transition -->
                    <svg x-show="!isSidebarOpen" xmlns="http://www.w3.org/2000/svg"
                        class="h-6 w-6 transition-transform duration-300" fill="none" viewBox="0 0 24 24"
                        stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                            d="M4 6h16M4 12h16M4 18h16" />
                    </svg>
                    <svg x-show="isSidebarOpen" xmlns="http://www.w3.org/2000/svg"
                        class="h-6 w-6 transition-transform duration-300" fill="none" viewBox="0 0 24 24"
                        stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                            d="M6 18L18 6M6 6l12 12" />
                    </svg>
                </button>
            </div>
        </div>

        <!-- Desktop Top Navigation -->
        <div class="hidden lg:block fixed top-0 right-0 left-0 bg-black z-10 border-b border-b-gray-800 py-1">
            <div class="flex items-center justify-end h-16 px-6 relative">
                <!-- Profile Icon with Dropdown -->
                <div class="flex items-center">
                    <div x-data="{ open: false }" class="relative">
                        <!-- Profile Button Desktop -->
                        <button @click="open = !open"
                            class="rounded-full gap-2 p-1 focus:outline-none flex justify-center items-center">
                            <img src="{{ asset('storage/profile/' . user()->photo) }}" alt="Profile Icon"
                                class="h-8 w-8 rounded-full" />
                            <span class="text-white hidden md:flex">{{ user()->username }}</span>
                            <img src="{{ asset('/assets/templates/lunex/images/caret-down.svg') }}" alt="" />
                        </button>

                        <!-- Dropdown menu -->
                        <div x-show="open" @click.away="open = false"
                            class="absolute right-0 mt-2 w-48 rounded-md shadow-lg bg-black border border-gray-800 z-20">
                            <div class="py-1">
                                <a href="{{ route('user.profile.index') }}"
                                    class="flex items-center px-4 py-2 text-sm text-white hover:bg-gray-800">
                                    <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none"
                                        viewBox="0 0 24 24" stroke="currentColor">
                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                            d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
                                    </svg>
                                    My Profile
                                </a>
                                <a href="{{ route('user.profile.edit') }}"
                                    class="flex items-center px-4 py-2 text-sm text-white hover:bg-gray-800">
                                    <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none"
                                        viewBox="0 0 24 24" stroke="currentColor">
                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                            d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
                                    </svg>
                                    Edit Profile
                                </a>
                                <a href="{{ route('user.kyc.index') }}"
                                    class="flex items-center px-4 py-2 text-sm text-white hover:bg-gray-800">
                                    <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none"
                                        viewBox="0 0 24 24" stroke="currentColor">
                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                            d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
                                    </svg>
                                    KYC
                                </a>
                                <a role="button"
                                    class="side-logout logout flex items-center px-4 py-2 text-sm text-white">
                                    <div class="flex items-center gap-3">
                                        <div
                                            class="w-8 h-8 flex items-center justify-center rounded-lg shadow-[0px_10px_20px_0px_rgba(0,_0,_0,_0.15)]">
                                            <img src="{{ asset('/assets/templates/lunex/images/logout-icon.svg') }}"
                                                alt="" class="w-5 h-5 invert" />
                                        </div>
                                        <span>Logout</span>
                                    </div>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Sidebar -->
        <div class="fixed top-0 left-0 h-full bg-black transform transition-all duration-300 ease-in-out z-20 border-r border-r-gray-800 overflow-y-auto w-20"
            :class="{
                'translate-x-0 lg:translate-x-0': isSidebarOpen,
                '-translate-x-full lg:translate-x-0': !isSidebarOpen
            }">
            <!-- Logo Section -->
            <div class="flex items-center p-4 justify-center">
                <img src="{{ asset('assets/images/' . site('logo_square')) }}" alt="Logo" class="w-12" />
            </div>

            <!-- Navigation Links (Icons Only) -->
            <nav class="mt-8">
                <div class="space-y-2" x-data="{
                    items: [{
                            name: 'Dashboard',
                            icon: '{{ asset('/assets/templates/lunex/images/dashboard-icon.svg') }}',
                            link: '{{ route('user.dashboard') }}',
                            @if (request()->routeIs('user.dashboard')) active: true, @endif
                        },
                        { name: 'Deposit', icon: '{{ asset('/assets/templates/lunex/images/deposit-icon.svg') }}', link: '{{ route('user.deposits.index') }}', @if (request()->routeIs('user.deposits.index')) active: true, @endif },
                        { name: 'AI Bots', icon: '{{ asset('/assets/templates/lunex/images/ai-bot-icon.svg') }}', link: '{{ route('user.bots.index') }}', @if (request()->routeIs('user.bots.index')) active: true, @endif },
                        { name: 'Withdraw', icon: '{{ asset('/assets/templates/lunex/images/withdrawal-icon.svg') }}', link: '{{ route('user.withdrawals.index') }}', @if (request()->routeIs('user.withdrawals.index')) active: true, @endif },
                        { name: 'P2P', icon: '{{ asset('/assets/templates/lunex/images/p2p-icon.svg') }}', link: '{{ route('user.transfers.index') }}', @if (request()->routeIs('user.transfers.index')) active: true, @endif },
                        { name: 'My Referrals', icon: '{{ asset('/assets/templates/lunex/images/referrals-icon.svg') }}', link: '{{ route('user.referrals') }}', @if (request()->routeIs('user.referrals')) active: true, @endif },
                        { name: 'My Transactions', icon: '{{ asset('/assets/templates/lunex/images/transactions-icon.svg') }}', link: '{{ route('user.transactions.index') }}', @if (request()->routeIs('user.transactions.index')) active: true, @endif }
                    ]
                }">
                    <template x-for="(item, index) in items" :key="index">
                        <a :href="item.link"
                            class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-800 relative"
                            :class="{ 'border-l-4 border-l-white': item.active }" :title="item.name">
                            <img :src="item.icon" class="h-6 w-6 mx-auto transition-all duration-200"
                                :class="{ 'filter brightness-200': item.active }" :alt="item.name" />
                        </a>
                    </template>
                </div>
            </nav>
        </div>

        <!-- Main Content Area -->
        <div class="transition-all duration-300 ease-in-out lg:ml-20 bg-white">


            <main id="main">


                @yield('contents')


                {{-- modal for logout --}}
                <div id="logOutModal"
                    class="fixed inset-0 bg-[#f3f3f3] backdrop-custom z-50 flex items-center justify-center hidden">
                    <div class="bg-white p-6 rounded-3xl w-[90%] max-w-md">
                        <div class="flex justify-between items-center mb-6">
                            <h3 class="text-xl font-semibold text-red-500">Logout</h3>

                            <button id="closeLogOutModal" class="text-black hover:text-red-500">
                                <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20"
                                    fill="currentColor">
                                    <path fill-rule="evenodd"
                                        d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
                                        clip-rule="evenodd" />
                                </svg>
                            </button>

                        </div>

                        <!-- logout -->
                        <div class="text-center mb-4 -800 pb-2">
                            <span class="text-lg text-black">Do you really want to Logout?</span>

                            <form action="{{ route('user.logout') }}" method="post" class="mt-5 gen-form"
                                data-action="redirect" data-url="{{ url('/') }}">
                                @csrf

                                <div class="w-full py-12">
                                    <div class="flex justify-center text-center">
                                        <button type="submit"
                                            class="logoutBtn rounded-full px-10 py-2 lg:w-52 w-full transition delay-100 duration-200 ease-in-out ">
                                            <span class="px-2">Log Out</span>
                                        </button>
                                    </div>
                                </div>

                            </form>

                        </div>

                    </div>
                </div>
            </main>



            <footer>
                <div class="mt-8 text-center text-sm text-gray-400 mb-4">
                    All Rights Operational
                </div>
            </footer>
        </div>
    </div>


    {{-- qrcode --}}
    <script src="https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js"></script>

    {{-- Include SweetAlert2 JavaScript file --}}
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@10.16.6/dist/sweetalert2.all.min.js"></script>

    <script src="{{ asset('/assets/templates/cavit/scripts/dash.js') }}"></script>

    @yield('scripts')
    @stack('scripts')

    {{-- toggle for sideDropdownBtn --}}
    <script>
        $(document).ready(function() {
            // Dropdown Toggle
            $(".sideDropdownBtn").click(function(event) {


                event.stopPropagation(); // Prevent click event from bubbling up
                $("#customSideDropdown").toggleClass("hidden custom-sidebar");
            });

            // Close dropdown on click outside
            $(document).click(function(event) {
                if (!$(event.target).closest("#customSideDropdown, .sideDropdownBtn").length) {
                    $("#customSideDropdown").addClass("hidden").removeClass("custom-sidebar");
                }
            });
        });

        // log out
        $(document).on("click", ".logout", function() {
            $("#logOutModal").removeClass("hidden");
        });

        // Close Logout Modal  
        $(document).on("click", "#closeLogOutModal", function() {
            $("#logOutModal").addClass("hidden");
        });
    </script>




    {{-- livechat --}}
    {!! json_decode(site('livechat')) !!}



</body>

</html>
