@extends('layouts.user')

@section('title')
Deposit Temporarily Suspended
@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">
                            <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="">
                                </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>

            <div class="mt-6 lg:w-3/4 md:w-2/3 md:px-3 md:mt-0">

                <x-alert />

                <div class="bg-white rounded-md shadow dark:shadow-gray-800 dark:bg-slate-900">
                    <div class="items-center justify-between p-6 border-b border-gray-100 md:flex dark:border-gray-700">
                        <div class="mb-4 md:mb-0">
                            <h5 class="text-xl font-semibold">Deposit Temporarily Suspended</h5>
                        </div>
                    </div>

                    <div class="p-6">
                        <h5 class="text-2xl font-semibold text-center text-red-600">Deposits are currently suspended.</h5>
                        <p class="mt-2 text-slate-400 text-center">All store funding process have been suspended due to upcoming GEAS expansion launch.</p>
                    </div>

                    <!-- Countdown Timer -->
                    <div class="p-6 mt-6 bg-white rounded-md shadow dark:shadow-gray-800 dark:bg-slate-900">
                        <h5 class="text-xl font-semibold text-center text-bgray-900 dark:text-white">Next Deposit Resumption</h5>
                        <div id="countdown" class="mt-6 text-center text-3xl font-semibold text-orange-500">
                            <!-- Timer will be dynamically updated -->
                        </div>
                    </div>
                </div>

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

<script>
    // Set the date for when deposits will resume (example: January 1, 2025 12:00:00)
    const targetDate = new Date("March 20, 2026 15:00:00").getTime();

    // Update the countdown every 1 second
    const countdown = setInterval(function() {
        const now = new Date().getTime();
        const distance = targetDate - now;

        // Calculate time remaining
        const days = Math.floor(distance / (1000 * 60 * 60 * 24));
        const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
        const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
        const seconds = Math.floor((distance % (1000 * 60)) / 1000);

        // Display the countdown
        document.getElementById("countdown").innerHTML =
            days + "d " + hours + "h " + minutes + "m " + seconds + "s ";

        // If the countdown is over, display a message
        if (distance < 0) {
            clearInterval(countdown);
            document.getElementById("countdown").innerHTML = "Deposits are now resumed!";
        }
    }, 1000);
</script>

@endsection
