<?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([]); ?>
     <?php $__env->slot('header', null, []); ?> 
        <h2 class="font-semibold text-xl text-gray-800 leading-tight">
            <?php echo e(__('My Watchlist')); ?>

        </h2>
     <?php $__env->endSlot(); ?>

    <div class="py-12">
        <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
            <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                <div class="p-6">
                    <?php if($watchlist->count() > 0): ?>
                        <div class="mb-6">
                            <p class="text-gray-600"><?php echo e($watchlist->total()); ?> items in your watchlist</p>
                        </div>

                        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
                            <?php $__currentLoopData = $watchlist; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $watch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="group border rounded-lg overflow-hidden hover:shadow-lg transition-shadow">
                                    <a href="<?php echo e(route('items.show', $watch->item)); ?>" class="block">
                                        <div class="aspect-square bg-gray-200 overflow-hidden relative">
                                            <?php if($watch->item->primaryPhoto): ?>
                                                <img src="<?php echo e(asset($watch->item->primaryPhoto->url)); ?>" alt="<?php echo e($watch->item->title); ?>" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-200">
                                            <?php else: ?>
                                                <div class="w-full h-full flex items-center justify-center">
                                                    <span class="text-gray-400">No Image</span>
                                                </div>
                                            <?php endif; ?>
                                            
                                            <!-- Status Badge -->
                                            <?php if($watch->item->status === 'sale_pending'): ?>
                                                <div class="absolute top-2 left-2 bg-orange-500 text-white text-xs px-2 py-1 rounded">
                                                    Sale Pending
                                                </div>
                                            <?php endif; ?>
                                            
                                            <!-- Listing Type Badge -->
                                            <?php if($watch->item->listing_type === 'trade'): ?>
                                                <div class="absolute top-2 right-2 bg-green-500 text-white text-xs px-2 py-1 rounded">
                                                    Trade
                                                </div>
                                            <?php endif; ?>

                                            <!-- Watched Date -->
                                            <div class="absolute bottom-2 left-2 bg-black bg-opacity-75 text-white text-xs px-2 py-1 rounded">
                                                Added <?php echo e($watch->created_at->diffForHumans()); ?>

                                            </div>
                                        </div>
                                        
                                        <div class="p-4">
                                            <h3 class="font-semibold text-gray-900 group-hover:text-blue-600 line-clamp-2 mb-1"><?php echo e($watch->item->title); ?></h3>
                                            <?php if($watch->item->category): ?>
                                                <p class="text-sm text-gray-600 mb-1"><?php echo e($watch->item->category->name); ?></p>
                                            <?php endif; ?>
                                            
                                            <?php if($watch->item->price && $watch->item->listing_type === 'sale'): ?>
                                                <p class="font-bold text-lg text-gray-900">$<?php echo e(number_format($watch->item->price, 2)); ?></p>
                                            <?php else: ?>
                                                <p class="font-bold text-lg text-green-600">Trade Only</p>
                                            <?php endif; ?>
                                            
                                            <div class="flex items-center justify-between text-xs text-gray-500 mt-2">
                                                <span><?php echo e($watch->item->user->name); ?></span>
                                                <span><?php echo e($watch->item->created_at->diffForHumans()); ?></span>
                                            </div>
                                            
                                            <?php if($watch->item->location_city || $watch->item->location_state): ?>
                                                <p class="text-xs text-gray-500 mt-1">
                                                    <?php echo e(collect([$watch->item->location_city, $watch->item->location_state])->filter()->join(', ')); ?>

                                                </p>
                                            <?php endif; ?>
                                        </div>
                                    </a>
                                    
                                    <!-- Remove from watchlist button -->
                                    <div class="px-4 pb-4">
                                        <form method="POST" action="<?php echo e(route('items.watchlist.remove', $watch->item)); ?>" class="w-full">
                                            <?php echo csrf_field(); ?>
                                            <?php echo method_field('DELETE'); ?>
                                            <button type="submit" class="w-full inline-flex items-center justify-center px-3 py-2 bg-red-600 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-red-700 transition ease-in-out duration-150" onclick="return confirm('Remove this item from your watchlist?')">
                                                <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="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"></path>
                                                </svg>
                                                Remove
                                            </button>
                                        </form>
                                    </div>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>

                        <!-- Pagination -->
                        <div class="mt-8">
                            <?php echo e($watchlist->links()); ?>

                        </div>
                    <?php else: ?>
                        <div class="text-center py-12">
                            <svg class="mx-auto h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"></path>
                            </svg>
                            <h3 class="text-lg font-semibold text-gray-900 mb-2 mt-4">Your watchlist is empty</h3>
                            <p class="text-gray-600 mb-6">Start adding items you're interested in to keep track of them here.</p>
                            <a href="<?php echo e(route('items.index')); ?>" class="inline-flex items-center px-4 py-2 bg-blue-600 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-blue-700 transition ease-in-out duration-150">
                                Browse Items
                            </a>
                        </div>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>
 <?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/items/my-watchlist.blade.php ENDPATH**/ ?>