@php
    use App\Models\DepositCoin;
    use App\Models\Bot;
    use Faker\Factory as Faker;

    $page_title = 'Home';
    $faker = Faker::create();
    //    $logos = DepositCoin::inRandomOrder()->take(20)->get('logo_url');

    $bots = Bot::get();

    $actions = [
        'deposited',
        'withdrew',
        'withdrew',
        'deposited',
        'withdrew',
        'deposited',
        'withdrew',
        'withdrew',
        'withdrew',
        'withdrew',
        'withdrew',
        'withdrew',
    ];

    $whys = [
        'Cutting-Edge Precision',
        'Trendsetter Advantage',
        'Adaptive Excellence',
        'Seamless Profits',
        'Data-Driven Triumph',
        'Strategic Partner',
        'Constant Success',
        'Market Pioneer',
        'Automated Mastery',
    ];
    $reviews = [
        [
            'image' => 'review-image-1.jpg',
            'name' => 'Adrian',
            'country' => 'UK',
            'testimony' =>
                site('name') .
                "'s precision trading is a game-changer, consistently delivering impressive profits. I trust it for my financial success.",
            'date' => '5/03/2023',
        ],
        [
            'image' => 'review-image-2.jpg',
            'name' => 'Madison',
            'country' => 'USA',
            'testimony' =>
                'Effortless trading with ' .
                site('name') .
                '. Its adaptability and data-driven approach make it a standout choice. Highly recommended!',
            'date' => '7/02/2024',
        ],
        [
            'image' => 'review-image-3.jpg',
            'name' => 'Schneider',
            'country' => 'Germany',
            'testimony' =>
                'Seamless trades, constant profits - ' .
                site('name') .
                " simplifies trading. It's a must-have for anyone in the market.",
            'date' => '5/04/2024',
        ],
        [
            'image' => 'review-image-4.jpg',
            'name' => 'Tommy',
            'country' => 'South Africa',
            'testimony' =>
                site('name') .
                "'s innovative strategies and consistent returns have transformed my trading experience. It's a valuable asset to any trader.",
            'date' => '2/05/2024',
        ],
        [
            'image' => 'review-image-5.jpg',
            'name' => 'Jannet',
            'country' => 'USA',
            'testimony' =>
                'I rely on ' .
                site('name') .
                " for its adaptability in fluctuating markets. It's a proven partner in achieving financial goals.",
            'date' => '13/06/2024',
        ],
        [
            'image' => 'review-image-6.jpg',
            'name' => 'Thomas',
            'country' => 'England',
            'testimony' =>
                site('name') .
                "'s automated precision is remarkable. It's a powerful tool for navigating today's complex trading landscape.",
            'date' => '27/08/2024',
        ],
        [
            'image' => 'review-image-7.jpg',
            'name' => 'Atlan',
            'country' => 'Germany',
            'testimony' =>
                'Maximized profits with ' .
                site('name') .
                '. Its results speak volumes. A reliable and intelligent trading companion.',
            'date' => '1/10/2024',
        ],
        [
            'image' => 'review-image-8.jpg',
            'name' => 'Kelvin',
            'country' => 'UK',
            'testimony' =>
                'Trading with ' .
                site('name') .
                ' is effortless and rewarding. It adapts to market changes seamlessly. Truly impressive!',
            'date' => '15/10/2024',
        ],
        [
            'image' => 'review-image-9.jpg',
            'name' => 'Jude',
            'country' => 'Canada',
            'testimony' =>
                site('name') .
                ' has changed my trading game. Its data-driven approach delivers consistent gains. An invaluable tool for success.',
            'date' => '7/11/2024',
        ],
        [
            'image' => 'review-image-10.jpg',
            'name' => 'Jude',
            'country' => 'Australia',
            'testimony' =>
                'Effortless trading made possible by ' .
                site('name') .
                ' .  Its strategic prowess sets it apart. A game-changer for traders.',
            'date' => '23/1/2025',
        ],
    ];

    $short_description = site('seo_description');
    $counter = 0;

@endphp

@extends('templates.' . site('template') . '.layouts.front')

@section('css')
@endsection



