<?php $__empty_1 = true; $__currentLoopData = $mediaItems; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<div class="group relative bg-slate-50 rounded-2xl border border-slate-100 overflow-hidden hover:border-brand-primary/30 transition-all duration-300" 
     data-media-id="<?php echo e($item->id); ?>" 
     data-media-url="<?php echo e($item->url); ?>"
     data-media-filename="<?php echo e($item->filename); ?>">
    <div class="aspect-square flex items-center justify-center p-4">
        <?php if(Str::startsWith($item->file_type, 'image/')): ?>
            <img src="<?php echo e($item->url); ?>" alt="<?php echo e($item->alt_text); ?>" class="max-w-full max-h-full object-contain group-hover:scale-110 transition-transform duration-500">
        <?php else: ?>
            <div class="flex flex-col items-center gap-2 text-slate-400">
                <svg class="w-12 h-12" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg>
                <span class="text-[10px] font-bold uppercase tracking-wider text-center px-2 truncate w-full"><?php echo e($item->filename); ?></span>
            </div>
        <?php endif; ?>
    </div>

    <!-- Actions Overlay -->
    <div class="absolute inset-0 bg-slate-900/60 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2">
        <?php if(Str::startsWith($item->file_type, 'image/')): ?>
        <button type="button" @click="openCropModal(<?php echo e($item->id); ?>, '<?php echo e($item->url); ?>')" class="p-2 bg-white text-brand-primary rounded-lg hover:bg-brand-primary hover:text-white transition shadow-sm" title="Crop/Edit">
            <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg>
        </button>
        <?php endif; ?>
        <button type="button" onclick="copyToClipboard('<?php echo e($item->url); ?>')" class="p-2 bg-white text-slate-900 rounded-lg hover:bg-brand-primary hover:text-white transition shadow-sm" title="Copy URL">
            <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"></path></svg>
        </button>
        <button type="button" onclick="window.dispatchEvent(new CustomEvent('delete-media', { detail: { id: <?php echo e($item->id); ?> } }))" class="p-2 bg-white text-red-500 rounded-lg hover:bg-red-500 hover:text-white transition shadow-sm" title="Delete">
            <svg class="w-4 h-4" 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>
        </button>
    </div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<div class="col-span-full py-12 text-center text-slate-400">
    <svg class="w-16 h-16 mx-auto mb-4 opacity-20" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" 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>
    <p>No media found. Start by uploading some files!</p>
</div>
<?php endif; ?>
<?php /**PATH C:\xampp\htdocs\ecs\resources\views/admin/media/partials/items.blade.php ENDPATH**/ ?>