<?php $__env->startSection('content'); ?>
    <style>
        body {
            background-color: #f0f4f8;
        }

        .container {
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
        }

        .task-card {
            background-color: #ffffff;
            border-radius: 10px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            margin-bottom: 20px;
            padding: 20px;
        }

        .task-header {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
        }

        .task-header i {
            font-size: 20px;
            color: #007bff;
            margin-right: 10px;
        }

        .task-title {
            font-size: 16px;
            font-weight: bold;
            color: #333333;
        }

        .task-subtitle {
            font-size: 14px;
            color: #666666;
        }

        .task-reward {
            font-size: 18px;
            font-weight: bold;
            color: #007bff;
            margin-top: 10px;
        }

        .task-progress {
            display: flex;
            align-items: center;
            margin-top: 10px;
        }

        .progress-bar {
            flex: 1;
            height: 8px;
            background-color: #e0e0e0;
            border-radius: 4px;
            margin-right: 10px;
            position: relative;
        }

        .progress {
            background-color: #007bff;
            height: 8px;
            border-radius: 4px;
            position: absolute;
            top: 0;
            left: 0;
        }

        .progress-text {
            font-size: 14px;
            color: #666666;
        }

        .invite-button {
            display: block;
            width: 100%;
            padding: 10px;
            background-color: #007bff;
            color: #ffffff;
            text-align: center;
            border-radius: 5px;
            text-decoration: none;
            font-size: 16px;
            margin-top: 10px;
        }
    </style>

    <body>

        <div class="page-wraper">


            <style>
                .header .header-content .mid-content {
                    flex: 1;
                    text-align: left;
                }

                .header {
                    background-color: #87b922;
                    min-height: 55px;
                    z-index: 2;
                    border-bottom: 0px solid #dddddd;
                }

                #preloader {
                    top: 0;
                }

                i.fa-solid.fa-bell {
                    font-size: 22px;
                    color: white;
                    margin-top: 12px;
                    padding-right: 7px;
                }

                i.fa-solid.fa-globe {
                    font-size: 22px;
                    color: white;
                    margin-top: 12px;
                    padding-right: 7px;
                }

                .header .sticky-header {
                    top: 0px;
                    background: #87b922;
                }

                .toast.style-1.toast-danger {
                    background-color: #1e1e1e5e;
                    color: #fff;
                    border: 0px white solid;
                    backdrop-filter: blur(5px);
                }

                .toast.style-1 .toast-body {
                    display: flex;
                    align-items: center;
                    padding: 14px;
                }

                .toast.style-1.toast-danger .toast-content strong {
                    color: #fff;
                    font-weight: 600;
                }
            </style>


            <!-- Header -->
            <header class="header">
                <div class="main-bar">
                    <div class="container">
                        <div class="header-content">

                            <div class="mid-content">
                                <h5 class="mb-0">Mission</h5>
                            </div>
                            <!--              <div class="right-content">-->
                            <!--                  <a href="javascript:void(0);" class="menu-toggler">-->
                            <!--	<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">-->
                            <!--		<path opacity="0.4" d="M16.0755 2H19.4615C20.8637 2 22 3.14585 22 4.55996V7.97452C22 9.38864 20.8637 10.5345 19.4615 10.5345H16.0755C14.6732 10.5345 13.537 9.38864 13.537 7.97452V4.55996C13.537 3.14585 14.6732 2 16.0755 2Z" fill="#a19fa8"/>-->
                            <!--		<path fill-rule="evenodd" clip-rule="evenodd" d="M4.53852 2H7.92449C9.32676 2 10.463 3.14585 10.463 4.55996V7.97452C10.463 9.38864 9.32676 10.5345 7.92449 10.5345H4.53852C3.13626 10.5345 2 9.38864 2 7.97452V4.55996C2 3.14585 3.13626 2 4.53852 2ZM4.53852 13.4655H7.92449C9.32676 13.4655 10.463 14.6114 10.463 16.0255V19.44C10.463 20.8532 9.32676 22 7.92449 22H4.53852C3.13626 22 2 20.8532 2 19.44V16.0255C2 14.6114 3.13626 13.4655 4.53852 13.4655ZM19.4615 13.4655H16.0755C14.6732 13.4655 13.537 14.6114 13.537 16.0255V19.44C13.537 20.8532 14.6732 22 16.0755 22H19.4615C20.8637 22 22 20.8532 22 19.44V16.0255C22 14.6114 20.8637 13.4655 19.4615 13.4655Z" fill="#a19fa8"/>-->
                            <!--	</svg>-->
                            <!--</a>-->
                            <!--              </div>-->
                        </div>
                    </div>
                </div>
            </header>


            <!--   <div id="preloader">-->
            <!--	<div class="spinner"></div>-->
            <!--</div>-->


            <div class="page-content">
                <div class="content-inner pt-0">
                    <div class="container fb">
                        <div class="mission-card">
                            <div class="d-flex align-items-center">
                                <img src="<?php echo e(asset('assets/app/img/download-9.png')); ?>"
                                    style="width: 35px;margin-top: -22px;">

                                <p class="ms-3 reward-title">
                                    Invite 5 to Invest &amp; get <?php echo e($general->cur_sym); ?>100 </p>
                            </div>
                            <div class="progress-section">
                                <p class="mb-0">
                                    Invited <?php echo e($referralsCount); ?>/5 </p>
                                <button class="btn Claim-btn btn-primary btn-sm"
                                    onclick="claimReward(100)">
                                    Claim
                                </button>
                            </div>
                        </div>
                        <div class="mission-card">
                            <div class="d-flex align-items-center">
                                <img src="<?php echo e(asset('assets/app/img/download-9.png')); ?>"
                                    style="width: 35px;margin-top: -22px;">

                                <p class="ms-3 reward-title">
                                    Invite 10 to Invest &amp; get <?php echo e($general->cur_sym); ?>200 </p>
                            </div>
                            <div class="progress-section">
                                <p class="mb-0">
                                    Invited <?php echo e($referralsCount); ?>/10 </p>
                                <button class="btn Claim-btn btn-primary btn-sm"
                                    onclick="claimReward(200)">
                                    Claim
                                </button>
                            </div>
                        </div>
                        <div class="mission-card">
                            <div class="d-flex align-items-center">
                                <img src="<?php echo e(asset('assets/app/img/download-9.png')); ?>"
                                    style="width: 35px;margin-top: -22px;">

                                <p class="ms-3 reward-title">
                                    Invite 20 to Invest &amp; get <?php echo e($general->cur_sym); ?>250 </p>
                            </div>
                            <div class="progress-section">
                                <p class="mb-0">
                                    Invited <?php echo e($referralsCount); ?>/20 </p>
                                <button class="btn Claim-btn btn-primary btn-sm"
                                onclick="claimReward(250)">
                                    Claim
                                </button>
                            </div>
                        </div>
                        <div class="mission-card">
                            <div class="d-flex align-items-center">
                                <img src="<?php echo e(asset('assets/app/img/download-9.png')); ?>"
                                    style="width: 35px;margin-top: -22px;">

                                <p class="ms-3 reward-title">
                                    Invite 50 to Invest &amp; get <?php echo e($general->cur_sym); ?>500 </p>
                            </div>
                            <div class="progress-section">
                                <p class="mb-0">
                                    Invited <?php echo e($referralsCount); ?>/50 </p>
                                <button class="btn Claim-btn btn-primary btn-sm"
                                onclick="claimReward(500)">
                                    Claim
                                </button>
                            </div>
                        </div>
                        <div class="mission-card">
                            <div class="d-flex align-items-center">
                                <img src="<?php echo e(asset('assets/app/img/download-9.png')); ?>"
                                    style="width: 35px;margin-top: -22px;">

                                <p class="ms-3 reward-title">
                                    Invite 100 to Invest &amp; get <?php echo e($general->cur_sym); ?>1500 </p>
                            </div>
                            <div class="progress-section">
                                <p class="mb-0">
                                    Invited <?php echo e($referralsCount); ?>/100 </p>
                                <button class="btn Claim-btn btn-primary btn-sm"
                                onclick="claimReward(1500)">
                                    Claim
                                </button>
                            </div>
                        </div>
                        <div class="mission-card">
                            <div class="d-flex align-items-center">
                                <img src="<?php echo e(asset('assets/app/img/download-9.png')); ?>"
                                    style="width: 35px;margin-top: -22px;">

                                <p class="ms-3 reward-title">
                                    Invite 200 to Invest &amp; get <?php echo e($general->cur_sym); ?>3500 </p>
                            </div>
                            <div class="progress-section">
                                <p class="mb-0">
                                    Invited <?php echo e($referralsCount); ?>/200 </p>
                                <button class="btn Claim-btn btn-primary btn-sm"
                                onclick="claimReward(3500)">
                                    Claim
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="title-bar mt-3">
                <p class="backbutton" onclick="window.history.back();">
                    <i class="fa-solid fa-chevron-left" style="color: white;"></i>
                </p>
                <div class="swiper-defult-pagination pagination-dots style-1 p-0"></div>
            </div>



            <style>
                body {

                    background-color: #fff;
                }

                .header {
                    background: #9ed230 !important;
                    min-height: 40px;
                    margin-bottom: 70px;
                    border-bottom: 0px solid #dddddd;
                    border-bottom-left-radius: 0%;
                    border-bottom-right-radius: 0%;
                }

                h5.mb-0 {
                    color: white;
                    margin-top: 2px;
                }

                .mission-card {
                    border-radius: 12px;
                    padding: 15px;
                    margin-bottom: 15px;
                    color: #fff;
                    background: #9ed230;
                    box-shadow: 0px 4px 10px rgba(158, 210, 48, 0.5) !important;
                }

                .reward-title {
                    font-weight: bold;
                    font-size: 16px;
                }

                .progress-section {
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    margin-top: 10px;
                }

                .progress-bar {
                    background: #007bff;
                }

                .Claim-btn btn-primary btn-sm {
                    background: #007bff;
                    color: white;
                    border-radius: 50px;
                    padding: 5px 15px;
                    font-size: 14px;
                }

                .profile-header {
                    color: white;
                    padding: 20px;
                    text-align: center;
                    border-radius: 10px;
                    background: var(--gradient);
                }

                .w-32 {
                    width: 32%;
                }

                .header .header-content .mid-content {
                    flex: 1;
                    text-align: center;
                }

                .backbutton {
                    width: 36px;
                    height: 36px;
                    background: #ffffff1c;
                    border-radius: 12px 12px 12px 12px;
                    border: 1px solid #ffffff80;
                    line-height: 36px;
                    text-align: center;
                    position: absolute;
                    top: 10px;
                    left: 15px;
                    color: white;
                }

                .menubar-area {
                    display: none;
                }

                .fb {
                    padding-bottom: 80px;
                    margin-top: -70px;
                }

                .btn.btn-sm,
                .btn-group-sm>.btn {
                    padding: 10px 18px;
                    line-height: 1.1;
                    font-size: 12px;
                    border-radius: 12px;
                    background: url(<?php echo e(asset('assets/app/img/bg-exchange-btn.png')); ?>);
                    border: none;
                    background-size: 100% 140%;
                }
            </style>



            <style>
                .menubar-area .toolbar-inner .nav-link.active:after,
                .menubar-area .toolbar-inner .menu-toggler.active:after {
                    content: "";
                    position: absolute;
                    bottom: -11px;
                    height: 5px;
                    background: #340166;
                }

                .menubar-area {
                    position: fixed;
                    bottom: 0;
                    left: 0;
                    width: 100%;
                    background: #fff;
                    padding: 20px;
                    z-index: 999;
                    padding-top: 12px !important;
                    padding-bottom: 10px !important;
                    border-radius: 8px 8px 0px 0px;
                    box-shadow: 0 12px 26px 0 rgba(0, 0, 0, 0.3);
                }

                a:hover,
                a:focus,
                .fa-solid,
                a.active,
                .fa-solid.active {
                    text-decoration: none;
                    outline: none;
                    color: var(--primary-hover);
                }
            </style>




        </div>

        

        <script>
            // Define the progress values
            const current = <?php echo e($referralsCount); ?>; // Current progress value
            const total = 1000; // Total target value

            // Calculate the progress percentage
            const percentage = (current / total) * 100;

            // Update the progress bar and text dynamically
            document.getElementById('progress-bar').style.width = percentage + '%';
            document.getElementById('progress-text').textContent = `${current} / ${total}`;
        </script>

        <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
        <script>
            function claimReward(amount) {
                $.ajax({
                    url: "<?php echo e(route('user.invite')); ?>", // Use named route
                    type: "POST",
                    data: {
                        amount: amount
                    },
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') // Add CSRF token
                    },
                    success: function(response) {
                        message(response.message || 'Reward claimed successfully!');
                    },
                    error: function(xhr, status, error) {
                        console.error('Status:', status);
                        console.error('Error:', error);
                        console.error('Response:', xhr.responseText);
                        message(xhr.responseText);
                    }
                });
            }
        </script>

    </body>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.users', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/ildrhcvy/olamapp.com/core/resources/views/templates/basic/user/salary.blade.php ENDPATH**/ ?>