<div>
    
    <div class="w-full flex items-center mb-8">
        <a href="<?php echo e(route('products.show', $product)); ?>"
            class="flex rounded-lg bg-white border border-gray-200 px-4 py-2 text-gray-700 hover:bg-gray-100 font-bold">
            <img src="<?php echo e(asset('vendor/blade-untitledui-icons/arrow-narrow-left.svg')); ?>" alt="Volver" class="w-6 h-6">
            <span class="ml-2">Volver</span>
        </a>
        <div class="ml-4 flex items-center text-sm text-gray-500">
            <a href="<?php echo e(route('products.features.index', $product)); ?>"
               class="text-orange-600 hover:text-orange-800">
                Versiones de Features
            </a>
            <span class="mx-2">/</span>
            <span class="text-gray-700 font-semibold">Versión <?php echo e($featureVersion->version); ?></span>
        </div>
    </div>

    
    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(session()->has('success')): ?>
        <div class="mb-4 rounded bg-green-100 px-4 py-2 text-green-700">
            <?php echo e(session('success')); ?>

        </div>
    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

    <?php if(session()->has('error')): ?>
        <div class="mb-4 rounded bg-red-100 px-4 py-2 text-red-700">
            <?php echo e(session('error')); ?>

        </div>
    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

    
    <div class="w-full flex flex-wrap items-center justify-between rounded-lg bg-white border border-gray-200 px-8 py-4 mb-6">
        <div class="w-full flex items-center justify-between">
            <div class="flex items-center gap-4">
                <div>
                    <h1 class="text-4xl font-bold">Versión <?php echo e($featureVersion->version); ?></h1>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($featureVersion->description): ?>
                        <p class="mt-2 text-gray-600"><?php echo e($featureVersion->description); ?></p>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    <div class="mt-2 text-sm text-gray-500">
                        <span>Creado por: <span class="font-semibold text-gray-700"><?php echo e($featureVersion->creator?->name ?? 'N/A'); ?></span></span>
                        <span class="mx-2">•</span>
                        <span>Fecha: <span class="font-semibold text-gray-700"><?php echo e($featureVersion->created_at->format('Y-m-d H:i')); ?></span></span>
                    </div>
                </div>
            </div>
            <div class="flex items-center gap-2">
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.features.version.create')): ?>
                <button wire:click="duplicateVersion"
                        wire:confirm="¿Seguro que deseas duplicar esta versión? Se creará una nueva versión con todas las features."
                        class="flex items-center rounded-lg bg-green-600 px-4 py-2 text-white hover:bg-green-700 font-semibold">
                    <img src="<?php echo e(asset('vendor/blade-untitledui-icons/copy.svg')); ?>" alt="Duplicar" class="w-5 h-5 mr-2 svg-fill-white">
                    Duplicar versión
                </button>
                <?php endif; ?>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.features.version.edit')): ?>
                <a href="<?php echo e(route('products.features.version.edit', [$product, $featureVersion])); ?>"
                   class="flex items-center rounded-lg bg-orange-600 px-4 py-2 text-white hover:bg-orange-700 font-semibold">
                    <img src="<?php echo e(asset('vendor/blade-untitledui-icons/pencil.svg')); ?>" alt="Editar" class="w-5 h-5 mr-2 svg-fill-white">
                    Editar versión
                </a>
                <?php endif; ?>
            </div>
        </div>
    </div>

    
    <div class="mb-6 flex items-center justify-between">
        <h2 class="text-2xl font-bold">Features (<?php echo e($features->count()); ?>)</h2>
        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.features.create')): ?>
        <a href="<?php echo e(route('products.features.create', [$product, $featureVersion])); ?>"
           class="flex items-center rounded-lg bg-orange-600 px-4 py-2 text-white hover:bg-orange-700 font-semibold">
            <img src="<?php echo e(asset('vendor/blade-untitledui-icons/plus.svg')); ?>" alt="Crear" class="w-5 h-5 mr-2 svg-fill-white">
            Crear feature
        </a>
        <?php endif; ?>
    </div>

    <div class="rounded-lg bg-white border border-gray-200 overflow-hidden">
        <div class="overflow-x-auto">
            <table class="min-w-full text-sm">
                <thead class="bg-gray-100 text-xs uppercase text-gray-600">
                <tr>
                    <th class="px-4 py-3 text-left">Orden</th>
                    <th class="px-4 py-3 text-left">Título</th>
                    <th class="px-4 py-3 text-left">Estado</th>
                    <th class="px-4 py-3 text-left">Creado por</th>
                    <th class="px-4 py-3 text-left">Fecha</th>
                    <th class="px-4 py-3 text-right">Acciones</th>
                </tr>
                </thead>

                <tbody class="divide-y">
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $features; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $feature): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr class="hover:bg-gray-50">
                        <td class="px-4 py-3">
                            <div class="flex items-center gap-2">
                                <button wire:click="moveUp(<?php echo e($feature->id); ?>)"
                                        class="text-gray-400 hover:text-gray-600 text-sm"
                                        title="Mover arriba">
                                    ↑
                                </button>
                                <span class="font-mono font-semibold"><?php echo e($feature->sort_order ?? '-'); ?></span>
                                <button wire:click="moveDown(<?php echo e($feature->id); ?>)"
                                        class="text-gray-400 hover:text-gray-600 text-sm"
                                        title="Mover abajo">
                                    ↓
                                </button>
                            </div>
                        </td>

                        <td class="px-4 py-3 font-semibold text-gray-900"><?php echo e($feature->title); ?></td>

                        <td class="px-4 py-3">
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($feature->status === 'published'): ?>
                                <span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-semibold bg-green-100 text-green-800">Publicado</span>
                            <?php elseif($feature->status === 'draft'): ?>
                                <span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-semibold bg-yellow-100 text-yellow-800">Borrador</span>
                            <?php else: ?>
                                <span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-semibold bg-gray-100 text-gray-800">Archivado</span>
                            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        </td>

                        <td class="px-4 py-3 text-gray-700"><?php echo e($feature->creator?->name ?? 'N/A'); ?></td>

                        <td class="px-4 py-3 text-gray-700"><?php echo e($feature->created_at->format('Y-m-d H:i')); ?></td>

                        <td class="px-4 py-3 text-right">
                            <div class="flex items-center justify-end gap-2">
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.features.edit')): ?>
                                <a href="<?php echo e(route('products.features.edit', [$product, $featureVersion, $feature])); ?>"
                                   class="text-orange-600 hover:text-orange-800 text-xs font-semibold">
                                    Editar
                                </a>
                                <?php endif; ?>

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.features.destroy')): ?>
                                <button wire:click="delete(<?php echo e($feature->id); ?>)"
                                        wire:confirm="¿Seguro que deseas eliminar esta feature?"
                                        class="text-red-600 hover:text-red-800 text-xs font-semibold">
                                    Eliminar
                                </button>
                                <?php endif; ?>
                            </div>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr>
                        <td colspan="6" class="px-4 py-8 text-center text-gray-500">
                            <div class="flex flex-col items-center">
                                <p class="text-sm mb-4">No hay features en esta versión.</p>
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.features.create')): ?>
                                <a href="<?php echo e(route('products.features.create', [$product, $featureVersion])); ?>"
                                   class="rounded-lg bg-orange-600 px-4 py-2 text-sm text-white hover:bg-orange-700 font-semibold">
                                    Crear la primera feature
                                </a>
                                <?php endif; ?>
                            </div>
                        </td>
                    </tr>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </tbody>
            </table>
        </div>
    </div>
</div><?php /**PATH /var/www/html/resources/views/livewire/features/version-show.blade.php ENDPATH**/ ?>