<?php
    $isFrontRoute = fn (...$patterns) => request()->routeIs(...$patterns);
    $isRouteGroupActive = fn (array $patterns) => $isFrontRoute(...$patterns);
    $currentPageSlug = (int) request()->route('slug', 0);
    $examLinks = [
        [
            'route' => 'competitionlist',
            'label' => 'Home',
            'icon' => 'fa-home',
            'helper' => 'Available exams, details and join flow',
            'active' => $isRouteGroupActive(['competitionlist', 'contestdetails', 'competitionjoin', 'examstart', 'examslive']),
        ],
        [
            'route' => 'gamehistory',
            'label' => 'Exam History',
            'icon' => 'fa-list',
            'helper' => 'Joined exams and past activity',
            'active' => $isRouteGroupActive(['gamehistory']),
        ],
        [
            'route' => 'scoringresult',
            'label' => 'Scoring Result',
            'icon' => 'fa-trophy',
            'helper' => 'Latest score and points overview',
            'active' => $isRouteGroupActive(['scoringresult']),
        ],
        [
            'route' => 'scholershipresult',
            'label' => 'Scholarship Results',
            'icon' => 'fa-graduation-cap',
            'helper' => 'Declared exam result and ranking',
            'active' => $isRouteGroupActive(['scholershipresult', 'myexamresultdetails', 'examsresultt', 'examsanswersheet']),
        ],
    ];
    $accountLinks = [
        [
            'route' => 'walletrecharge',
            'label' => 'Add Money',
            'icon' => 'fa-credit-card',
            'helper' => 'Recharge wallet before joining exam',
            'active' => $isRouteGroupActive(['walletrecharge', 'walletamount']),
        ],
        [
            'route' => 'wallethistory',
            'label' => 'Wallet History',
            'icon' => 'fa-history',
            'helper' => 'See recharge and wallet movement',
            'active' => $isRouteGroupActive(['wallethistory']),
        ],
        [
            'route' => 'userwithdraw',
            'label' => 'Withdraw',
            'icon' => 'fa-money',
            'helper' => 'Request wallet payout',
            'active' => $isRouteGroupActive(['userwithdraw', 'withdrawhistory']),
        ],
        [
            'route' => 'editprofile',
            'label' => 'Edit Profile',
            'icon' => 'fa-user',
            'helper' => 'Update student profile details',
            'active' => $isRouteGroupActive(['editprofile', 'profileimg', 'mobileotp', 'emailvarification']),
        ],
        [
            'route' => 'userpasswordchange',
            'label' => 'Change Password',
            'icon' => 'fa-lock',
            'helper' => 'Keep your account secure',
            'active' => $isRouteGroupActive(['userpasswordchange']),
        ],
    ];
    $policyLinks = [
        ['slug' => 8, 'label' => 'Terms & Conditions', 'icon' => 'fa-file-text-o'],
        ['slug' => 9, 'label' => 'Privacy Policy', 'icon' => 'fa-shield'],
        ['slug' => 5, 'label' => 'Legality Policy', 'icon' => 'fa-balance-scale'],
        ['slug' => 10, 'label' => 'Refund Policy', 'icon' => 'fa-refresh'],
        ['slug' => 11, 'label' => 'Cancellation Policy', 'icon' => 'fa-ban'],
        ['slug' => 6, 'label' => 'Contact Us', 'icon' => 'fa-phone'],
    ];