@section('contents')
    <section class="pt-16 lg:pt-40 px-6">
        <div class="max-w-4xl mx-auto text-center text-white">
            <p class="text-white text-sm mb-4 md:mb-8 mt-6 md:mt-12 font-semibold" data-aos="fade-up" data-aos-duration="1500">
                Data Driven Gains
            </p>
            <h1 class="text-4xl md:text-5xl font-bold mb-4 text-transparent bg-clip-text bg-gradient-to-r from-[#FF3BFF] via-[#ECBFBF] to-[#5C24FF] lg:to-[#D94FD5] p-1 md:p-4"
                data-aos="fade-up" data-aos-duration="1500">
                Simplified Trading, Steady Profits
            </h1>

            <span class="block text-lg md:text-5xl text-gray-300 mt-2 font-bold mb-4 md:mb-8" data-aos="fade-up"
                data-aos-duration="1500">
                - Powered by AI Excellence
            </span>

            <p class="text-base mb-12 text-gray-200" data-aos="fade-up" data-aos-duration="1500">
                {{ site('name') }} employs advanced AI robots, designed with extensive trading
                data and advanced algorithms, to accurately analyze market trends and
                deliver profitable trading decisions, ensuring a seamless and
                efficient trading experience.
            </p>
            <div class="flex justify-center space-x-4 md:gap-16">
                <a href="{{ route('user.login') }}"
                    class="bg-sky-800 text-white font-medium px-12 py-3 rounded-lg text-sm md:text-xl hover:bg-transparent hover:border hover:border-sky-800"
                    data-aos="fade-right" data-aos-duration="1500">
                    Sign in
                </a>
                <a href="{{ route('user.register') }}"
                    class="border border-sky-800 text-white font-medium px-12 py-3 rounded-lg text-sm md:text-xl hover:border-none hover:bg-sky-800 hover:transition-colors hover:duration-700 hover:ease-in-out"
                    data-aos="fade-left" data-aos-duration="1500">
                    Sign up
                </a>
            </div>
        </div>
    </section>

    <img src="{{ asset('/assets/templates/pandel/images/ai-fancy-hero.svg') }}" alt=""
        class="w-full mt-2 animate-pulse" data-aos="fade-up" data-aos-duration="1500" />

    <!-- livecoin widget  -->
    <div class="bg-white mb-12 pt-3" data-aos="fade-up" data-aos-duration="1500">
        <div class="livecoinwatch-widget-5 mx-auto text-center" lcw-base="USD" lcw-color-tx="#999999" lcw-marquee-1="coins"
            lcw-marquee-items="6"></div>
    </div>

    <!-- features section  -->
    <section
        class="relative flex flex-col-reverse lg:flex-row items-center lg:items-start space-y-4 lg:space-y-0  mb-4 lg:mb-40 mt-20">
        <!-- Image Column -->
        <div class="lg:w-1/2 mx-auto my-auto px-6 lg:px-40">
            <img src="{{ asset('/assets/templates/pandel/images/features-image.svg') }}" alt=""
                class="w-3/4 md:min-w-full h-auto rounded-lg shadow-md mx-auto animate-pulse" />
        </div>

        <!-- Text Content Column -->
        <div class="w-full lg:w-1/2 px-6 lg:px-40">
            <h2 class="text-3xl font-bold mb-4 text-white" data-aos="fade-up" data-aos-duration="1500">
                <span
                    class="text-transparent bg-clip-text bg-gradient-to-r from-[#FF3BFF] via-[#ECBFBF] to-[#5C24FF] lg:to-[#D94FD5]">Unlocking
                    Markets,</span>
                <span class="block">Amplifying Returns</span>
            </h2>

            <p class="text-gray-400 mb-4 text-lg" data-aos="fade-up" data-aos-duration="1500">
                Your ultimate trading companion, utilizing cutting-edge technology to
                unlock new market potentials and amplify your investment returns like
                never before.
            </p>
            <img src="{{ asset('/assets/templates/pandel/images/automated-process.png') }}" alt=""
                data-aos="fade-down" data-aos-duration="1500" />

            <h2 class="text-2xl font-bold mb-4 text-white" data-aos="fade-up" data-aos-duration="1500">
                Automated Process
            </h2>
            <p class="text-gray-400 mb-4 text-lg" data-aos="fade-up" data-aos-duration="1500">
                Our advanced technology streamlines processes, allowing you to
                navigate markets seamlessly and achieve maximum success. Navigate
                uncertainty with {{ site('name') }}.
            </p>
            <img src="{{ asset('/assets/templates/pandel/images/guaranteed-profits.png') }}" alt=""
                data-aos="fade-down" data-aos-duration="1500" />
            <img src="{{ asset('/assets/templates/pandel/images/abstract-bg.svg') }}" alt=""
                class="absolute w-screen md:hidden" />
            <h2 class="text-2xl font-bold mb-4 text-white" data-aos="fade-up" data-aos-duration="1500">
                Guaranteed Profit
            </h2>
            <p class="text-gray-400 mb-4 text-lg" data-aos="fade-up" data-aos-duration="1500">
                Harness the power of our Guaranteed Proft approach and let AI elevate
                your trading endeavors, ensuring consistent gains.
            </p>
            <img src="{{ asset('/assets/templates/pandel/images/bullish-bearish.png') }}" alt=""
                data-aos="fade-down" data-aos-duration="1500" />

            <h2 class="text-2xl font-bold mb-4 text-white" data-aos="fade-up" data-aos-duration="1500">
                Bullish or Bearish
            </h2>
            <p class="text-gray-400 mb-4 text-lg" data-aos="fade-up" data-aos-duration="1500">
                Leveraging advanced technology to navigate challenging market
                conditions, ensuring your financial goals remain achievable even in
                bearish market scenarios.
            </p>
        </div>
        <img src="{{ asset('/assets/templates/pandel/images/abstract-bg.svg') }}" alt=""
            class="absolute w-full hidden md:flex" />
    </section>

    <!-- Pricing section  -->
    <section class="text-white py-12 px-6 lg:px-64">
        <div class="text-center mb-8 relative">
            <h2 class="text-white uppercase text-sm font-semibold mb-8" data-aos="fade-up" data-aos-duration="1500">
                Pricing
            </h2>
            <!-- Floating Image -->
            <img src="{{ asset('/assets/templates/pandel/images/grouped-crypto.png') }}" alt=""
                class="absolute bottom-24 right-40 transform translate-x-1/4 translate-y-1/2 hidden lg:block w-80" />
            <h1 class="text-4xl font-bold" data-aos="fade-up" data-aos-duration="1500">
                <span
                    class="text-transparent bg-clip-text bg-gradient-to-r from-[#FF3BFF] via-[#ECBFBF] to-[#5C24FF] lg:to-[#D94FD5]">AI
                    Trading</span>
                Portfolios
            </h1>
        </div>

        <!-- Cards Section -->
        <div class="grid grid-cols-1 md:grid-cols-3 lg:grid-cols-3 gap-6">
            @foreach ($bots as $bot)
                <!-- Card 1 -->
                <div class="relative bg-gray-900 rounded-2xl shadow-lg p-6 overflow-hidden border border-transparent bg-clip-border"
                    style="
                  background-image: linear-gradient(#000, #000),
                    radial-gradient(
                      circle at top left,
                      #ff3bff,
                      #ecbfbf,
                      #5c24ff,
                      #d94fd5
                    );
                  background-origin: border-box;
                  background-clip: padding-box, border-box;
                "
                    data-aos="flip-left" data-aos-duration="1500">
                    <!-- Icon and Title -->
                    <div class="mb-6 flex items-center space-x-3">
                        <img src="{{ asset('storage/bots/' . $bot->logo) }}" alt="Icon" class="w-8 h-8" />
                        <h3 class="text-lg font-semibold text-white">{{ $bot->name }}</h3>
                    </div>

                    <!-- Daily Profit -->
                    <p class="text-4xl font-bold text-white mb-6">
                        {{ $bot->daily_min }}% - {{ $bot->daily_max }}%<span class="text-sm">/day</span>
                    </p>

                    <!-- Features List -->
                    <ul class="text-sm text-gray-400 space-y-2 mb-6">
                        <li class="flex items-center">
                            <img src="{{ asset('/assets/templates/pandel/images/tick-ash.svg') }}" alt=""
                                class="mr-1" />
                            Portfolio Range: >{{ site('currency_symbol') . $bot->min }} -
                            {{ site('currency_symbol') . $bot->max }}
                        </li>
                        <li class="flex items-center">
                            <img src="{{ asset('/assets/templates/pandel/images/tick-ash.svg') }}" alt=""
                                class="mr-1" />
                            Daily PNL: {{ $bot->daily_min }}% - {{ $bot->daily_max }}%
                        </li>
                        <li class="flex items-center">
                            <img src="{{ asset('/assets/templates/pandel/images/tick-ash.svg') }}" alt=""
                                class="mr-1" />
                            Trading Duration: {{ $bot->duration }}
                            {{ $bot->duration_type }}
                        </li>
                        <li class="flex items-center">
                            <img src="{{ asset('/assets/templates/pandel/images/tick-ash.svg') }}" alt=""
                                class="mr-1" />
                            Capital Returned: Yes
                        </li>
                    </ul>

                    <!-- Activate Button -->
                    <a href="{{ route('user.bots.index') }}"
                        class="w-full block text-center bg-gradient-to-r from-blue-500 to-indigo-600 hover:from-blue-600 hover:to-indigo-700 text-white font-bold py-3 rounded-full transition-colors">
                        Activate →
                    </a>

                    <!-- Trading Days -->
                    <div class="mt-6 text-sm">
                        <h4 class="text-gray-400 font-semibold mb-2">Trading Days</h4>
                        <ul class="space-y-1 text-gray-400">
                            @php
                                $trading_days_display = [
                                    'monday' => in_array('monday', json_decode(site('trading_days'))),
                                    'tuesday' => in_array('tuesday', json_decode(site('trading_days'))),
                                    'wednesday' => in_array('wednesday', json_decode(site('trading_days'))),
                                    'thursday' => in_array('thursday', json_decode(site('trading_days'))),
                                    'friday' => in_array('friday', json_decode(site('trading_days'))),
                                    'saturday' => in_array('saturday', json_decode(site('trading_days'))),
                                    'sunday' => in_array('sunday', json_decode(site('trading_days'))),
                                ];
                            @endphp
                            @foreach ($trading_days_display as $day => $day_display)
                                <li class="flex items-center justify-between">
                                    {{ ucfirst($day) }}
                                    @if (in_array($day, json_decode(site('trading_days'))))
                                        <svg width="21" height="13" viewBox="0 0 21 13" fill="none"
                                            xmlns="http://www.w3.org/2000/svg">
                                            <path
                                                d="M1 8.333C1 8.333 2.5 9 4.5 12C4.5 12 4.785 11.52 5.321 10.753M15 1C12.709 2.146 10.312 4.552 8.388 6.822M6 8.333C6 8.333 7.5 9 9.5 12C9.5 12 15 3.5 20 1"
                                                stroke="url(#paint0_linear_396_6542)" stroke-width="1.5"
                                                stroke-linecap="round" stroke-linejoin="round" />
                                            <defs>
                                                <linearGradient id="paint0_linear_396_6542" x1="1" y1="6.5"
                                                    x2="20" y2="6.5" gradientUnits="userSpaceOnUse">
                                                    <stop stop-color="#004385" stop-opacity="0.4" />
                                                    <stop offset="1" stop-color="#004385" />
                                                </linearGradient>
                                            </defs>
                                        </svg>
                                    @else
                                        <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor"
                                            class="w-4 h-4 text-red-500" viewBox="0 0 16 16">
                                            <path
                                                d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z" />
                                        </svg>
                                    @endif
                                </li>
                            @endforeach
                        </ul>
                    </div>
                </div>
            @endforeach
        </div>
    </section>

    <!-- Why choose section  -->
    <section
        class="flex flex-col md:flex-row md:items-start space-y-4 lg:space-y-0 px-6 lg:px-64 gap-10 mb-12 lg:mb-20 text-white mt-8">
        <div class="md:w-1/2 mb-8 md:mb-0" data-aos="fade-up" data-aos-duration="1500">
            <div class="flex items-center font-semibold">
                <img src="{{ asset('/assets/templates/pandel/images/cutting-edge.png') }}" alt=""
                    class="mr-2" />
                Cutting-Edge Precision
            </div>
            <div class="border-b-2 border-gray-200 mt-4 mb-4"></div>
            <div class="flex items-center font-semibold">
                <img src="{{ asset('/assets/templates/pandel/images/trendsetter.png') }}" alt=""
                    class="mr-2" />
                Trendsetter Advantage
            </div>
            <div class="border-b-2 border-gray-200 mt-4 mb-4"></div>
            <div class="flex items-center font-semibold">
                <img src="{{ asset('/assets/templates/pandel/images/adaptive-excellence.png') }}" alt=""
                    class="mr-2" />
                Adaptive Excellence
            </div>
            <div class="border-b-2 border-gray-200 mt-4 mb-4"></div>
            <div class="flex items-center font-semibold">
                <img src="{{ asset('/assets/templates/pandel/images/seamless-profits.png') }}" alt=""
                    class="mr-2" />
                Seamless Profits
            </div>
            <div class="border-b-2 border-gray-200 mt-4 mb-4"></div>
            <div class="flex items-center font-semibold">
                <img src="{{ asset('/assets/templates/pandel/images/data-driven.png') }}" alt=""
                    class="mr-2" />
                Data-Driven Triumph
            </div>
            <div class="border-b-2 border-gray-200 mt-4 mb-4"></div>
        </div>
        <div class="md:w-1/2 mt-16" data-aos="fade-down" data-aos-duration="1500">
            <h2 class="text-white font-semibold mb-6 md:mt-16">Supercharged Ai</h2>
            <h2 class="text-white font-semibold text-4xl mb-6">
                <span
                    class="text-transparent bg-clip-text bg-gradient-to-r from-[#FF3BFF] via-[#ECBFBF] to-[#5C24FF] lg:to-[#D94FD5]">Why
                    Choose</span>
                {{ site('name') }} ?
            </h2>
            <p class="text-sky-400">
                {{ site('name') }} doesn't just follow trends - it pioneers them. It empowers
                traders to navigate both bullish and bearish market conditions with
                unwavering confidence. By leveraging sophisticated algorithms and
                real-time data streams, {{ site('name') }} adapts to ever-changing market
                dynamics, seizing opportunities while minimizing risks.
            </p>

            <div class="flex space-x-4 md:gap-8 mt-16">
                <a href="{{ route('user.login') }}"
                    class="bg-sky-800 text-white font-medium px-12 py-3 rounded-lg text-xl hover:bg-transparent hover:border hover:border-sky-800 mr-auto">
                    Sign in
                </a>
                <a href="{{ route('user.register') }}"
                    class="border border-sky-800 text-white font-medium px-12 md:px-8 lg:px-12 py-3 rounded-lg text-xl hover:border-none hover:bg-sky-800 hover:transition-colors hover:duration-700 hover:ease-in-out">
                    Sign up
                </a>
            </div>
        </div>
    </section>

    <img src="{{ asset('/assets/templates/pandel/images/abstract-bg.svg') }}" alt=""
        class="absolute w-full hidden md:flex right-0 left-auto" />

    <div class="text-white grid grid-cols-2 lg:grid-cols-4 gap-4 px-6 mb-12 lg:mb-20" data-aos="fade-up"
        data-aos-duration="1500">
        <div class="mb-6 lg:mb-0 text-center">
            <img src="{{ asset('/assets/templates/pandel/images/strategic-partner.png') }}" alt=""
                class="mx-auto" />
            Strategic Partner
        </div>
        <div class="mb-6 lg:mb-0 text-center">
            <img src="{{ asset('/assets/templates/pandel/images/automated-mastery.png') }}" alt=""
                class="mx-auto" />
            Automated Mastery
        </div>
        <div class="mb-6 lg:mb-0 text-center">
            <img src="{{ asset('/assets/templates/pandel/images/constant-success.png') }}" alt=""
                class="mx-auto" />
            Constant Success
        </div>
        <div class="mb-6 lg:mb-0 text-center">
            <img src="{{ asset('/assets/templates/pandel/images/market-pioneer.png') }}" alt=""
                class="mx-auto" />
            Market Pioneer
        </div>
    </div>

    <!-- Trade from anywhere section  -->
    <section class="px-6 lg:px-40 ">
        <h2 class="text-white font-semibold text-4xl text-center mb-6" data-aos="fade-up" data-aos-duration="1500">
            <span
                class="text-transparent bg-clip-text bg-gradient-to-r from-[#FF3BFF] via-[#ECBFBF] to-[#5C24FF] lg:to-[#D94FD5]">Trade
                From</span>
            Anywhere
        </h2>
        <h3 class="text-sky-400 text-base text-center lg:px-64 mb-6" data-aos="fade-up" data-aos-duration="1500">
            Whether you're at home or on the go, seize market opportunities anytime,
            anywhere, and secure your financial future effortlessly.
            <span class="md:block">Trade from any and every city</span>
        </h3>

        <div class="flex flex-col lg:flex-row items-start lg:items-center justify-between gap-6 p-8 lg:pl-6 text-white"
            data-aos="zoom-in" data-aos-duration="1500">
            <div class="w-full lg:w-1/2">
                <h2 class="text-lg font-semibold mb-4 text-white">
                    Recent Trades by {{ site('name') }}
                </h2>
                <div class="w-full px-2 md:px-10 mt-10 text-white">
                    <div class="w-full">
                        <div class="w-full p-3">
                            <div class="w-full overflow-x-auto" id="recentTradesContainer">
                                <div class="w-full grid grid-cols-1 gap-4 mt-2 text-xs" id="recentTrades">
                                    <!-- Initial trades will be populated here -->
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="lg:w-1/2 lg:flex md:items-center md:justify-center">
                <img src="{{ asset('/assets/templates/pandel/images/globe1.png') }}" alt="Globe"
                    class="object-contain md:object-cover w-2/3 md:hidden lg:flex mx-auto animate-spin-slow" />
            </div>
        </div>
    </section>

    <!-- Market data section  -->
    <section class="text-white py-12 px-6 lg:px-64 mb-4">
        <h2 class="text-white mb-6 font-semibold text-base" data-aos="fade-up" data-aos-duration="1500">
            MARKET DATA
        </h2>
        <h3 class="mb-6 text-4xl font-semibold text-transparent bg-clip-text bg-gradient-to-r from-[#FF3BFF] via-[#ECBFBF] to-[#5C24FF] lg:to-[#D94FD5]"
            data-aos="fade-down" data-aos-duration="1500">
            Market Insights
        </h3>

        <div x-data="cryptoApp()" x-init="fetchData()" class="p-4">
            <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-6" data-aos="zoom-in"
                data-aos-duration="1500">
                <template x-for="coin in coins" :key="coin.id">
                    <div class="bg-gray-800 text-white p-4 rounded-lg shadow-md border-t-2 border-l-2 border-sky-400">
                        <div class="flex items-center mb-4">
                            <img :src="coin.logo" alt="coin.name" class="w-8 h-8 mr-2" />
                            <div>
                                <h3 class="font-bold" x-text="coin.name"></h3>
                                <p class="text-sm text-gray-400" x-text="coin.symbol"></p>
                            </div>
                        </div>
                        <p class="text-lg font-bold" x-text="`$${coin.price}`"></p>
                        <p :class="coin.change > 0 ? 'text-green-500' : 'text-red-500'" class="text-sm mt-2"
                            x-text="`${coin.change > 0 ? '+' : ''}${coin.change.toFixed(2)}%`"></p>
                    </div>
                </template>
            </div>
        </div>
    </section>

    {{-- testimonial --}}
    <section class="mb-6 ">
        <h2 class="text-white text-4xl font-semibold text-center mb-6" data-aos="fade-up" data-aos-duration="1500">
            What our users are saying
        </h2>
        <div class="max-w-7xl mx-auto px-6 lg:px-0" data-aos="fade-down" data-aos-duration="1500">
            <div class="swiper testimonial-slider">
                <div class="swiper-wrapper">
                    @foreach ($reviews as $review)
                        <div class="swiper-slide swiper-slide-active" style="width: 364px; margin-right: 30px;"
                            role="group" aria-label="NaN / 7">
                            <div class="bg-gray-900 rounded-lg p-6 border border-gray-800">
                                <div class="flex items-center gap-4 mb-4">
                                    <img class="w-12 h-12 rounded-full object-cover"
                                        src="{{ asset('/assets/templates/pandel/images/review/' . $review['image']) }}"
                                        alt="">
                                    <div>
                                        <h3 class="text-white font-semibold">{{ $review['name'] }}</h3>
                                        <p class="text-gray-400 text-sm">{{ $review['country'] }}</p>
                                    </div>
                                </div>
                                <p class="text-gray-300 mb-6">"{{ $review['testimony'] }}"</p>
                                <div class="flex items-center">
                                    <p class="text-sm text-sky-400">{{ $review['date'] }}</p>
                                </div>
                            </div>
                        </div>
                    @endforeach
                </div>

                <!-- Navigation buttons -->
                <div class="swiper-button-prev after:text-sky-400" style="font-size: 4rem;">
                    <i class="fa-light fa-angle-left"></i>
                </div>
                <div class="swiper-button-next after:text-sky-400" style="font-size: 4rem;">
                    <i class="fa-light fa-angle-right"></i>
                </div>
            </div>
        </div>
    </section>

    <img src="{{ asset('/assets/templates/pandel/images/abstract-bg.svg') }}" alt=""
        class="absolute w-full hidden md:flex -z-10" />

    <!-- how it works  -->
    <section class="px-6 lg:px-64 ">
        <h2 class="text-white font-semibold text-lg text-center mt-10 md:mt-20" data-aos="fade-up"
            data-aos-duration="1500">
            GETTING STARTED
        </h2>
        <h3 class="text-4xl font-semibold text-center mt-4 text-transparent bg-clip-text bg-gradient-to-r from-[#FF3BFF] via-[#ECBFBF] to-[#5C24FF] lg:to-[#D94FD5]"
            data-aos="fade-up" data-aos-duration="1500">
            How It Works
        </h3>
        <p class="text-center text-gray-400 mt-4 text-xl" data-aos="fade-up" data-aos-duration="1500">
            Our user-friendly interface and intuitive features ensure that even
            newcomers can quickly grasp the essentials and embark on a seamless
            journey into the world of efficient and profitable trading.
        </p>

        <div class="p-4 md:p-8 mt-12 mb-8">
            <div class="max-w-4xl mx-auto">
                <div class="relative">
                    <!-- Timeline line -->
                    <div
                        class="absolute left-4 md:left-1/2 transform md:-translate-x-1/2 h-full w-0.5 border-dashed border-l-2 border-blue-400">
                    </div>

                    <!-- Timeline items -->
                    <div class="space-y-20">
                        <!-- Sign Up -->
                        <div class="relative flex flex-col md:flex-row items-center md:justify-center gap-8 md:gap-96"
                            data-aos="fade-up" data-aos-duration="1500">
                            <div class="flex items-center gap-4 md:w-1/3 md:justify-end order-2 md:order-1">
                                <img src="{{ asset('/assets/templates/pandel/images/sign.png') }}" alt="Sign up icon"
                                    class="w-24 h-24 object-contain" />
                            </div>
                            <div
                                class="absolute left-0 md:left-1/2 transform md:-translate-x-1/2 w-8 h-8 bg-blue-400 text-white rounded-full flex items-center justify-center order-1 md:order-2">
                                1
                            </div>
                            <div class="md:w-1/3 space-y-2 order-3">
                                <h3 class="text-xl font-bold text-white ml-12 sm:ml-0">
                                    Sign Up
                                </h3>
                                <p class="text-white ml-12 sm:ml-0">
                                    Signing up is a breeze - just a few clicks, and you're in.
                                </p>
                            </div>
                        </div>

                        <!-- Deposit Funds -->
                        <div class="relative flex flex-col md:flex-row items-center md:justify-center gap-8 md:gap-96"
                            data-aos="fade-up" data-aos-duration="1500">
                            <div class="flex items-center gap-4 md:w-1/3 md:justify-end order-2 md:order-1">
                                <img src="{{ asset('/assets/templates/pandel/images/box.png') }}" alt="Deposit icon"
                                    class="w-24 h-24 object-contain" />
                            </div>
                            <div
                                class="absolute left-0 md:left-1/2 transform md:-translate-x-1/2 w-8 h-8 bg-blue-400 text-white rounded-full flex items-center justify-center order-1 md:order-2">
                                2
                            </div>
                            <div class="md:w-1/3 space-y-2 order-3">
                                <h3 class="text-xl font-bold text-white ml-12 sm:ml-0">
                                    Deposit Funds
                                </h3>
                                <p class="text-white ml-12 sm:ml-0">
                                    Signing up is a breeze - just a few clicks, and you're in.
                                </p>
                            </div>
                        </div>

                        <!-- Activate Bot -->
                        <div class="relative flex flex-col md:flex-row items-center md:justify-center gap-8 md:gap-96"
                            data-aos="fade-up" data-aos-duration="1500">
                            <div class="flex items-center gap-4 md:w-1/3 md:justify-end order-2 md:order-1">
                                <img src="{{ asset('/assets/templates/pandel/images/robot.png') }}" alt="Bot icon"
                                    class="w-24 h-24 object-contain" />
                            </div>
                            <div
                                class="absolute left-0 md:left-1/2 transform md:-translate-x-1/2 w-8 h-8 bg-blue-400 text-white rounded-full flex items-center justify-center order-1 md:order-2">
                                3
                            </div>
                            <div class="md:w-1/3 space-y-2 order-3">
                                <h3 class="text-xl font-bold text-white ml-12 sm:ml-0">
                                    Activate Bot
                                </h3>
                                <p class="text-white ml-12 sm:ml-0">
                                    Select from our wide range of AI trading bots and activate a
                                    portfolio.
                                </p>
                            </div>
                        </div>

                        <!-- Withdraw -->
                        <div class="relative flex flex-col md:flex-row items-center md:justify-center gap-8 md:gap-96"
                            data-aos="fade-up" data-aos-duration="1500">
                            <div class="flex items-center gap-4 md:w-1/3 md:justify-end order-2 md:order-1">
                                <img src="{{ asset('/assets/templates/pandel/images/withdrawal.png') }}"
                                    alt="Withdraw icon" class="w-24 h-24 object-contain" />
                            </div>
                            <div
                                class="absolute left-0 md:left-1/2 transform md:-translate-x-1/2 w-8 h-8 bg-blue-400 text-white rounded-full flex items-center justify-center order-1 md:order-2">
                                4
                            </div>
                            <div class="md:w-1/3 space-y-2 order-3">
                                <h3 class="text-xl font-bold text-white ml-12 sm:ml-0">
                                    Withdraw
                                </h3>
                                <p class="text-white ml-12 sm:ml-0">
                                    Withdraw your capital and profits to your external wallet at
                                    anytime.
                                </p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
@endsection


@section('scripts')
    <script defer src="https://www.livecoinwatch.com/static/lcw-widget.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>

    {{-- trade data --}}
    <script>
        // Initial trades data
        const initialTrades = @json(recentTrades());

        // Keep track of currently displayed trades
        let currentTrades = [];

        // trade element from data
        function createTradeElement(trade) {
            const div = document.createElement("div");
            const currentTime = new Date().toLocaleTimeString("en-US", {
                hour: "numeric",
                minute: "2-digit",
                second: "2-digit",
                hour12: true,
            });

            div.className = `recent-trade w-full rounded-lg p-4 flex justify-between items-center ${
                trade.profit.startsWith("+")
              ? "text-green-500 hover:bg-green-800"
              : "text-red-500 hover:bg-red-800"
          } shadow-md transition border-b border-gray-600`;

            div.innerHTML = `
          <p class="recent_trade_time text-sm w-24">${currentTime}</p>
          <p class="text-md w-28 px-4">${trade.pair}</p>
          <p class="text-lg w-32 text-right">${trade.amount}</p>
          <p class="text-sm w-20 text-right">${trade.profit}</p>
      `;

            return div;
        }

        // Update all trade times
        function updateTradeTimes() {
            const tradeTimeElements =
                document.querySelectorAll(".recent_trade_time");
            const currentTime = new Date().toLocaleTimeString("en-US", {
                hour: "numeric",
                minute: "2-digit",
                second: "2-digit",
                hour12: true,
            });
            tradeTimeElements.forEach((element) => {
                element.textContent = currentTime;
            });
        }

        // Shuffle and display trades
        function shuffleAndDisplayRecentTrades() {
            const tradesDiv = document.getElementById("recentTrades");
            if (!tradesDiv) return;

            // Initialize trades if needed
            if (currentTrades.length === 0) {
                currentTrades = initialTrades.map((trade) =>
                    createTradeElement(trade)
                );
            }

            // Create a copy and shuffle
            const shuffledTrades = [...currentTrades];
            for (let i = shuffledTrades.length - 1; i > 0; i--) {
                const j = Math.floor(Math.random() * (i + 1));
                [shuffledTrades[i], shuffledTrades[j]] = [
                    shuffledTrades[j],
                    shuffledTrades[i],
                ];
            }

            // Clear and display first 9 trades
            tradesDiv.innerHTML = "";
            const displayCount = Math.min(9, shuffledTrades.length);
            for (let i = 0; i < displayCount; i++) {
                tradesDiv.appendChild(shuffledTrades[i].cloneNode(true));
            }

            updateTradeTimes();
        }

        // Handle periodic updates
        function updateRecentTrades() {
            // In this version, we'll just reshuffle the existing trades
            // In a real implementation, you would fetch new data from the server
            shuffleAndDisplayRecentTrades();
        }

        // Initialize when document is ready
        document.addEventListener("DOMContentLoaded", function() {
            // Initial display
            shuffleAndDisplayRecentTrades();

            // Set up intervals
            const SHUFFLE_INTERVAL = 1000; // 1 second
            const UPDATE_INTERVAL = 10000; // 10 seconds

            // Clear any existing intervals
            if (window.shuffleInterval) clearInterval(window.shuffleInterval);
            if (window.updateInterval) clearInterval(window.updateInterval);

            // Set new intervals
            window.shuffleInterval = setInterval(
                shuffleAndDisplayRecentTrades,
                SHUFFLE_INTERVAL
            );
            window.updateInterval = setInterval(
                updateRecentTrades,
                UPDATE_INTERVAL
            );
        });

        // Clean up on page unload
        window.addEventListener("unload", function() {
            if (window.shuffleInterval) clearInterval(window.shuffleInterval);
            if (window.updateInterval) clearInterval(window.updateInterval);
        });
    </script>

    <!-- crypto prices js  -->
    <script>
        document.addEventListener("alpine:init", () => {
            Alpine.data("cryptoApp", () => ({
                coins: [{
                        id: "bitcoin",
                        name: "Bitcoin",
                        logo: "{{ asset('/assets/templates/pandel/images/heatmarket_coin/bitcoin-btc-logo.png') }}",
                        price: 0,
                        change: 0,
                        symbol: "BTC",
                    },
                    {
                        id: "ethereum",
                        name: "Ethereum",
                        logo: "{{ asset('/assets/templates/pandel/images/heatmarket_coin/ethereum-eth-logo.png') }}",
                        price: 0,
                        change: 0,
                        symbol: "ETH",
                    },
                    {
                        id: "ripple",
                        name: "Ripple",
                        logo: "{{ asset('/assets/templates/pandel/images/heatmarket_coin/ripple-logo.webp') }}",
                        price: 0,
                        change: 0,
                        symbol: "XRP",
                    },
                    {
                        id: "binancecoin",
                        name: "Binance Coin",
                        logo: "{{ asset('/assets/templates/pandel/images/heatmarket_coin/binance-coin-bnb-logo.png') }}",
                        price: 0,
                        change: 0,
                        symbol: "BNB",
                    },
                    {
                        id: "solana",
                        name: "Solana",
                        logo: "{{ asset('/assets/templates/pandel/images/heatmarket_coin/solana-sol-logo.png') }}",
                        price: 0,
                        change: 0,
                        symbol: "SOL",
                    },
                    {
                        id: "dogecoin",
                        name: "Dogecoin",
                        logo: "{{ asset('/assets/templates/pandel/images/heatmarket_coin/dogecoin-doge-logo.png') }}",
                        price: 0,
                        change: 0,
                        symbol: "DOGE",
                    },
                    {
                        id: "cardano",
                        name: "Cardano",
                        logo: "{{ asset('/assets/templates/pandel/images/heatmarket_coin/cardano-ada-logo.png') }}",
                        price: 0,
                        change: 0,
                        symbol: "ADA",
                    },
                    {
                        id: "tron",
                        name: "Tron",
                        logo: "{{ asset('/assets/templates/pandel/images/heatmarket_coin/tron-trx-logo.png') }}",
                        price: 0,
                        change: 0,
                        symbol: "TRX",
                    },
                    {
                        id: "avalanche-2",
                        name: "Avalanche",
                        logo: "{{ asset('/assets/templates/pandel/images/heatmarket_coin/avalanche-avax-logo.png') }}",
                        price: 0,
                        change: 0,
                        symbol: "AVAX",
                    },
                    {
                        id: "sui",
                        name: "Sui",
                        logo: "{{ asset('/assets/templates/pandel/images/heatmarket_coin/sui-sui-logo.png') }}",
                        price: 0,
                        change: 0,
                        symbol: "SUI",
                    },
                    {
                        id: "pepe",
                        name: "Pepe",
                        logo: "{{ asset('/assets/templates/pandel/images/heatmarket_coin/pepe-pepe-logo.png') }}",
                        price: 0,
                        change: 0,
                        symbol: "PEPE",
                    },
                    {
                        id: "toncoin",
                        name: "Toncoin",
                        logo: "{{ asset('/assets/templates/pandel/images/heatmarket_coin/toncoin-ton-logo.png') }}",
                        price: 0,
                        change: 0,
                        symbol: "TON",
                    },
                    {
                        id: "stellar",
                        name: "Stellar",
                        logo: "{{ asset('/assets/templates/pandel/images/heatmarket_coin/stellar-xlm-logo.png') }}",
                        price: 0,
                        change: 0,
                        symbol: "XLM",
                    },
                    {
                        id: "chainlink",
                        name: "Chainlink",
                        logo: "{{ asset('/assets/templates/pandel/images/heatmarket_coin/chainlink-link-logo.png') }}",
                        price: 0,
                        change: 0,
                        symbol: "LINK",
                    },
                    {
                        id: "shiba-inu",
                        name: "Shiba Inu",
                        logo: "{{ asset('/assets/templates/pandel/images/heatmarket_coin/shiba-inu-shib-logo.png') }}",
                        price: 0,
                        change: 0,
                        symbol: "SHIB",
                    },
                ],

                async fetchData() {
                    const apiUrl = `https://api.coingecko.com/api/v3/simple/price?ids=${this.coins
                .map((coin) => coin.id)
                .join(",")}&vs_currencies=usd&include_24hr_change=true`;
                    try {
                        const response = await fetch(apiUrl);
                        const data = await response.json();

                        this.coins.forEach((coin) => {
                            if (data[coin.id]) {
                                coin.price = data[coin.id].usd.toLocaleString();
                                coin.change = data[coin.id].usd_24h_change;
                            }
                        });
                    } catch (error) {
                        console.error("Error fetching cryptocurrency data:", error);
                    }
                },

                init() {
                    this.fetchData();
                },
            }));
        });
    </script>

    <!-- testimonials js  -->
    <script>
        document.addEventListener("DOMContentLoaded", function() {
            new Swiper(".testimonial-slider", {
                slidesPerView: 1,
                spaceBetween: 30,
                navigation: {
                    nextEl: ".swiper-button-next",
                    prevEl: ".swiper-button-prev",
                },
                breakpoints: {
                    640: {
                        slidesPerView: 2,
                    },
                    1024: {
                        slidesPerView: 3,
                    },
                },
                loop: true,
            });
        });
    </script>
@endsection
