<?php
    $kycInstruction = getContent('kyc_instruction.content', true);
    $banners = \App\Models\Banner::latest()->get();
    
    $lastWinner = \App\Models\Winner::with('user')
    ->where('user_id', auth()->id())
    ->orderBy('id', 'DESC')
    ->first();
?>

<?php $__env->startSection('content'); ?>

<style>
    .inner-hero.bg_img.overlay--one {
        display: none;
    }

    .banner_slider {
        width: 100%;
    }
    .banner_slider img {
        object-fit: cover;
        width: 100%;
        height: 250px;
        border-radius: 15px;
    }
    @media (max-width: 768px) {
        .banner_slider img {
            height: 200px;
        }
    }

 /* Advanced banner styling */
    .winner-banner {
      background: linear-gradient(135deg, rgba(248,249,250,0.95), rgba(233,247,239,0.95));
      backdrop-filter: blur(6px);
      border-left: 6px solid #198754;
      border-right: 6px solid #198754;
      padding: 1.5rem;
      border-radius: 1rem;
      box-shadow: 0 1rem 2rem rgba(0,0,0,0.15);
      display: flex;
      justify-content: space-between;
      align-items: center;
      opacity: 0;
      transform: translateY(30px);
      animation: fadeSlideUp 2s ease forwards; /* slower animation */
      transition: all 0.5s ease;
    }

    .winner-banner:hover {
      transform: scale(1.05);
      box-shadow: 0 1.25rem 2.5rem rgba(0,0,0,0.2);
    }

    .winner-icon {
      font-size: clamp(2rem, 3vw, 3.5rem);
      margin-right: 1rem;
      color: #198754;
      animation: bounce 3s infinite; /* slower bounce */
    }

    .winner-text {
      font-size: clamp(1.25rem, 2.5vw, 2rem);
      font-weight: 600;
      letter-spacing: 0.5px;
    }

    .winner-amount {
      font-size: clamp(1.75rem, 3vw, 2.5rem);
      font-weight: bold;
      color: #198754;
      animation: pulse 4.5s infinite; /* slower pulse */
    }

    .btn-claim {
      margin-left: 1rem;
      background: linear-gradient(135deg, #198754, #28a745);
      border: none;
      color: #fff;
      font-weight: 600;
      padding: 0.5rem 1rem;
      border-radius: 0.5rem;
      transition: all 0.4s ease;
    }
    .btn-claim:hover {
      background: linear-gradient(135deg, #28a745, #198754);
      transform: translateY(-3px);
      box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.2);
    }

    /* Animations */
    @keyframes fadeSlideUp {
      from { opacity: 0; transform: translateY(30px); }
      to { opacity: 1; transform: translateY(0); }
    }
    @keyframes bounce {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-8px); }
    }
    @keyframes pulse {
      0%, 100% { transform: scale(1); color: #198754; }
      50% { transform: scale(1.1); color: #28a745; }
    }

    .text-yellow {
      color: #ffc107;
      font-weight: bold;
    }

    /* Responsive tweak */
    @media (max-width: 425px) {
      .winner-banner {
        flex-direction: column;
        text-align: center;
      }
      .btn-claim {
        margin: 1rem 0 0 0;
      }
    }
</style>

    <!-- dashboard section start -->
    <section class="pt-3 pb-100">
        <div class="container">
            <div class="d-md-none">
                <div class="banner_slider">
                    <?php $__currentLoopData = $banners; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $banner): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div>
                            <img src="<?php echo e(asset(getFilePath('banner') . '/' . $banner->file)); ?>" loading="lazy" />
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            </div>
            
            <?php if($lastWinner): ?>
            <!--<div class="last-winner-card">-->
            <!--    <div class="left-info">-->
            <!--        <div class="ticket">You are a winner of Ticket #<?php echo e($lastWinner->ticket_number); ?></div>-->
            <!--        <div class="user"><?php echo e($lastWinner->user->name); ?></div>-->
            <!--    </div>-->
            <!--</div>-->
           
                
                 <div class="container py-3">
    <div class="winner-banner">
      <div class="d-flex align-items-center flex-wrap justify-content-center">
        <div class="winner-icon">🎉</div>
        <div class="winner-text">You are a winner of Ticket <span class="text-yellow">#543</span></div>
      </div>
      <div class="d-flex align-items-center">
        <div class="winner-amount">$200</div>
        <!-- <button class="btn btn-claim">Claim Prize</button> -->
      </div>
    </div>
  </div>




            
            <script>
            const el = document.querySelector('.win-amount');
            if (el) {
                let final = el.getAttribute('data-win');
                let start = 0;
                let duration = 1500;
                let step = final / (duration / 20);
            
                let interval = setInterval(() => {
                    start += step;
                    if (start >= final) {
                        start = final;
                        clearInterval(interval);
                    }
                    el.textContent = "$" + Math.floor(start);
                }, 20);
            }
            </script>
            <?php endif; ?>
            
            <div class="row">
                <div class="col-lg-12">
                    <?php if(auth()->user()->kv == 0): ?>
                        <div class="alert alert-danger p-3" role="alert">
                            <h4 class="alert-heading"><?php echo app('translator')->get('KYC Verification required'); ?></h4>
                            <hr>
                            <p class="mb-0"><?php echo e(__($kycInstruction->data_values->verification_instruction)); ?> <a href="<?php echo e(route('user.kyc.form')); ?>"><?php echo app('translator')->get('Click Here to Verify'); ?></a></p>
                        </div>
                    <?php elseif(auth()->user()->kv == 2): ?>
                        <div class="alert alert-warning p-3" role="alert">
                            <h4 class="alert-heading"><?php echo app('translator')->get('KYC Verification pending'); ?></h4>
                            <hr>
                            <p class="mb-0"><?php echo e(__($kycInstruction->data_values->pending_instruction)); ?> <a href="<?php echo e(route('user.kyc.data')); ?>"><?php echo app('translator')->get('See KYC Data'); ?></a></p>
                        </div>
                    <?php endif; ?>
                </div>
                
                
            </div>
            
            <?php
                $lottery = \App\Models\Lottery::with('phase')->where('id', 1)->first();
                $lottery_link = '#';
                
                if ($lottery && $lottery->phase) {
                    $phase = $lottery->phase()->latest()->first();
                    
                    if ($phase && $phase->available) {
                        $lottery_link = '/user/lottery/details/' . $phase->id;
                    }
                }
            ?>
            
            <div class="d-block d-md-none">
                <table class="table table-bordered bg-white mt-3 mb-0 text-center">
                    <tbody>
                        <tr>
                            <td width="50%">
                                <a href='<?php echo e($lottery_link); ?>?pick=3'>
                                    <img src="<?php echo e(asset('assets/images/pick_3.png')); ?>" loading="lazy" width="80%" />
                                </a>
                            </td>
                            <td width="50%">
                                <a href='<?php echo e($lottery_link); ?>?pick=4'>
                                    <img src="<?php echo e(asset('assets/images/pick_4.png')); ?>" loading="lazy" width="80%" />
                                </a>
                            </td>
                        </tr>
                        <!--<tr>-->
                        <!--    <td width="100%" colspan="2">-->
                        <!--        <a class="btn btn-sm btn--danger btn--capsule text-white d-block w-100" href="/user/lottery">-->
                        <!--            Play Game-->
                        <!--        </a>-->
                        <!--    </td>-->
                        <!--</tr>-->
                    </tbody>
                </table>
            </div>
            
            <style>
                .cus_card {
                    box-shadow: rgba(50, 50, 93, 0.25) 0px 6px 12px -2px, rgba(0, 0, 0, 0.3) 0px 3px 7px -3px;
                    border-radius: 15px;
                    height: 130px;
                    overflow: hidden;
                    display: grid;
                    /*place-items: center;*/
                    text-align: right;
                    padding: 15px;
                    position: relative;
                }
                
                .cus_card h4 {
                    font-size: 35px;
                    color: #fff;
                    /*letter-spacing: 10px;*/
                }
                
                .cus_card h5 {
                    font-size: 13px;
                    color: #fff;
                }
                
                .cus_card .icon_box {
                    width: 80px;
                    height: 80px;
                    line-height: 70px;
                    border-radius: 50%;
                    background: #0d0d31;
                    text-align: center;
                    position: absolute;
                    bottom: -30px;
                    left: -20px;
                }
                
                .cus_card .icon_box i {
                    color: #fff;
                    font-size: 30px;
                    margin-left: 10px;
                }
            </style>
            
            <div class="d-block d-md-none">
                <div class="row g-3 align-items-center mt-2">
                    <div class="col-6">
                        <div class="cus_card" style="background: #FF339A;">
                            <div>
                                <h4><?php echo e($user->wins->count()); ?></h4>
                                <h5>Total Win</h5>
                            </div>
                            <div class="icon_box">
                                <i class="las la-trophy"></i>
                            </div>
                        </div>
                    </div>
                    <div class="col-6">
                        <div class="cus_card" style="background: #1083e5;">
                            <div>
                                <h4><?php echo e(__($general->cur_sym)); ?><?php echo e(getAmount($user->balance)); ?></h4>
                                <h5>Total Balance</h5>
                            </div>
                            <div class="icon_box">
                                <i class="las la-wallet"></i>
                            </div>
                        </div>
                    </div>
                    <div class="col-6">
                        <div class="cus_card" style="background: #6600CC;">
                            <div>
                                <h4><?php echo e(__($general->cur_sym)); ?><?php echo e($user->deposits->sum('amount') + 0); ?></h4>
                                <h5>Total Deposit</h5>
                            </div>
                            <div class="icon_box">
                                <i class="las la-dollar-sign"></i>
                            </div>
                        </div>
                    </div>
                    <div class="col-6">
                        <div class="cus_card" style="background: #00CC99;">
                            <div>
                                <h4><?php echo e(__($general->cur_sym)); ?><?php echo e($user->withdrawals->where('status', 1)->sum('amount') + 0); ?></h4>
                                <h5>Total Withdraw</h5>
                            </div>
                            <div class="icon_box">
                                <i class="las la-dollar-sign"></i>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="d-none d-md-block">
                <div class="row gy-4 align-items-center mt-2">
                    <div class="col-lg-3 col-sm-6">
                        <div class="balance-card">
                            <span class=""><?php echo app('translator')->get('Total Balance'); ?></span>
                            <h3 class="number text-white"><?php echo e(__($general->cur_sym)); ?><?php echo e(getAmount($user->balance)); ?></h3>
                        </div><!-- dashboard-card end -->
                    </div>
                    <div class="col-lg-3 col-sm-6">
                        <div class="dashboard-card">
                            <span><?php echo app('translator')->get('Total Win'); ?></span>
                            <a class="view--btn" href="<?php echo e(route('user.wins')); ?>"><?php echo app('translator')->get('View log'); ?></a>
                            <h3 class="number"><?php echo e($user->wins->count()); ?></h3>
                            <i class="las la-trophy icon"></i>
                        </div><!-- dashboard-card end -->
                    </div>
                    <div class="col-lg-3 col-sm-6">
                        <div class="dashboard-card">
                            <span><?php echo app('translator')->get('Total Deposit'); ?></span>
                            <a class="view--btn" href="<?php echo e(route('user.deposit.history')); ?>"><?php echo app('translator')->get('View log'); ?></a>
                            <h3 class="number"><?php echo e(__($general->cur_sym)); ?><?php echo e($user->deposits->sum('amount') + 0); ?></h3>
                            <i class="las la-dollar-sign icon"></i>
                        </div><!-- dashboard-card end -->
                    </div>
                    <div class="col-lg-3 col-sm-6">
                        <div class="dashboard-card">
                            <span><?php echo app('translator')->get('Total Withdraw'); ?></span>
                            <a class="view--btn" href="<?php echo e(route('user.withdraw.history')); ?>"><?php echo app('translator')->get('View log'); ?></a>
                            <h3 class="number"><?php echo e(__($general->cur_sym)); ?><?php echo e($user->withdrawals->where('status', 1)->sum('amount') + 0); ?></h3>
                            <i class="las la-hand-holding-usd icon"></i>
                        </div><!-- dashboard-card end -->
                    </div>
                </div><!-- row end -->
            </div>
            
            <div class="row mt-5">
                <div class="col-lg-12">
                    <div class="row justify-content-center">
                        <div class="col-lg-6">
                            <div class="section-header text-center">
                                <h2 class="section-title"><?php echo app('translator')->get('Waiting for Draw'); ?></h2>
                            </div>
                        </div>
                    </div><!-- row end -->

                    <div class="row">
                        <div class="col-md-12 mb-30">
                            <table class="custom--tabl table table-sm text-center table-bordered"> 
                                <thead class="table-danger">
                                    <tr>
                                        <th width="10%"><?php echo app('translator')->get('Pick'); ?></th>
                                        <th width="25%"><?php echo app('translator')->get('Ticket'); ?></th>
                                        <th width="35%"><?php echo app('translator')->get('Type'); ?></th>
                                        <th width="30%"><?php echo app('translator')->get('Result'); ?></th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $__empty_1 = true; $__currentLoopData = $tickets; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ticket): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                        <tr>
                                            <td><?php echo e(__($ticket->number_pick)); ?></td>
                                            <td class="text-center">
                                                <?php echo e($ticket->ticket_number); ?>

                                            </td>
                                            <td>
                                                <?php echo e(__($general->cur_sym)); ?><?php echo e(getAmount($ticket->total_price)); ?>

                                                <br/>
                                                <?php echo e(__($ticket->type)); ?>

                                            </td>
                                            <td>
                                                <?php
                                                    echo $ticket->statusBadge;
                                                ?>
                                            </td>
                                        </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                        <tr>
                                            <td class="rounded-bottom text-center" colspan="100%"><?php echo e(__($emptyMessage)); ?></td>
                                        </tr>
                                    <?php endif; ?>
                                </tbody>
                            </table>
                            <div class="d-flex justify-content-center mt-3">
                                <?php if($tickets->hasPages()): ?>
                                    <?php echo e(paginateLinks($tickets)); ?>

                                <?php endif; ?>
                            </div>

                        </div>
                    </div>

                </div>
            </div>
        </div>
    </section>
    <!-- dashboard section end -->
