<?php $__env->startSection('title', ($siteName ?? 'Bursa Kerja') . ' - Lowongan Pekerjaan Terbaru'); ?>

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

<div class="bg-indigo-700 text-white py-10 sm:py-16">
    <div class="max-w-7xl mx-auto px-4 text-center">
        <h1 class="text-2xl sm:text-4xl font-bold mb-4 animate-fade-in-up">Temukan Pekerjaan Impianmu</h1>
        <p class="text-base sm:text-lg text-indigo-100 mb-8 animate-fade-in-up" style="animation-delay: 0.1s">Ribuan lowongan pekerjaan menunggu lamaranmu</p>

        
        <form action="<?php echo e(route('home')); ?>" method="GET" class="max-w-2xl mx-auto animate-fade-in-up" style="animation-delay: 0.2s">
            <div class="flex flex-col sm:flex-row bg-white rounded-xl overflow-hidden">
                <input type="text" name="search" value="<?php echo e(request('search')); ?>"
                    placeholder="Cari posisi, perusahaan, atau lokasi..."
                    class="flex-1 px-6 py-4 text-gray-700 focus:outline-none">
                <button type="submit" class="bg-indigo-800 text-white px-8 py-4 hover:outline hover:outline-2 hover:outline-indigo-900 font-medium">
                    Cari
                </button>
            </div>
            
            <div class="flex flex-wrap justify-center mt-4 gap-2">
                <a href="<?php echo e(route('home')); ?>"
                    class="filter-pill px-4 py-2 rounded-full text-sm font-medium <?php echo e(!request('type') ? 'bg-white text-indigo-800' : 'bg-indigo-500 text-white hover:outline hover:outline-2 hover:outline-indigo-300'); ?>">
                    Semua
                </a>
                <?php $__currentLoopData = ['Full-time', 'Part-time', 'Freelance', 'Internship']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $type): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <a href="<?php echo e(route('home', ['type' => $type, 'search' => request('search')])); ?>"
                    class="filter-pill px-4 py-2 rounded-full text-sm font-medium <?php echo e(request('type') === $type ? 'bg-white text-indigo-800' : 'bg-indigo-500 text-white hover:outline hover:outline-2 hover:outline-indigo-300'); ?>">
                    <?php echo e($type); ?>

                </a>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </form>
    </div>
</div>

<div class="max-w-7xl mx-auto px-4 py-8">
    
    <?php if($bannerTop): ?>
    <div class="ad-container ad-desktop">
        <div class="ad-label">Iklan</div>
        <div class="ad-content"><?php echo $bannerTop->code; ?></div>
    </div>
    <?php endif; ?>

    
    <?php if($mobileBanner): ?>
    <div class="ad-container ad-mobile">
        <div class="ad-label">Iklan</div>
        <div class="ad-content"><?php echo $mobileBanner->code; ?></div>
    </div>
    <?php endif; ?>

    
    <?php if($jobs->count() > 0): ?>
    <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mt-6">
        <?php $__currentLoopData = $jobs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $job): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="bg-indigo-600 rounded-xl border border-indigo-500 p-6 card-hover animate-stagger">
            <div class="flex items-start justify-between mb-3">
                <span class="inline-block px-3 py-1 text-xs font-medium rounded-full bg-white/20 text-white">
                    <?php echo e($job->type); ?>

                </span>
            </div>

            <h3 class="text-lg font-semibold text-white mb-1"><?php echo e($job->title); ?></h3>
            <p class="text-white/80 font-medium text-sm mb-2"><?php echo e($job->company); ?></p>
            <p class="text-white/70 text-sm mb-3 flex items-center">
                <svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"/>
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"/>
                </svg>
                <?php echo e($job->location); ?>

            </p>

            <div class="text-white font-semibold text-sm mb-4 flex items-center">
                <svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 6v12m-3-2.818l.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
                <?php echo e($job->formatted_salary); ?>

            </div>

            <p class="text-white/70 text-sm mb-4 line-clamp-2"><?php echo e(Str::limit(strip_tags($job->description), 100)); ?></p>

            <a href="<?php echo e(route('job.show', $job)); ?>"
                class="block text-center bg-indigo-800 text-white py-2.5 rounded-lg font-medium hover:outline hover:outline-2 hover:outline-white/50">
                Lihat Detail
            </a>

            <?php if($appliedJobIds->contains($job->id)): ?>
            <p class="mt-3 text-xs text-center text-white/90 bg-white/10 border border-white/20 rounded-lg px-3 py-2">
                Anda sudah melamar posisi ini
            </p>
            <?php endif; ?>
        </div>

        
        <?php if(($index + 1) % 2 === 0 && $nativeAd): ?>
        <div class="bg-white rounded-xl border border-gray-100 p-6 ad-container flex items-center justify-center">
            <div>
                <div class="ad-label">IKLAN</div>
                <div class="ad-content"><?php echo $nativeAd->code; ?></div>
            </div>
        </div>
        <?php endif; ?>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>

    
    <div class="mt-8">
        <?php echo e($jobs->appends(request()->query())->links('pagination')); ?>

    </div>
    <?php else: ?>
    <div class="text-center py-16 animate-fade-in">
        <svg class="w-16 h-16 mx-auto text-gray-300 mb-4" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"/></svg>
        <h3 class="text-xl font-semibold text-gray-700 mb-2">Tidak ada lowongan ditemukan</h3>
        <p class="text-gray-500">Coba ubah kata kunci pencarian Anda</p>
    </div>
    <?php endif; ?>

    
    <?php if($bannerBottom): ?>
    <div class="ad-container mt-8 ad-desktop">
        <div class="ad-label">Iklan</div>
        <div class="ad-content"><?php echo $bannerBottom->code; ?></div>
    </div>
    <?php endif; ?>

    
    <?php if($mobileBanner): ?>
    <div class="ad-container mt-8 ad-mobile">
        <div class="ad-label">Iklan</div>
        <div class="ad-content"><?php echo $mobileBanner->code; ?></div>
    </div>
    <?php endif; ?>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/bursakerja/resources/views/home.blade.php ENDPATH**/ ?>