<?php
    $stories = collect($visaStories ?? [])->filter(function ($story) {
        return !empty($story->title) || !empty($story->description) || !empty($story->student_name);
    })->values();

    $countryFilters = $stories
        ->pluck('country_name')
        ->filter()
        ->unique()
        ->values();
?>

<?php if($stories->count()): ?>
<section class="vss-global-section">
    <div class="public-shell">
        <div class="vss-global-head">
            <h2>Visa <span class="accent">Success</span> Stories</h2>
            <p>Real stories from successful students who achieved their dreams of studying abroad.</p>
        </div>

        <div class="vss-global-filters">
            <button type="button" class="vss-filter-btn is-active" data-vss-filter="all">All Countries</button>
            <?php $__currentLoopData = $countryFilters; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $countryName): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <button
                    type="button"
                    class="vss-filter-btn"
                    data-vss-filter="<?php echo e(\Illuminate\Support\Str::slug($countryName)); ?>"
                ><?php echo e($countryName); ?></button>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>

        <div class="vss-global-slider" data-vss-slider>
            <button type="button" class="vss-arrow vss-arrow-prev" data-vss-prev aria-label="Previous story">←</button>
            <button type="button" class="vss-arrow vss-arrow-next" data-vss-next aria-label="Next story">→</button>

            <div class="vss-slides-wrap">
                <?php $__currentLoopData = $stories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $story): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php
                        $countryName = $story->country_name ?: 'Unknown';
                        $studentName = $story->student_name ?: $story->title ?: 'Our Student';
                        $firstLine = trim((string) ($story->description ?: 'Visa and admission successfully completed with our support.'));
                        $imageUrl = $story->image_url ?? $story->image_path ?? '';
                    ?>
                    <article
                        class="vss-slide <?php echo e($loop->first ? 'is-active' : ''); ?>"
                        data-vss-slide
                        data-country="<?php echo e(\Illuminate\Support\Str::slug($countryName)); ?>"
                    >
                        <div class="vss-slide-media">
                            <?php if($imageUrl): ?>
                                <img src="<?php echo e($imageUrl); ?>" alt="<?php echo e($story->title ?: $studentName); ?>">
                            <?php endif; ?>
                        </div>
                        <div class="vss-slide-content">
                            <p class="vss-slide-copy">
                                Meet <span><?php echo e($studentName); ?></span>, <?php echo e($firstLine); ?>

                            </p>
                            <ul class="vss-slide-meta">
                                <?php if(!empty($story->university)): ?>
                                    <li><strong>University:</strong> <?php echo e($story->university); ?></li>
                                <?php endif; ?>
                                <li><strong>Country:</strong> <?php echo e($countryName); ?></li>
                                <?php if(!empty($story->program)): ?>
                                    <li><strong>Program:</strong> <?php echo e($story->program); ?></li>
                                <?php endif; ?>
                            </ul>
                            <a href="<?php echo e(route('success-stories')); ?>" class="vss-slide-link">See More Stories →</a>
                        </div>
                    </article>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>

            <div class="vss-dots" data-vss-dots></div>
        </div>
    </div>
</section>
<?php endif; ?>
<?php /**PATH C:\xampp\htdocs\gps-migration\resources\views\partials\visa-success-slider.blade.php ENDPATH**/ ?>