<?php $__env->stopSection(); ?>

<?php $__env->startPush('style-lib'); ?>
    <link type="text/css" href="<?php echo e(asset('assets/global/css/jquery.treeView.css')); ?>" rel="stylesheet">
<?php $__env->stopPush(); ?>

<?php $__env->startPush('script'); ?>
    <script src="<?php echo e(asset('assets/global/js/jquery.treeView.js')); ?>"></script>
    <script>
        (function($) {
            "use strict"

            $('.treeview').treeView();
            $('.copyBoard').click(function() {
                var copyText = document.getElementsByClassName("referralURL");
                copyText = copyText[0];
                copyText.select();
                copyText.setSelectionRange(0, 99999);

                /*For mobile devices*/
                document.execCommand("copy");
                copyText.blur();
                this.classList.add('copied');
                setTimeout(() => this.classList.remove('copied'), 1500);
            });
        })(jQuery);
        
        $(document).ready(function(){
            $('.banner_slider').slick({
                dots: false,
                arrows: false,
                infinite: true,
                autoplay: true,
                speed: 300,
                slidesToShow: 1,
                slidesToScroll: 1,
            })
        })
    </script>
    
    
<?php $__env->stopPush(); ?>

<?php echo $__env->make($activeTemplate . 'layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/wwwwebsitedevelo/domains/websitedevelopment.com.pk/public_html/lotto-fiesta.websitedevelopment.com.pk/core/resources/views/templates/basic/user/dashboard.blade.php ENDPATH**/ ?>