<?php $__env->startSection('title', 'Form Builder'); ?>

<?php $__env->startSection('content'); ?>
<div class="content-header">
    <div>
        <h1 style="display:flex; align-items:center; gap:10px;">
            <span style="display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:10px; background:linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.15));">
                <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="var(--accent-primary)" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"/><line x1="9" y1="9" x2="15" y2="9"/><line x1="9" y1="13" x2="15" y2="13"/><line x1="9" y1="17" x2="12" y2="17"/></svg>
            </span>
            Form Builder
        </h1>
        <p class="text-secondary">Create and manage dynamic forms</p>
    </div>
    <a href="<?php echo e(route('form-builder.create')); ?>" class="btn btn-primary" style="background:linear-gradient(135deg, var(--accent-primary), #a78bfa); border:none; box-shadow:0 4px 12px rgba(99,102,241,0.25);">
        <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
        New Form
    </a>
</div>

<?php if(session('success')): ?>
    <div class="alert alert-success"><?php echo e(session('success')); ?></div>
<?php endif; ?>

<?php if($forms->isEmpty()): ?>
<div class="empty-state-card" style="text-align:center; padding:80px 20px; background:linear-gradient(145deg, var(--bg-secondary), rgba(26,29,46,0.92)); border:1px solid rgba(99,102,241,0.08); border-radius:18px;">
    <div style="width:72px; height:72px; margin:0 auto 20px; border-radius:20px; background:linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1)); display:flex; align-items:center; justify-content:center;">
        <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="var(--accent-primary)" stroke-width="1.5" style="opacity:.7;"><rect x="3" y="3" width="18" height="18" rx="2"/><line x1="12" y1="8" x2="12" y2="16"/><line x1="8" y1="12" x2="16" y2="12"/></svg>
    </div>
    <h3 style="color:var(--text-primary); font-weight:800; margin-bottom:8px; font-size:1.15rem;">No forms yet</h3>
    <p style="color:var(--text-tertiary); margin-bottom:24px; font-size:0.88rem;">Create your first form to start collecting submissions</p>
    <a href="<?php echo e(route('form-builder.create')); ?>" class="btn btn-primary" style="background:linear-gradient(135deg, var(--accent-primary), #a78bfa); border:none; padding:10px 28px;">Create Form</a>
</div>
<?php else: ?>
<div class="fb-grid">
    <?php $__currentLoopData = $forms; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $form): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <div class="fb-card" style="animation-delay: <?php echo e($i * 0.06); ?>s;">
        <div class="fb-card-inner">
            <div class="fb-card-header">
                <div class="fb-card-status <?php echo e($form->is_active ? 'active' : 'inactive'); ?>">
                    <?php echo e($form->is_active ? 'Active' : 'Inactive'); ?>

                </div>
                <?php if($form->is_public): ?>
                <div class="fb-card-badge public">Public</div>
                <?php endif; ?>
            </div>
            <h3 class="fb-card-title"><?php echo e($form->title); ?></h3>
            <?php if($form->description): ?>
            <p class="fb-card-desc"><?php echo e(Str::limit($form->description, 80)); ?></p>
            <?php endif; ?>
            <div class="fb-card-meta">
                <span>
                    <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>
                    <?php echo e($form->submissions_count); ?> submissions
                </span>
                <?php if($form->project): ?>
                <span>
                    <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="7" width="20" height="14" rx="2" ry="2"/><path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/></svg>
                    <?php echo e($form->project->name); ?>

                </span>
                <?php endif; ?>
            </div>
            <?php if($form->sla_hours): ?>
            <div class="fb-card-sla">
                <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
                SLA: <?php echo e($form->sla_hours); ?>h
            </div>
            <?php endif; ?>
            <div class="fb-card-actions">
                <a href="<?php echo e(route('form-builder.edit', $form)); ?>" class="fb-action-btn" title="Edit">
                    <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>
                </a>
                <a href="<?php echo e(route('form-builder.submissions', $form)); ?>" class="fb-action-btn" title="Submissions">
                    <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>
                </a>
                <form action="<?php echo e(route('form-builder.duplicate', $form)); ?>" method="POST" style="display:inline;">
                    <?php echo csrf_field(); ?>
                    <button type="submit" class="fb-action-btn" title="Duplicate">
                        <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
                    </button>
                </form>
                <?php if($form->is_public): ?>
                <button class="fb-action-btn" title="Copy Public Link" onclick="navigator.clipboard.writeText('<?php echo e($form->public_url); ?>'); this.innerHTML='<svg width=14 height=14 viewBox=\'0 0 24 24\' fill=\'none\' stroke=\'#22c55e\' stroke-width=\'2\'><polyline points=\'20 6 9 17 4 12\'/></svg>'; setTimeout(() => location.reload(), 1000)">
                    <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>
                </button>
                <?php endif; ?>
                <form action="<?php echo e(route('form-builder.destroy', $form)); ?>" method="POST" style="display:inline; margin-left:auto;" onsubmit="return confirm('Delete this form?')">
                    <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                    <button type="submit" class="fb-action-btn danger" title="Delete">
                        <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>
                    </button>
                </form>
            </div>
        </div>
    </div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
<div style="margin-top:24px;"><?php echo e($forms->links()); ?></div>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Applications/XAMPP/xamppfiles/htdocs/asana/resources/views/forms/index.blade.php ENDPATH**/ ?>