

<?php $__env->startSection('title', 'Scholarships'); ?>

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

    <?php echo $__env->make('layouts.partials.page_header', [
        'title' => 'Scholarships',
        'breadcrumbs' => [
            ['label' => 'Home', 'url' => route('home')],
            ['label' => 'Scholarships', 'url' => '']
        ]
    ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
    <!--Course Grid Start (Scholarships)-->
    <section class="course-grid">
        <div class="container">
            <div class="row">
                <!-- Sidebar Filters -->
                <div class="col-xl-4 col-lg-5">
                    <form action="<?php echo e(route('scholarships.index')); ?>" method="GET" id="filterForm">
                        <div class="course-grid__left">
                            <div class="course-grid__sidebar">

                                <!-- Search -->
                                <div class="course-grid__search course-grid__single">
                                    <div class="course-grid__title-box">
                                        <h3 class="course-grid__title">Search Scholarships</h3>
                                        <div class="course-grid__title-shape-1">
                                            <img src="<?php echo e(asset('assets/images/shapes/course-grid-title-shape-1.png')); ?>"
                                                 alt="">
                                        </div>
                                    </div>
                                    <div class="course-grid__search-text">
                                        Find your dream scholarship
                                    </div>

                                    <div class="course-grid__search-form">
                                        <input type="search" name="search" class="form-control"
                                               placeholder="Search by title or university"
                                               value="<?php echo e(request('search')); ?>">
                                        <button type="submit" class="thm-btn"><i class="icon-search"></i>Search</button>
                                    </div>
                                </div>

                                <!-- Price Filter (Amount) -->
                                <div class="course-grid__price-filter course-grid__single">
                                    <div class="course-grid__title-box">
                                        <h3 class="course-grid__title">Amount Filter</h3>
                                        <div class="course-grid__title-shape-1">
                                            <img src="<?php echo e(asset('assets/images/shapes/course-grid-title-shape-1.png')); ?>"
                                                 alt="">
                                        </div>
                                    </div>
                                    <div class="course-grid__price-filter-free-and-paid-course">
                                        <label class="custom-radio">
                                            <input type="radio" name="amount_type" value="all" checked>
                                            <span class="radio-dot"></span>
                                            <span class="radio-text">All Scholarships</span>
                                        </label>
                                        <label class="custom-radio">
                                            <input type="radio" name="amount_type"
                                                   value="paid" <?php echo e(request('amount_type') == 'paid' ? 'checked' : ''); ?>>
                                            <span class="radio-dot"></span>
                                            <span class="radio-text">With Stipend</span>
                                        </label>
                                    </div>
                                    <div class="course-grid__price-filter-ranger">
                                        <p class="course-grid__price-filter-title">Amount: €<?php echo e($currentMin); ?> -
                                            €<?php echo e($currentMax); ?></p>
                                        <div class="price-ranger">
                                            <div id="slider-range"></div>
                                            <div class="ranger-min-max-block">
                                                <input type="text" readonly class="min" value="<?php echo e($currentMin); ?>">
                                                <span>-</span>
                                                <input type="text" readonly class="max" value="<?php echo e($currentMax); ?>">
                                                <input type="hidden" name="amount_min" id="amount_min"
                                                       value="<?php echo e($currentMin); ?>">
                                                <input type="hidden" name="amount_max" id="amount_max"
                                                       value="<?php echo e($currentMax); ?>">
                                                <button type="submit" class="thm-btn">Apply</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <!-- Country Filter -->
                                <div class="course-grid__categories course-grid__single">
                                    <div class="course-grid__title-box">
                                        <h3 class="course-grid__title">Country</h3>
                                        <div class="course-grid__title-shape-1">
                                            <img src="<?php echo e(asset('assets/images/shapes/course-grid-title-shape-1.png')); ?>"
                                                 alt="">
                                        </div>
                                    </div>
                                    <div class="course-grid__list-item">
                                        <div class="select-box">
                                            <select name="country" class="wide" onchange="this.form.submit()">
                                                <option value="">All Countries</option>
                                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $countries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $country): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoopIteration(); ?><?php endif; ?>
                                                    <option
                                                        value="<?php echo e($country->id); ?>" <?php echo e(request('country') == $country->id ? 'selected' : ''); ?>><?php echo e($country->name); ?></option>
                                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                                            </select>
                                        </div>
                                    </div>
                                </div>

                                <!-- Program Level Filter -->
                                <div class="course-grid__skill course-grid__single">
                                    <div class="course-grid__title-box">
                                        <h3 class="course-grid__title">Program Level</h3>
                                        <div class="course-grid__title-shape-1">
                                            <img src="<?php echo e(asset('assets/images/shapes/course-grid-title-shape-1.png')); ?>"
                                                 alt="">
                                        </div>
                                    </div>
                                    <ul class="list-unstyled course-grid__list-item">
                                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $levels; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoopIteration(); ?><?php endif; ?>
                                            <li>
                                                <label class="custom-checkbox">
                                                    <input type="radio" name="level" value="<?php echo e($value); ?>"
                                                           <?php echo e(request('level') == $value ? 'checked' : ''); ?>

                                                           onchange="this.form.submit()">
                                                    <span class="checkmark"></span>
                                                    <span class="radio-text"><?php echo e($label); ?></span>
                                                </label>
                                            </li>
                                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                                    </ul>
                                </div>

                                <!-- Discount Banner (static) -->
                                <div class="course-grid__discount course-grid__single">
                                    <div class="course-grid__discount-shape-bg"
                                         style="background-image: url(<?php echo e(asset('assets/images/shapes/course-grid-discount-shape-bg.png')); ?>);"></div>
                                    <h4 class="course-grid__discount-title">Free Consultation</h4>
                                    <p class="course-grid__discount-text">Get expert advice for your scholarship
                                        application</p>
                                    <div class="course-grid__discount-img">
                                        <img src="<?php echo e(asset('assets/images/resources/course-grid-discount-img-1.png')); ?>"
                                             alt="">
                                    </div>
                                    <div class="course-grid__discount-coupon">
                                        <a href="<?php echo e(route('contact')); ?>" class="thm-btn">Contact Us</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>

                <!-- Main Content Grid -->
                <div class="col-xl-8 col-lg-7">
                    <div class="course-grid__right">
                        <!-- Top Bar -->
                        <div class="course-list__right-top">
                            <p class="course-list__right-top-text">
                                Showing <?php echo e($scholarships->firstItem() ?? 0); ?> – <?php echo e($scholarships->lastItem() ?? 0); ?>

                                of <?php echo e($scholarships->total()); ?> scholarships
                            </p>
                            <div class="course-list__showing-sort">
                                <p>Sort by: </p>
                                <div class="select-box">
                                    <select class="wide" id="sortSelect" onchange="updateSort(this.value)">
                                        <option
                                            value="deadline-asc" <?php echo e(request('sort') == 'deadline' && request('direction') == 'asc' ? 'selected' : ''); ?>>
                                            Deadline (soonest)
                                        </option>
                                        <option
                                            value="amount-desc" <?php echo e(request('sort') == 'amount' && request('direction') == 'desc' ? 'selected' : ''); ?>>
                                            Amount (highest)
                                        </option>
                                        <option
                                            value="title-asc" <?php echo e(request('sort') == 'title' && request('direction') == 'asc' ? 'selected' : ''); ?>>
                                            Title A-Z
                                        </option>
                                    </select>
                                </div>
                            </div>
                        </div>

                        <!-- Scholarships Grid -->
                        <div class="course-grid__right-content-box">
                            <div class="row">
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $scholarships; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $scholarship): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoopIteration(); ?><?php endif; ?>
                                    <div class="col-xl-6">
                                        <div class="courses-two__single">
                                            <div class="courses-two__img-box">
                                                <div class="courses-two__img">
                                                    <img
                                                        src="<?php echo e($scholarship->university->logo_path ? asset('storage/'.$scholarship->university->logo_path) : asset('assets/images/resources/courses-2-1.jpg')); ?>"
                                                        alt="<?php echo e($scholarship->title); ?>">
                                                </div>
                                                <div class="courses-two__heart">
                                                    <a href="<?php echo e(route('scholarships.show', $scholarship->slug)); ?>"><span
                                                            class="icon-heart"></span></a>
                                                </div>
                                            </div>
                                            <div class="courses-two__content">
                                                <div class="courses-two__doller-and-review">
                                                    <div class="courses-two__doller">
                                                        <p>€<?php echo e(number_format($scholarship->amount)); ?></p>
                                                    </div>
                                                    <div class="courses-two__review">
                                                        <p><i class="icon-star"></i> <?php echo e($scholarship->program_level); ?>

                                                        </p>
                                                    </div>
                                                </div>
                                                <h3 class="courses-two__title"><a
                                                        href="<?php echo e(route('scholarships.show', $scholarship->slug)); ?>"><?php echo e($scholarship->title); ?></a>
                                                </h3>
                                                <div class="courses-two__btn-and-client-box">
                                                    <div class="courses-two__btn-box">
                                                        <a href="<?php echo e(route('scholarships.show', $scholarship->slug)); ?>"
                                                           class="thm-btn-two">
                                                            <span>Apply Now</span>
                                                            <i class="icon-angles-right"></i>
                                                        </a>
                                                    </div>
                                                    <div class="courses-two__client-box">
                                                        <div class="courses-two__client-img">
                                                            <img
                                                                src="<?php echo e($scholarship->country->flag_path ? asset('storage/'.$scholarship->country->flag_path) : asset('assets/images/resources/courses-two-client-img-1.jpg')); ?>"
                                                                alt="">
                                                        </div>
                                                        <div class="courses-two__client-content">
                                                            <h4><?php echo e($scholarship->country->name); ?></h4>
                                                            <p>
                                                                Deadline: <?php echo e($scholarship->deadline->format('M d, Y')); ?></p>
                                                        </div>
                                                    </div>
                                                </div>
                                                <ul class="courses-two__meta list-unstyled">
                                                    <li>
                                                        <div class="icon"><span class="icon-chart-simple"></span></div>
                                                        <p><?php echo e(ucfirst($scholarship->program_level)); ?></p>
                                                    </li>
                                                    <li>
                                                        <div class="icon"><span class="icon-book"></span></div>
                                                        <p><?php echo e($scholarship->university->name ?? 'University'); ?></p>
                                                    </li>
                                                    <li>
                                                        <div class="icon"><span class="icon-clock"></span></div>
                                                        <p><?php echo e($scholarship->deadline->diffForHumans()); ?></p>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                                    <div class="col-12 text-center py-5">
                                        <h4>No scholarships found.</h4>
                                    </div>
                                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            </div>
                        </div>

                        <!-- Pagination -->
                        <div class="blog-list__pagination">
                            <?php echo e($scholarships->appends(request()->except('page'))->links('vendor.pagination.custom')); ?>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!--Course Grid End-->

    <!-- Newsletter Two Start -->
    <section class="newsletter-two">
        <div class="container">
            <div class="newsletter-two__inner">
                <div class="newsletter-two__img">
                    <img src="<?php echo e(asset('assets/images/resources/newsletter-two-img-1.png')); ?>" alt="">
                </div>
                <div class="newsletter-two__inner-content">
                    <div class="newsletter-two__shape-bg"
                         style="background-image: url(<?php echo e(asset('assets/images/shapes/newsletter-two-shape-bg.png')); ?>);"></div>
                    <div class="newsletter-two__like"><img
                            src="<?php echo e(asset('assets/images/shapes/newsletter-two-like.png')); ?>" alt=""></div>
                    <div class="newsletter-two__title-box">
                        <h3 class="newsletter-two__title">Subscribe our <span>Newsletter</span></h3>
                        <p class="newsletter-two__text">Get scholarship updates directly in your inbox.</p>
                    </div>
                    <div class="newsletter-two__form-box">
                        <form class="newsletter-two__form" action="<?php echo e(route('newsletter.subscribe')); ?>" method="post">
                            <?php echo csrf_field(); ?>
                            <div class="newsletter-two__input">
                                <input type="email" name="email" placeholder="Enter Your Email" required>
                            </div>
                            <button type="submit" class="newsletter-two__btn"><span class="icon-arrow-circle"></span>Subscribe
                            </button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!--Newsletter Two End -->

    <!--Contact Info One Start (reuse from template) -->
    <section class="contact-info-one">
        <div class="container">
            <ul class="list-unstyled contact-info-one__list">
                <li>
                    <div class="contact-info-one__single">
                        <div class="contact-info-one__icon"><span class="icon-envelope"></span></div>
                        <div class="contact-info-one__content">
                            <p class="contact-info-one__sub-title">Email Address:</p>
                            <h5 class="contact-info-one__email"><a
                                    href="mailto:<?php echo e(\App\Models\Setting::getValue('contact_email', 'info@scholarhub.com')); ?>"><?php echo e(\App\Models\Setting::getValue('contact_email', 'info@scholarhub.com')); ?></a>
                            </h5>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="contact-info-one__single">
                        <div class="contact-info-one__icon"><span class="icon-phone"></span></div>
                        <div class="contact-info-one__content">
                            <p class="contact-info-one__sub-title">Phone Number</p>
                            <h5 class="contact-info-one__email"><a
                                    href="tel:<?php echo e(\App\Models\Setting::getValue('contact_phone', '+123456789')); ?>"><?php echo e(\App\Models\Setting::getValue('contact_phone', '+12 (123) 456 78900')); ?></a>
                            </h5>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="contact-info-one__single">
                        <div class="contact-info-one__icon"><span class="icon-location"></span></div>
                        <div class="contact-info-one__content">
                            <p class="contact-info-one__sub-title">Our Address</p>
                            <h5 class="contact-info-one__email"><?php echo e(\App\Models\Setting::getValue('address', '123 Scholar Street')); ?></h5>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </section>
    <!--Contact Info One End -->
