<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve(['title' => $user->name . ' — Seller Profile','description' => $user->name . ' sells musical instruments on ' . config('app.name') . '.','image' => $user->avatar ? asset($user->avatar) : null] + (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, []); ?> 
        <div class="flex items-center space-x-4">
            <div class="w-16 h-16 bg-gray-300 rounded-full flex items-center justify-center">
                <span class="text-gray-600 font-semibold text-xl"><?php echo e(substr($user->name, 0, 1)); ?></span>
            </div>
            <div>
                <h2 class="font-semibold text-xl text-gray-800 leading-tight">
                    <?php echo e($user->name); ?>

                </h2>
                <p class="text-sm text-gray-600">
                    <?php if($user->rating > 0): ?>
                        ⭐ <?php echo e(number_format($user->rating, 1)); ?> (<?php echo e($user->total_reviews); ?> reviews)
                    <?php else: ?>
                        New seller
                    <?php endif; ?>
                    • Member since <?php echo e($stats['member_since']->format('M Y')); ?>

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

    <div class="py-12">
        <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
            <!-- User Stats -->
            <div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-8">
                <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                    <div class="p-6 text-center">
                        <div class="text-3xl font-bold text-blue-600"><?php echo e($stats['active_listings']); ?></div>
                        <div class="text-sm text-gray-600">Active Listings</div>
                    </div>
                </div>
                <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                    <div class="p-6 text-center">
                        <div class="text-3xl font-bold text-green-600"><?php echo e($stats['sold_items']); ?></div>
                        <div class="text-sm text-gray-600">Items Sold</div>
                    </div>
                </div>
                <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                    <div class="p-6 text-center">
                        <div class="text-3xl font-bold text-purple-600"><?php echo e($stats['total_listings']); ?></div>
                        <div class="text-sm text-gray-600">Total Listings</div>
                    </div>
                </div>
                <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                    <div class="p-6 text-center">
                        <?php if($user->rating > 0): ?>
                            <div class="text-3xl font-bold text-yellow-600"><?php echo e(number_format($user->rating, 1)); ?></div>
                            <div class="text-sm text-gray-600">Average Rating</div>
                        <?php else: ?>
                            <div class="text-3xl font-bold text-gray-400">--</div>
                            <div class="text-sm text-gray-600">No Ratings Yet</div>
                        <?php endif; ?>
                    </div>
                </div>
            </div>

            <!-- Trust Chain Display -->
            <?php if($user->verifiedTrustLinks->count() > 0): ?>
                <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg mb-8">
                    <div class="p-6">
                        <h3 class="text-lg font-semibold text-gray-900 mb-4">Verified Accounts</h3>
                        <div class="flex flex-wrap gap-3">
                            <?php $__currentLoopData = $user->verifiedTrustLinks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $link): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <a href="<?php echo e($link->remote_user_url); ?>" target="_blank" rel="noopener noreferrer" class="inline-flex items-center px-4 py-2 bg-green-50 border border-green-200 rounded-lg hover:bg-green-100 transition">
                                    <span class="text-green-600 mr-2">✓</span>
                                    <span class="text-gray-900 font-medium"><?php echo e($link->service->name); ?></span>
                                    <svg class="w-4 h-4 ml-2 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path>
                                    </svg>
                                </a>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    </div>
                </div>
            <?php elseif(!auth()->check()): ?>
                <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg mb-8">
                    <div class="p-6 text-center">
                        <p class="text-gray-600">🔒 Sign in to see <?php echo e($user->name); ?>'s verified trust chain</p>
                    </div>
                </div>
            <?php endif; ?>

            <!-- Contact Section -->
            <?php if(auth()->guard()->check()): ?>
                <?php if(auth()->id() !== $user->id): ?>
                    <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg mb-8">
                        <div class="p-6">
                            <h3 class="text-lg font-semibold text-gray-900 mb-4">Contact <?php echo e($user->name); ?></h3>
                            <div class="flex space-x-4">
                                <form method="POST" action="<?php echo e(route('messages.create-direct')); ?>">
                                    <?php echo csrf_field(); ?>
                                    <input type="hidden" name="recipient_id" value="<?php echo e($user->id); ?>">
                                    <button type="submit" 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">
                                        <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="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path>
                                        </svg>
                                        Send Message
                                    </button>
                                </form>
                                <a href="<?php echo e(route('reports.create', ['type' => 'user', 'id' => $user->id])); ?>" class="inline-flex items-center px-4 py-2 border border-red-300 rounded-md font-semibold text-xs text-red-700 bg-white hover:bg-red-50 transition ease-in-out duration-150">
                                    <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="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"></path>
                                    </svg>
                                    Report User
                                </a>
                            </div>
                        </div>
                    </div>
                <?php endif; ?>
            <?php else: ?>
                <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg mb-8">
                    <div class="p-6 text-center">
                        <p class="text-gray-600 mb-4">Sign in to contact this seller</p>
                        <a href="<?php echo e(route('login')); ?>" 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">
                            Sign In
                        </a>
                    </div>
                </div>
            <?php endif; ?>

            <!-- User's Listings -->
            <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                <div class="p-6">
                    <div class="flex justify-between items-center mb-6">
                        <h2 class="text-xl font-semibold text-gray-900"><?php echo e($user->name); ?>'s Listings</h2>
                        <span class="text-sm text-gray-500"><?php echo e($listings->total()); ?> <?php echo e(Str::plural('item', $listings->total())); ?></span>
                    </div>

                    <?php if($listings->count() > 0): ?>
                        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
                            <?php $__currentLoopData = $listings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="group border border-gray-200 rounded-lg overflow-hidden hover:shadow-lg transition-shadow">
                                    <a href="<?php echo e(route('items.show', $item)); ?>" class="block">
                                        <div class="aspect-square bg-gray-200 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 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; ?>
                                        </div>
                                        <div class="p-4">
                                            <h3 class="font-semibold text-gray-900 group-hover:text-blue-600 line-clamp-2 mb-2"><?php echo e($item->title); ?></h3>
                                            
                                            <div class="flex items-center justify-between mb-2">
                                                <?php if($item->price && in_array($item->listing_type, ['sale', 'inventory_open'])): ?>
                                                    <span class="font-bold text-lg text-gray-900">$<?php echo e(number_format($item->price, 2)); ?></span>
                                                <?php else: ?>
                                                    <span class="font-bold text-lg text-green-600">
                                                        <?php if($item->listing_type === 'trade'): ?>
                                                            Trade Only
                                                        <?php else: ?>
                                                            <?php echo e(ucfirst($item->listing_type)); ?>

                                                        <?php endif; ?>
                                                    </span>
                                                <?php endif; ?>
                                                
                                                <?php if($item->status === 'sale_pending'): ?>
                                                    <span class="bg-orange-100 text-orange-800 text-xs px-2 py-1 rounded-full">
                                                        Pending
                                                    </span>
                                                <?php endif; ?>
                                            </div>
                                            
                                            <div class="text-xs text-gray-500 space-y-1">
                                                <?php if($item->category): ?>
                                                    <div><?php echo e($item->category->name); ?></div>
                                                <?php endif; ?>
                                                <?php if($item->location_city || $item->location_state): ?>
                                                    <div><?php echo e(collect([$item->location_city, $item->location_state])->filter()->join(', ')); ?></div>
                                                <?php endif; ?>
                                                <div><?php echo e($item->created_at->diffForHumans()); ?></div>
                                            </div>
                                        </div>
                                    </a>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>

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

                            </div>
                        <?php endif; ?>
                    <?php else: ?>
                        <div class="text-center py-8">
                            <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="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2M4 13h2m13-4v6a2 2 0 01-2 2H7a2 2 0 01-2-2V9a2 2 0 012-2h10a2 2 0 012 2z"></path>
                            </svg>
                            <h3 class="mt-2 text-sm font-medium text-gray-900">No active listings</h3>
                            <p class="mt-1 text-sm text-gray-500"><?php echo e($user->name); ?> doesn't have any active listings at the moment.</p>
                        </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/users/public-profile.blade.php ENDPATH**/ ?>