<div id="technologyOptionsContainer">
    <?php
        $allowTechnologyDelete = $allowTechnologyDelete ?? false;
    ?>

    <?php if($technologies->isEmpty()): ?>
        <div class="alert alert-warning border-0 rounded-4 mb-0">
            No technologies are available yet. Add technology records first so you can tag this project properly.
        </div>
    <?php else: ?>
        <div class="technology-grid">
            <?php $__currentLoopData = $technologies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $technology): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php
                    $color = $technology->color ?: '#3b82f6';
                    $isChecked = in_array((string) $technology->id, $selectedTechnologies ?? [], true);
                    $linkedProjects = (int) ($technology->projects_count ?? 0);
                    $canDeleteTechnology = $allowTechnologyDelete && $linkedProjects === 0;
                ?>
                <div class="technology-card-wrap <?php echo e($allowTechnologyDelete ? 'has-delete-action' : ''); ?>">
                    <label class="technology-option <?php echo e($isChecked ? 'is-selected' : ''); ?>" style="--tech-color: <?php echo e($color); ?>;" data-technology-option>
                        <input
                            type="checkbox"
                            name="technologies[]"
                            value="<?php echo e($technology->id); ?>"
                            class="technology-input"
                            <?php echo e($isChecked ? 'checked' : ''); ?>

                        >
                        <div class="technology-icon-container">
                            <i class="<?php echo e($technology->icon ?: 'bi bi-code-square'); ?>"></i>
                        </div>
                        <span class="technology-name"><?php echo e($technology->name); ?></span>
                    </label>

                    <?php if($allowTechnologyDelete): ?>
                        <button
                            type="button"
                            class="technology-delete-btn <?php echo e($canDeleteTechnology ? '' : 'is-disabled'); ?>"
                            <?php if($canDeleteTechnology): ?>
                                data-technology-delete
                                data-technology-id="<?php echo e($technology->id); ?>"
                                data-technology-name="<?php echo e($technology->name); ?>"
                                data-delete-url="<?php echo e(route('technologies.destroy', $technology->id)); ?>"
                                aria-label="Delete <?php echo e($technology->name); ?>"
                                title="Delete technology"
                            <?php else: ?>
                                disabled
                                aria-label="<?php echo e($technology->name); ?> is used by <?php echo e($linkedProjects); ?> project<?php echo e($linkedProjects === 1 ? '' : 's'); ?>"
                                title="Used by <?php echo e($linkedProjects); ?> project<?php echo e($linkedProjects === 1 ? '' : 's'); ?>"
                            <?php endif; ?>
                        >
                            <i class="bi bi-trash3"></i>
                        </button>
                    <?php endif; ?>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    <?php endif; ?>
</div>
<?php /**PATH C:\laragon\www\portfolio\resources\views/projects/_technology_options.blade.php ENDPATH**/ ?>