?>
<header class="main-header">
    <div class="container jel-front-container">
        <div class="row align-items-center g-3">
            <div class="col-7 col-md-6 d-flex align-items-center gap-3">
                <a id="slide" class="menu-icon" href="javascript:void(0)" aria-label="Open navigation" aria-expanded="false" aria-controls="menhupartsectipon">
                    <i class="fa fa-bars"></i>
                </a>

                <a class="site-logo" href="<?php echo e(route('competitionlist')); ?>">
                    <img src="<?php echo e(asset('public/frontend/images/logo.png')); ?>" alt="Just Exam League">
                    <span class="site-logo-text d-none d-sm-inline">Just Exam League</span>
                </a>
            </div>
            <div class="col-5 col-md-6">
                <div class="header-right">
                    <a class="wallet-box" href="<?php echo e(route('walletrecharge')); ?>">
                        <i class="fa fa-credit-card"></i>
                        <span>&#8377; <?php echo e(number_format((float) ($portalWalletAmount ?? 0), 2)); ?></span>
                    </a>
                    <a href="<?php echo e(route('gamehistory')); ?>" class="notification-icon" aria-label="Game history">
                        <i class="fa fa-history"></i>
                        <span class="notify-dot"></span>
                    </a>
                </div>
            </div>
        </div>
    </div>
</header>
<div class="sidebar-overlay" id="sidebarOverlay"></div>
<div class="sidebar-menu" id="menhupartsectipon">
    <div class="sidebar-header">
        <div class="profile-section">
            <img src="<?php echo e($portalProfileImageUrl); ?>" alt="<?php echo e($portalStudent?->name ?? 'Student'); ?>">
            <div class="profile-info">
                <small class="profile-label">Student Panel</small>
                <span><a href="<?php echo e(route('editprofile')); ?>"><?php echo e($portalStudent?->name ?? 'Student Portal'); ?></a></span>
                <p>Mobile No.: <?php echo e($portalStudent?->mobileno ?? 'Not available'); ?></p>
            </div>
        </div>
        <button class="close-sidebar" id="closeSidebar" type="button" aria-label="Close menu">
            <i class="fa fa-times"></i>
        </button>
    </div>
    <div class="sidebar-body">
        <div class="sidebar-section-title">Exam Zone</div>
        <ul>
            <?php $__currentLoopData = $examLinks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $link): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <li class="<?php echo e($link['active'] ? 'active' : ''); ?>">
                    <a href="<?php echo e(route($link['route'])); ?>">
                        <i class="fa <?php echo e($link['icon']); ?>"></i>
                        <span class="sidebar-link-copy">
                            <strong><?php echo e($link['label']); ?></strong>
                            <small><?php echo e($link['helper']); ?></small>
                        </span>
                    </a>
                </li>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </ul>

        <div class="sidebar-section-title">Wallet & Account</div>
        <ul>
            <?php $__currentLoopData = $accountLinks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $link): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <li class="<?php echo e($link['active'] ? 'active' : ''); ?>">
                    <a href="<?php echo e(route($link['route'])); ?>">
                        <i class="fa <?php echo e($link['icon']); ?>"></i>
                        <span class="sidebar-link-copy">
                            <strong><?php echo e($link['label']); ?></strong>
                            <small><?php echo e($link['helper']); ?></small>
                        </span>
                    </a>
                </li>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </ul>

        <div class="sidebar-section-title">Help & Policies</div>
        <ul>
            <?php $__currentLoopData = $policyLinks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $link): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <li class="<?php echo e($isFrontRoute('pagesdetails') && $currentPageSlug === $link['slug'] ? 'active' : ''); ?>">
                    <a href="<?php echo e(route('pagesdetails', ['slug' => $link['slug']])); ?>">
                        <i class="fa <?php echo e($link['icon']); ?>"></i>
                        <span class="sidebar-link-copy">
                            <strong><?php echo e($link['label']); ?></strong>
                        </span>
                    </a>
                </li>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </ul>

        <div class="sidebar-footer">
            <a class="sidebar-logout-link" href="#" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
                <i class="fa fa-sign-out"></i>
                <span>Logout</span>
            </a>
            <form id="logout-form" action="<?php echo e(route('studentslogout')); ?>" method="POST" class="d-none">
                <?php echo csrf_field(); ?>
            </form>
        </div>
    </div>
</div>
<?php /**PATH C:\xampp\htdocs\examproject\examproject_new\resources\views/include/frontheader.blade.php ENDPATH**/ ?>