<?php $__env->startSection('content'); ?>
<?php
    $competitionSections = collect($competitionSections ?? []);
    $competitionTimeline = collect($competitionTimeline ?? []);
    $competitionCount = $competitionSections->sum(
        fn ($section) => count(data_get($section, 'cards', []))
    );
    $studentClassName = $studentsprofile->classname ?? 'Profile pending';
?>
<div class="jel-portal-page jel-dashboard-page">
    <?php if($bannerimages->count() > 0): ?>
        <div id="jelPortalBanner" class="carousel slide jel-portal-banner" data-bs-ride="carousel">
            <div class="carousel-indicators">
                <?php $__currentLoopData = $bannerimages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $bannerimagesdata): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <button
                        type="button"
                        data-bs-target="#jelPortalBanner"
                        data-bs-slide-to="<?php echo e($loop->index); ?>"
                        class="<?php echo \Illuminate\Support\Arr::toCssClasses(['active' => $loop->first]); ?>"
                        <?php if($loop->first): ?> aria-current="true" <?php endif; ?>
                    ></button>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>

            <div class="carousel-inner">
                <?php $__currentLoopData = $bannerimages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $bannerimagesdata): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="<?php echo \Illuminate\Support\Arr::toCssClasses(['carousel-item', 'active' => $loop->first]); ?>">
                        <img src="<?php echo e($bannerimagesdata->image_url); ?>" alt="<?php echo e($bannerimagesdata->bannrename); ?>" class="d-block w-100">
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>

            <button class="carousel-control-prev" type="button" data-bs-target="#jelPortalBanner" data-bs-slide="prev">
                <span class="carousel-control-prev-icon"></span>
            </button>
            <button class="carousel-control-next" type="button" data-bs-target="#jelPortalBanner" data-bs-slide="next">
                <span class="carousel-control-next-icon"></span>
            </button>
        </div>
    <?php endif; ?>

    <section class="jel-portal-hero">
        <div>
            <span class="jel-portal-kicker">Student Dashboard</span>
            <h1>Available scholarship exams ek jagah par.</h1>
            <p>
                Class-wise board pattern competitions ko quickly compare kijiye, prize pool samajhiye aur jis exam
                mein fit baithe uski details open kijiye.
            </p>
        </div>
        <div class="jel-portal-hero-panel">
            <article>
                <strong><?php echo e(count($competitionSections)); ?></strong>
                <span>Active Board Sections</span>
            </article>
            <article>
                <strong><?php echo e($competitionCount); ?></strong>
                <span>Open Competitions</span>
            </article>
            <article>
                <strong><?php echo e($studentClassName); ?></strong>
                <span>Current Profile Class</span>
            </article>
            <article>
                <strong>&#8377;<?php echo e(number_format((float) ($walletBalance ?? 0), 2)); ?></strong>
                <span>Current Wallet Balance</span>
            </article>
        </div>
    </section>

    <?php $__empty_1 = true; $__currentLoopData = $competitionSections; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $section): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
        <section class="jel-portal-board">
            <div class="jel-portal-board-head">
                <div>
                    <span class="jel-portal-kicker"><?php echo e($section['board']->showname); ?></span>
                    <h2><?php echo e($section['board']->showname); ?> Scholarship Exams</h2>
                </div>
                <span class="jel-portal-badge"><?php echo e(count($section['cards'])); ?> Active</span>
            </div>

            <div class="jel-portal-grid">
                <?php $__currentLoopData = $section['cards']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $card): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <article class="jel-portal-card">
                        <div class="jel-portal-card-top">
                            <span class="jel-portal-pill"><?php echo e($card['assignment']->groupclassname); ?></span>
                            <span class="jel-portal-price">&#8377;<?php echo e(number_format((float) $card['contest']->joinamt, 2)); ?></span>
                        </div>

                        <h3><?php echo e($card['contest']->contesttitile); ?></h3>
                        <p class="jel-portal-copy">
                            Join fee ke sath seats, dates aur prize structure check karke exam details open kijiye.
                        </p>

                        <div class="jel-portal-progress">
                            <div class="jel-portal-progress-bar">
                                <div class="jel-portal-progress-fill" style="width: <?php echo e($card['joined_percent']); ?>%"></div>
                            </div>
                            <div class="jel-portal-progress-meta">
                                <span><?php echo e(round($card['joined_percent'])); ?>% joined</span>
                                <span><?php echo e($card['remaining_seat']); ?> seats left</span>
                            </div>
                        </div>

                        <div class="jel-portal-meta-grid">
                            <div>
                                <span>Start Date</span>
                                <strong><?php echo e(optional($card['assignment']->startdate)->format('d M Y')); ?></strong>
                            </div>
                            <div>
                                <span>Last Date</span>
                                <strong><?php echo e(optional($card['assignment']->enddate)->format('d M Y')); ?></strong>
                            </div>
                            <div>
                                <span>Exam Date</span>
                                <strong><?php echo e(optional($card['assignment']->examdate)->format('d M Y')); ?></strong>
                            </div>
                            <div>
                                <span>Exam Time</span>
                                <strong>
                                    <?php echo e($card['assignment']->examendtime ? date('h:i A', strtotime((string) $card['assignment']->examendtime)) : '-'); ?>

                                </strong>
                            </div>
                        </div>

                        <div class="jel-portal-stat-row">
                            <div>
                                <small>1st Prize</small>
                                <strong>&#8377;<?php echo e(number_format((float) $card['first_prize'], 2)); ?></strong>
                            </div>
                            <div>
                                <small>Winning %</small>
                                <strong><?php echo e($card['contest']->winpertange); ?>%</strong>
                            </div>
                            <div>
                                <small>Last Rank</small>
                                <strong><?php echo e($card['last_rank'] ?? '-'); ?></strong>
                            </div>
                        </div>

                        <a class="jel-portal-button" href="<?php echo e($card['detail_url']); ?>">View Exam Details</a>
                    </article>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </section>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
        <section class="jel-portal-empty">
            <h2>No active scholarship exams available right now.</h2>
            <p>
                Abhi aapki class ke liye koi active competition open nahi hai. Profile, wallet aur previous competition
                timeline yahin se track kar sakte hain.
            </p>
            <div class="jel-empty-actions">
                <a class="jel-portal-button" href="<?php echo e(route('editprofile')); ?>">Update Profile</a>
                <a class="jel-portal-button jel-portal-button-muted" href="<?php echo e(route('scholershipresult')); ?>">Check Results</a>
            </div>
        </section>
    <?php endif; ?>

    <?php if($competitionTimeline->isNotEmpty()): ?>
        <section class="jel-portal-board">
            <div class="jel-portal-board-head">
                <div>
                    <span class="jel-portal-kicker">Competition Timeline</span>
                    <h2>Recent and upcoming competitions for your class</h2>
                </div>
                <span class="jel-portal-badge"><?php echo e($competitionTimeline->count()); ?> Records</span>
            </div>

            <div class="jel-portal-grid">
                <?php $__currentLoopData = $competitionTimeline; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $timelineCard): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <article class="jel-portal-card">
                        <div class="jel-portal-card-top">
                            <span class="jel-portal-pill"><?php echo e($timelineCard['assignment']->groupclassname); ?></span>
                            <span class="jel-status-badge jel-status-<?php echo e($timelineCard['status_tone']); ?>">
                                <?php echo e($timelineCard['status_label']); ?>

                            </span>
                        </div>

                        <h3><?php echo e($timelineCard['contest']->contesttitile); ?></h3>
                        <p class="jel-portal-copy"><?php echo e($timelineCard['status_copy']); ?></p>

                        <div class="jel-portal-meta-grid">
                            <div>
                                <span>Board</span>
                                <strong><?php echo e($timelineCard['assignment']->board?->showname ?? 'Board not linked'); ?></strong>
                            </div>
                            <div>
                                <span>Join Amount</span>
                                <strong>&#8377;<?php echo e(number_format((float) $timelineCard['contest']->joinamt, 2)); ?></strong>
                            </div>
                            <div>
                                <span>Exam Date</span>
                                <strong><?php echo e(optional($timelineCard['assignment']->examdate)->format('d M Y') ?: '-'); ?></strong>
                            </div>
                            <div>
                                <span>Result Date</span>
                                <strong><?php echo e(optional($timelineCard['assignment']->resultdate)->format('d M Y') ?: '-'); ?></strong>
                            </div>
                        </div>

                        <div class="jel-portal-stat-row">
                            <div>
                                <small>1st Prize</small>
                                <strong>&#8377;<?php echo e(number_format((float) $timelineCard['first_prize'], 2)); ?></strong>
                            </div>
                            <div>
                                <small>Winning %</small>
                                <strong><?php echo e($timelineCard['contest']->winpertange); ?>%</strong>
                            </div>
                            <div>
                                <small>Last Rank</small>
                                <strong><?php echo e($timelineCard['last_rank'] ?? '-'); ?></strong>
                            </div>
                        </div>

                        <a class="jel-portal-button" href="<?php echo e($timelineCard['detail_url']); ?>">Open Competition Details</a>
                    </article>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </section>
    <?php endif; ?>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.front', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\examproject\examproject_new\resources\views/front/competitionlist.blade.php ENDPATH**/ ?>