<?php $__env->startSection('title', 'Settings — ' . $project->name); ?>
<?php $__env->startSection('breadcrumb'); ?>
    <a href="<?php echo e(route('projects.index')); ?>" style="color:var(--text-secondary);">Projects</a>
    <span class="topbar-breadcrumb-sep">/</span>
    <a href="<?php echo e(route('projects.show', $project)); ?>" style="color:var(--text-secondary);"><?php echo e($project->name); ?></a>
    <span class="topbar-breadcrumb-sep">/</span>
    <span style="font-weight:600;color:var(--text-primary);">Settings</span>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div style="max-width:860px;">
        <div class="page-header"><h1>⚙️ Project Settings</h1></div>

        
        <div class="card mb-4">
            <div class="card-header"><span class="card-header-title">General</span></div>
            <div class="card-body">
                <form method="POST" action="<?php echo e(route('projects.update', $project)); ?>">
                    <?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?>

                    <div class="form-group">
                        <label class="form-label">Project Name *</label>
                        <input type="text" name="name" class="form-control" value="<?php echo e(old('name', $project->name)); ?>" required>
                    </div>

                    <div class="form-group">
                        <label class="form-label">Description</label>
                        <textarea name="description" class="form-control" rows="3"><?php echo e(old('description', $project->description)); ?></textarea>
                    </div>

                    <div class="grid grid-2">
                        <div class="form-group">
                            <label class="form-label">Team</label>
                            <select name="team_id" class="form-control">
                                <option value="">No Team</option>
                                <?php $__currentLoopData = $teams; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $team): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($team->id); ?>" <?php echo e($project->team_id == $team->id ? 'selected' : ''); ?>><?php echo e($team->name); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                        <div class="form-group">
                            <label class="form-label">Status</label>
                            <select name="status" class="form-control">
                                <?php $__currentLoopData = ['not_started','in_progress','on_hold','completed','cancelled']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($s); ?>" <?php echo e($project->status == $s ? 'selected' : ''); ?>><?php echo e(ucfirst(str_replace('_', ' ', $s))); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                    </div>

                    <div class="grid grid-2">
                        <div class="form-group">
                            <label class="form-label">Priority</label>
                            <select name="priority" class="form-control">
                                <?php $__currentLoopData = ['low','medium','high','urgent']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($p); ?>" <?php echo e($project->priority == $p ? 'selected' : ''); ?>><?php echo e(ucfirst($p)); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                        <div class="form-group">
                            <label class="form-label">Color</label>
                            <input type="color" name="color" value="<?php echo e($project->color); ?>" style="width:100%;height:42px;border:1px solid var(--border-color);border-radius:var(--radius-md);background:var(--bg-primary);cursor:pointer;">
                        </div>
                    </div>

                    <div class="grid grid-2">
                        <div class="form-group">
                            <label class="form-label">Start Date</label>
                            <input type="date" name="start_date" class="form-control" value="<?php echo e($project->start_date?->format('Y-m-d')); ?>">
                        </div>
                        <div class="form-group">
                            <label class="form-label">Due Date</label>
                            <input type="date" name="due_date" class="form-control" value="<?php echo e($project->due_date?->format('Y-m-d')); ?>">
                        </div>
                    </div>

                    <button type="submit" class="btn btn-primary mt-2">Save Changes</button>
                </form>
            </div>
        </div>

        
        <div class="card mb-4">
            <div class="card-header" style="display:flex;justify-content:space-between;align-items:center;">
                <span class="card-header-title">Members (<?php echo e($project->members->count()); ?>)</span>
            </div>
            <div class="card-body">
                
                <?php $__empty_1 = true; $__currentLoopData = $project->members; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $member): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <div class="task-item" style="display:flex;justify-content:space-between;align-items:center;">
                        <div style="display:flex;align-items:center;gap:10px;">
                            <div class="avatar avatar-sm"><?php echo e($member->initials); ?></div>
                            <div>
                                <div class="font-semibold"><?php echo e($member->name); ?></div>
                                <div class="text-xs text-muted"><?php echo e($member->email); ?></div>
                            </div>
                        </div>
                        <div style="display:flex;align-items:center;gap:8px;">
                            <span class="badge badge-secondary"><?php echo e($member->pivot->role ?? 'member'); ?></span>
                            <?php if($member->id !== $project->owner_id): ?>
                                <form method="POST" action="<?php echo e(route('projects.members.remove', [$project, $member])); ?>" style="margin:0;" onsubmit="return confirm('Remove this member?')">
                                    <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                                    <button type="submit" class="btn btn-ghost btn-sm" style="color:var(--accent-red);">
                                        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="width:14px;height:14px;"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
                                    </button>
                                </form>
                            <?php else: ?>
                                <span class="badge badge-primary" style="font-size:0.7rem;">Owner</span>
                            <?php endif; ?>
                        </div>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <div style="text-align:center;padding:16px;color:var(--text-tertiary);">No members yet.</div>
                <?php endif; ?>

                
                <form method="POST" action="<?php echo e(route('projects.members.add', $project)); ?>" style="margin-top:16px;padding-top:16px;border-top:1px solid var(--border-color);display:flex;gap:8px;">
                    <?php echo csrf_field(); ?>
                    <select name="user_id" class="form-control" style="flex:1;" required>
                        <option value="">Add a member...</option>
                        <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $u): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php if(!$project->members->contains($u->id) && $u->id !== $project->owner_id): ?>
                                <option value="<?php echo e($u->id); ?>"><?php echo e($u->name); ?> (<?php echo e($u->email); ?>)</option>
                            <?php endif; ?>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                    <select name="role" class="form-control" style="width:130px;">
                        <option value="member">Member</option>
                        <option value="admin">Admin</option>
                        <option value="viewer">Viewer</option>
                    </select>
                    <button type="submit" class="btn btn-primary btn-sm">Add</button>
                </form>
            </div>
        </div>

        
        <div class="card" style="border:1px solid var(--accent-red);">
            <div class="card-header" style="border-color:var(--accent-red);">
                <span class="card-header-title" style="color:var(--accent-red);">⚠️ Danger Zone</span>
            </div>
            <div class="card-body">
                <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;">
                    <div>
                        <div class="font-semibold">Archive this project</div>
                        <div class="text-xs text-muted">Mark this project as archived. It will be hidden from the sidebar and project lists.</div>
                    </div>
                    <form method="POST" action="<?php echo e(route('projects.archive', $project)); ?>" style="margin:0;">
                        <?php echo csrf_field(); ?> <?php echo method_field('PATCH'); ?>
                        <button type="submit" class="btn btn-secondary btn-sm">
                            <?php echo e($project->is_archived ? 'Unarchive' : 'Archive'); ?>

                        </button>
                    </form>
                </div>
                <div style="display:flex;justify-content:space-between;align-items:center;padding-top:16px;border-top:1px solid var(--border-color);">
                    <div>
                        <div class="font-semibold" style="color:var(--accent-red);">Delete this project</div>
                        <div class="text-xs text-muted">Permanently delete this project and all its tasks. This cannot be undone.</div>
                    </div>
                    <form method="POST" action="<?php echo e(route('projects.destroy', $project)); ?>" style="margin:0;" onsubmit="return confirm('Are you sure? This will permanently delete the project and all tasks.')">
                        <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                        <button type="submit" class="btn btn-sm" style="background:var(--accent-red);color:white;">Delete Project</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
<?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/projects/settings.blade.php ENDPATH**/ ?>