<?php $__env->stopSection(); ?>

<?php $__env->startPush('scripts'); ?>
    <script>
        // Initialize jQuery UI slider for price range
        $(function () {
            $("#slider-range").slider({
                range: true,
                min: <?php echo e($minAmount); ?>,
                max: <?php echo e($maxAmount); ?>,
                values: [<?php echo e($currentMin); ?>, <?php echo e($currentMax); ?>],
                slide: function (event, ui) {
                    $(".min").val(ui.values[0]);
                    $(".max").val(ui.values[1]);
                    $("#amount_min").val(ui.values[0]);
                    $("#amount_max").val(ui.values[1]);
                    $(".course-grid__price-filter-title").text("Amount: €" + ui.values[0] + " - €" + ui.values[1]);
                }
            });
            $(".min").val($("#slider-range").slider("values", 0));
            $(".max").val($("#slider-range").slider("values", 1));
            $("#amount_min").val($("#slider-range").slider("values", 0));
            $("#amount_max").val($("#slider-range").slider("values", 1));
        });

        // Sorting dropdown
        function updateSort(value) {
            var parts = value.split('-');
            var sort = parts[0];
            var direction = parts[1];
            var url = new URL(window.location.href);
            url.searchParams.set('sort', sort);
            url.searchParams.set('direction', direction);
            window.location.href = url.toString();
        }
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\Sasi\resources\views\scholarships\index.blade.php ENDPATH**/ ?>