<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    <div class="min-h-screen bg-gray-50">
        <!-- Hero Section -->
        <div class="bg-white border-b border-gray-200">
            <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 md:py-12 pt-24 md:pt-32 lg:pt-36">
                <!-- Welcome Message -->
                <div class="text-center mb-8">
                    <h1 class="text-3xl md:text-4xl font-bold text-gray-900 mb-3">
                        <?php if(auth()->guard()->guest()): ?>
                            Buy and Sell with no fees
                        <?php else: ?>
                            Welcome back, <?php echo e(auth()->user()->name); ?>!
                        <?php endif; ?>
                    </h1>
                    <p class="text-lg text-gray-600 max-w-2xl mx-auto">
                        <?php if(auth()->guard()->guest()): ?>
                            Person to person sales of great gear
                        <?php else: ?>
                            Check out the latest listings and find your next great deal
                        <?php endif; ?>
                    </p>
                </div>

                <!-- Quick Actions -->
                <?php if(auth()->guard()->check()): ?>
                    <div class="flex justify-center mb-8">
                        <a href="<?php echo e(route('my-items.create')); ?>" class="px-8 py-3 bg-green-600 text-white font-semibold rounded-lg hover:bg-green-700 transition-colors text-center">
                            List Something
                        </a>
                    </div>
                <?php endif; ?>

            </div>
        </div>

        <!-- Featured Items Section -->
        <?php if($featuredItems->count() > 0): ?>
            <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
                <div class="flex items-center justify-between mb-6">
                    <h2 class="text-2xl font-bold text-gray-900">Featured Items</h2>
                    <div class="flex items-center text-sm text-gray-500">
                        <svg class="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 20 20">
                            <path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
                        </svg>
                        Featured
                    </div>
                </div>
                
                <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-8">
                    <?php $__currentLoopData = $featuredItems; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="bg-white rounded-lg shadow-sm overflow-hidden hover:shadow-md transition-shadow duration-200">
                            <a href="<?php echo e(route('items.show', $item)); ?>" class="block">
                                <div class="aspect-square bg-gray-100 relative overflow-hidden">
                                    <?php if($item->primaryPhoto): ?>
                                        <img src="<?php echo e(asset($item->primaryPhoto->url)); ?>" 
                                             alt="<?php echo e($item->title); ?>" 
                                             class="w-full h-full object-cover hover:scale-105 transition-transform duration-300">
                                    <?php else: ?>
                                        <div class="w-full h-full flex items-center justify-center">
                                            <svg class="w-12 h-12 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
                                            </svg>
                                        </div>
                                    <?php endif; ?>
                                    
                                    <!-- Featured Badge -->
                                    <div class="absolute top-2 left-2 bg-yellow-400 text-yellow-900 text-xs font-bold px-2 py-1 rounded">
                                        FEATURED
                                    </div>
                                    
                                    <!-- Vacation Mode Indicator -->
                                    <?php if($item->user->isOnVacation()): ?>
                                        <div class="absolute top-2 right-2 bg-orange-100 text-orange-800 text-xs font-medium px-2 py-1 rounded">
                                            On Vacation
                                        </div>
                                    <?php endif; ?>
                                    
                                    <!-- Status Badge -->
                                    <?php if($item->status === 'sale_pending'): ?>
                                        <div class="absolute bottom-2 left-2 bg-orange-500 text-white text-xs font-bold px-2 py-1 rounded">
                                            PENDING
                                        </div>
                                    <?php endif; ?>
                                </div>
                                
                                <div class="p-3">
                                    <h3 class="font-semibold text-gray-900 text-sm line-clamp-2 mb-1"><?php echo e($item->title); ?></h3>
                                    <div class="flex items-center justify-between">
                                        <?php if($item->price && $item->listing_type === 'sale'): ?>
                                            <span class="text-lg font-bold text-green-600">$<?php echo e(number_format($item->price, 0)); ?></span>
                                        <?php elseif($item->listing_type === 'inventory_open'): ?>
                                            <span class="text-sm font-medium text-blue-600">Open to Offers</span>
                                        <?php else: ?>
                                            <span class="text-sm font-medium text-gray-500">Trade</span>
                                        <?php endif; ?>
                                        
                                        <?php if($item->watchers_count > 0): ?>
                                            <div class="flex items-center text-xs text-gray-500">
                                                <svg class="w-3 h-3 mr-1" fill="currentColor" viewBox="0 0 20 20">
                                                    <path d="M3.172 5.172a4 4 0 015.656 0L10 6.343l1.172-1.171a4 4 0 115.656 5.656L10 17.657l-6.828-6.829a4 4 0 010-5.656z"></path>
                                                </svg>
                                                <?php echo e($item->watchers_count); ?>

                                            </div>
                                        <?php endif; ?>
                                    </div>
                                    
                                    <!-- Category -->
                                    <?php if($item->category): ?>
                                        <div class="text-xs text-gray-500 mt-1"><?php echo e($item->category->name); ?></div>
                                    <?php endif; ?>
                                </div>
                            </a>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            </div>
        <?php endif; ?>

        <!-- Recent Items Section -->
        <?php if($recentItems->count() > 0): ?>
            <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
                <div class="flex items-center justify-between mb-6">
                    <h2 class="text-2xl font-bold text-gray-900">Latest Listings</h2>
                    <a href="<?php echo e(route('items.index')); ?>" class="text-blue-600 hover:text-blue-700 font-medium text-sm">
                        View All →
                    </a>
                </div>
                
                <!-- First set of items (3-4 rows) -->
                <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-4 mb-12">
                    <?php $__currentLoopData = $recentItems->take(12); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="bg-white rounded-lg shadow-sm overflow-hidden hover:shadow-md transition-shadow duration-200">
                            <a href="<?php echo e(route('items.show', $item)); ?>" class="block">
                                <div class="aspect-square bg-gray-100 relative overflow-hidden">
                                    <?php if($item->primaryPhoto): ?>
                                        <img src="<?php echo e(asset($item->primaryPhoto->url)); ?>" 
                                             alt="<?php echo e($item->title); ?>" 
                                             class="w-full h-full object-cover hover:scale-105 transition-transform duration-300">
                                    <?php else: ?>
                                        <div class="w-full h-full flex items-center justify-center">
                                            <svg class="w-8 h-8 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
                                            </svg>
                                        </div>
                                    <?php endif; ?>
                                    
                                    <!-- Vacation Mode Indicator -->
                                    <?php if($item->user->isOnVacation()): ?>
                                        <div class="absolute top-2 right-2 bg-orange-100 text-orange-800 text-xs font-medium px-2 py-1 rounded">
                                            Vacation
                                        </div>
                                    <?php endif; ?>
                                    
                                    <!-- Status Badge -->
                                    <?php if($item->status === 'sale_pending'): ?>
                                        <div class="absolute bottom-2 left-2 bg-orange-500 text-white text-xs font-bold px-2 py-1 rounded">
                                            PENDING
                                        </div>
                                    <?php endif; ?>
                                    
                                    <!-- New Badge for items less than 3 days old -->
                                    <?php if($item->created_at->diffInDays() < 3): ?>
                                        <div class="absolute top-2 left-2 bg-green-500 text-white text-xs font-bold px-2 py-1 rounded">
                                            NEW
                                        </div>
                                    <?php endif; ?>
                                </div>
                                
                                <div class="p-3">
                                    <h3 class="font-semibold text-gray-900 text-sm line-clamp-2 mb-1"><?php echo e($item->title); ?></h3>
                                    <div class="flex items-center justify-between mb-1">
                                        <?php if($item->price && $item->listing_type === 'sale'): ?>
                                            <span class="text-lg font-bold text-green-600">$<?php echo e(number_format($item->price, 0)); ?></span>
                                        <?php elseif($item->listing_type === 'inventory_open'): ?>
                                            <span class="text-sm font-medium text-blue-600">Offers</span>
                                        <?php else: ?>
                                            <span class="text-sm font-medium text-gray-500">Trade</span>
                                        <?php endif; ?>
                                        
                                        <?php if($item->watchers_count > 0): ?>
                                            <div class="flex items-center text-xs text-gray-500">
                                                <svg class="w-3 h-3 mr-1" fill="currentColor" viewBox="0 0 20 20">
                                                    <path d="M3.172 5.172a4 4 0 015.656 0L10 6.343l1.172-1.171a4 4 0 115.656 5.656L10 17.657l-6.828-6.829a4 4 0 010-5.656z"></path>
                                                </svg>
                                                <?php echo e($item->watchers_count); ?>

                                            </div>
                                        <?php endif; ?>
                                    </div>
                                    
                                    <!-- Category and Seller -->
                                    <div class="flex items-center justify-between text-xs text-gray-500">
                                        <?php if($item->category): ?>
                                            <span><?php echo e($item->category->name); ?></span>
                                        <?php endif; ?>
                                        <span><?php echo e($item->created_at->diffForHumans()); ?></span>
                                    </div>
                                </div>
                            </a>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>

                <!-- Popular Categories Section -->
                <?php if($popularCategories->count() > 0): ?>
                    <div class="bg-white rounded-lg p-6 mb-12 shadow-sm">
                        <h3 class="text-xl font-bold text-gray-900 mb-4 text-center">Shop by Category</h3>
                        <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3">
                            <?php $__currentLoopData = $popularCategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <a href="<?php echo e(route('categories.show', $category)); ?>" class="block p-4 bg-gray-50 rounded-lg text-center hover:bg-gray-100 transition-colors">
                                    <div class="font-semibold text-gray-900 text-sm mb-1"><?php echo e($category->name); ?></div>
                                    <div class="text-xs text-gray-500"><?php echo e(number_format($category->items_count)); ?> items</div>
                                </a>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    </div>
                <?php endif; ?>

                <!-- Remaining items -->
                <?php if($recentItems->count() > 12): ?>
                    <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-4">
                        <?php $__currentLoopData = $recentItems->skip(12); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="bg-white rounded-lg shadow-sm overflow-hidden hover:shadow-md transition-shadow duration-200">
                                <a href="<?php echo e(route('items.show', $item)); ?>" class="block">
                                    <div class="aspect-square bg-gray-100 relative overflow-hidden">
                                        <?php if($item->primaryPhoto): ?>
                                            <img src="<?php echo e(asset($item->primaryPhoto->url)); ?>" 
                                                 alt="<?php echo e($item->title); ?>" 
                                                 class="w-full h-full object-cover hover:scale-105 transition-transform duration-300">
                                        <?php else: ?>
                                            <div class="w-full h-full flex items-center justify-center">
                                                <svg class="w-8 h-8 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
                                                </svg>
                                            </div>
                                        <?php endif; ?>
                                        
                                        <!-- Vacation Mode Indicator -->
                                        <?php if($item->user->isOnVacation()): ?>
                                            <div class="absolute top-2 right-2 bg-orange-100 text-orange-800 text-xs font-medium px-2 py-1 rounded">
                                                Vacation
                                            </div>
                                        <?php endif; ?>
                                        
                                        <!-- Status Badge -->
                                        <?php if($item->status === 'sale_pending'): ?>
                                            <div class="absolute bottom-2 left-2 bg-orange-500 text-white text-xs font-bold px-2 py-1 rounded">
                                                PENDING
                                            </div>
                                        <?php endif; ?>
                                        
                                        <!-- New Badge for items less than 3 days old -->
                                        <?php if($item->created_at->diffInDays() < 3): ?>
                                            <div class="absolute top-2 left-2 bg-green-500 text-white text-xs font-bold px-2 py-1 rounded">
                                                NEW
                                            </div>
                                        <?php endif; ?>
                                    </div>
                                    
                                    <div class="p-3">
                                        <h3 class="font-semibold text-gray-900 text-sm line-clamp-2 mb-1"><?php echo e($item->title); ?></h3>
                                        <div class="flex items-center justify-between mb-1">
                                            <?php if($item->price && $item->listing_type === 'sale'): ?>
                                                <span class="text-lg font-bold text-green-600">$<?php echo e(number_format($item->price, 0)); ?></span>
                                            <?php elseif($item->listing_type === 'inventory_open'): ?>
                                                <span class="text-sm font-medium text-blue-600">Offers</span>
                                            <?php else: ?>
                                                <span class="text-sm font-medium text-gray-500">Trade</span>
                                            <?php endif; ?>
                                            
                                            <?php if($item->watchers_count > 0): ?>
                                                <div class="flex items-center text-xs text-gray-500">
                                                    <svg class="w-3 h-3 mr-1" fill="currentColor" viewBox="0 0 20 20">
                                                        <path d="M3.172 5.172a4 4 0 015.656 0L10 6.343l1.172-1.171a4 4 0 115.656 5.656L10 17.657l-6.828-6.829a4 4 0 010-5.656z"></path>
                                                    </svg>
                                                    <?php echo e($item->watchers_count); ?>

                                                </div>
                                            <?php endif; ?>
                                        </div>
                                        
                                        <!-- Category and Seller -->
                                        <div class="flex items-center justify-between text-xs text-gray-500">
                                            <?php if($item->category): ?>
                                                <span><?php echo e($item->category->name); ?></span>
                                            <?php endif; ?>
                                            <span><?php echo e($item->created_at->diffForHumans()); ?></span>
                                        </div>
                                    </div>
                                </a>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                <?php endif; ?>
                
                <!-- Load More Button -->
                <div class="text-center mt-8">
                    <a href="<?php echo e(route('items.index')); ?>" class="inline-flex items-center px-6 py-3 border border-gray-300 text-gray-700 font-medium rounded-lg hover:bg-gray-50 transition-colors">
                        <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
                        </svg>
                        View More Items
                    </a>
                </div>
            </div>
        <?php endif; ?>

        <!-- Empty State -->
        <?php if($recentItems->count() === 0 && $featuredItems->count() === 0): ?>
            <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-16">
                <div class="text-center">
                    <div class="mb-8">
                        <svg class="mx-auto h-24 w-24 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"></path>
                        </svg>
                    </div>
                    <h3 class="text-2xl font-bold text-gray-900 mb-4">No Items Yet</h3>
                    <p class="text-gray-600 mb-8 max-w-md mx-auto">
                        Be the first to list something amazing! Our marketplace is just getting started.
                    </p>
                    
                    <?php if(auth()->guard()->check()): ?>
                        <a href="<?php echo e(route('my-items.create')); ?>" class="inline-flex items-center px-6 py-3 bg-green-600 text-white font-semibold rounded-lg hover:bg-green-700 transition-colors">
                            <svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path>
                            </svg>
                            List Your First Item
                        </a>
                    <?php else: ?>
                        <a href="<?php echo e(route('register')); ?>" class="inline-flex items-center px-6 py-3 bg-blue-600 text-white font-semibold rounded-lg hover:bg-blue-700 transition-colors">
                            <svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z"></path>
                            </svg>
                            Join the Marketplace
                        </a>
                    <?php endif; ?>
                </div>
            </div>
        <?php endif; ?>
    </div>

    <style>
    .line-clamp-2 {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* Enhanced mobile touch targets */
    @media (max-width: 768px) {
        .grid-cols-2 > * {
            min-height: 200px;
        }
    }
    
    /* Smooth hover animations */
    .hover\:scale-105:hover {
        transform: scale(1.05);
    }
    
    /* Card shadow improvements */
    .shadow-sm {
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    }
    
    .shadow-md {
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }
    </style>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?><?php /**PATH /var/www/html/resources/views/marketplace/index.blade.php ENDPATH**/ ?>