<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Edit Task - Task Panel</title>
    
    <!-- Google Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400..700;1,400..700&display=swap" rel="stylesheet">
    
    <style>
        :root {
            --primary: #3b46f1;
            --primary-color: #3b46f1;
            --primary-hover: #2a35d8;
            --primary-light: #eff6ff;
            --bg-main: #f8fafc;
            --bg-card: #ffffff;
            
            --text-main: #0f172a;
            --text-muted: #64748b;
            --text-label: #334155;
            --border-color: #e2e8f0;
            --border-hover: #cbd5e1;
            --font-family: 'Instrument Sans', sans-serif;

            --sidebar-width: 260px;
            --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
            --border-radius: 12px;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: var(--font-family);
            background-color: var(--bg-main);
            color: var(--text-main);
            min-height: 100vh;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            overflow-x: hidden;
        }

        /* Scrollbar customization */
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }
        ::-webkit-scrollbar-track {
            background: transparent;
        }
        ::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 4px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

        /* Main Page Layout Wrapper */
        .dashboard-layout {
            display: flex;
            position: relative;
            min-height: 100vh;
        }

        /* Main Content Layout */
        .main-content {
            margin-left: var(--sidebar-width);
            flex-grow: 1;
            padding: 2rem;
            display: flex;
            flex-direction: column;
            gap: 2rem;
            min-width: 0;
            transition: margin-left 0.3s ease;
        }

        /* Topbar styling */
        .topbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1.5rem;
        }

        .topbar-left {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
        }

        .topbar-right {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .notification-btn {
            background: none;
            border: none;
            color: #64748b;
            cursor: pointer;
            position: relative;
            padding: 0.5rem;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background-color 0.2s;
        }

        .notification-btn:hover {
            background-color: #f1f5f9;
        }

        .notification-btn svg {
            width: 1.5rem;
            height: 1.5rem;
        }

        .notification-dot {
            width: 8px;
            height: 8px;
            background-color: var(--primary);
            border-radius: 50%;
            position: absolute;
            top: 6px;
            right: 6px;
            border: 2px solid #f8fafc;
        }

        .user-profile {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            cursor: pointer;
            padding: 0.25rem;
            border-radius: 8px;
            transition: background-color 0.2s;
        }

        .user-profile:hover {
            background-color: #f1f5f9;
        }

        .avatar-frame {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            position: relative;
            background: linear-gradient(135deg, #4f46e5, #3b82f6);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #ffffff;
            font-weight: 700;
            font-size: 0.85rem;
            overflow: hidden;
        }

        .avatar-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .online-status-dot {
            width: 10px;
            height: 10px;
            background-color: #10b981;
            border: 2px solid #ffffff;
            border-radius: 50%;
            position: absolute;
            bottom: 0;
            right: 0;
        }

        .user-info {
            display: flex;
            flex-direction: column;
            line-height: 1.25;
        }

        .user-fullname {
            font-size: 0.875rem;
            font-weight: 700;
            color: var(--text-main);
        }

        .user-role-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            font-weight: 500;
        }

        .profile-arrow {
            color: #64748b;
            display: flex;
            align-items: center;
        }

        .profile-arrow svg {
            width: 1rem;
            height: 1rem;
        }

        /* Page Header Title */
        .dashboard-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: none;
            padding-bottom: 0;
        }

        .dashboard-title {
            font-size: 1.75rem;
            font-weight: 800;
            letter-spacing: -0.02em;
            color: #0e1c59;
        }

        /* Alert notifications */
        .alert-error {
            background-color: #fef2f2;
            border-left: 4px solid #ef4444;
            padding: 1rem;
            border-radius: 8px;
            color: #991b1b;
            font-size: 0.875rem;
            font-weight: 600;
        }

        .alert-error ul {
            list-style: inside disc;
            font-weight: 500;
            margin-top: 0.25rem;
            font-size: 0.825rem;
        }

        /* Card form layout */
        .form-card {
            background-color: var(--bg-card);
            border: 1px solid #e2e8f0;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow-sm);
            padding: 2.25rem;
            display: flex;
            flex-direction: column;
            gap: 1.75rem;
        }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 0.625rem;
        }

        .form-label {
            font-size: 0.875rem;
            font-weight: 700;
            color: #0e1c59;
        }

        .input-field {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            font-size: 0.875rem;
            color: var(--text-main);
            background-color: #ffffff;
            transition: all 0.2s;
            font-family: inherit;
            outline: none;
        }

        .input-field::placeholder {
            color: var(--text-muted);
        }

        .input-field:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(59, 70, 241, 0.1);
        }

        textarea.input-field {
            resize: vertical;
            min-height: 100px;
            line-height: 1.5;
        }

        /* 2 Column sub grid */
        .form-row-2col {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.5rem;
        }

        /* Dropdowns arrow override */
        select.input-field {
            appearance: none;
            padding-right: 2.5rem;
            background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 1rem center;
            background-size: 0.8rem;
            font-weight: 500;
        }

        select.input-field:focus {
            background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%233b46f1' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
        }
        
        /* Date field styling */
        input[type="date"].input-field {
            position: relative;
            padding-right: 2.5rem;
            cursor: pointer;
        }

        input[type="date"].input-field::-webkit-calendar-picker-indicator {
            position: absolute;
            right: 0.75rem;
            top: 50%;
            transform: translateY(-50%);
            width: 1.2rem;
            height: 1.2rem;
            opacity: 0.6;
            cursor: pointer;
        }

        input[type="date"].input-field:focus::-webkit-calendar-picker-indicator {
            opacity: 1;
        }

        /* Form Footer Buttons */
        .form-actions-footer {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 1rem;
            border-top: 1px solid #f1f5f9;
            padding-top: 1.75rem;
            margin-top: 0.5rem;
        }

        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.75rem 1.75rem;
            border-radius: 8px;
            font-size: 0.875rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
            text-decoration: none;
            border: 1px solid transparent;
            font-family: inherit;
        }

        .btn-cancel {
            background-color: #ffffff;
            border: 1px solid #e2e8f0;
            color: var(--text-label);
        }

        .btn-cancel:hover {
            background-color: #f8fafc;
            border-color: #cbd5e1;
        }

        .btn-submit {
            background-color: var(--primary);
            color: #ffffff;
            box-shadow: 0 4px 10px rgba(59, 70, 241, 0.18);
        }

        .btn-submit:hover {
            background-color: var(--primary-hover);
            box-shadow: 0 6px 15px rgba(59, 70, 241, 0.25);
        }

        /* Drawer Toggler for Mobile/Tablet */
        .menu-toggle-btn {
            display: none;
            background: #ffffff;
            border: 1px solid #e2e8f0;
            width: 38px;
            height: 38px;
            border-radius: 8px;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: var(--text-label);
            margin-right: auto;
        }

        .menu-toggle-btn svg {
            width: 1.25rem;
            height: 1.25rem;
            stroke-width: 2.5;
        }



        /* Responsive adaptation */
        @media (max-width: 1024px) {
            .main-content {
                margin-left: 0;
                padding: 1.5rem;
            }
            .menu-toggle-btn {
                display: flex;
            }
            .topbar {
                justify-content: space-between;
            }
        }

        @media (max-width: 640px) {
            .form-row-2col {
                grid-template-columns: 1fr;
                gap: 1.5rem;
            }
            .form-card {
                padding: 1.5rem;
            }
            .form-actions-footer {
                flex-direction: column-reverse;
                align-items: stretch;
            }
            .btn {
                width: 100%;
            }
        }
    </style>
    <!-- Favicon -->
    <link rel="icon" type="image/png" href="<?php echo e(asset('images/faviocntaskpannel.png')); ?>">
</head>
<body>

    <div class="dashboard-layout">
        <?php echo $__env->make('user.sidebar.sidebar', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

        <!-- RIGHT MAIN CONTENT -->
        <main class="main-content">
        <?php echo $__env->make('user.sidebar.topbar', ['pageTitle' => 'Edit Task'], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

        <!-- Form Errors Display -->
        <?php if($errors->any()): ?>
            <div class="alert-error">
                <strong>Please correct the following errors:</strong>
                <ul>
                    <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <li><?php echo e($error); ?></li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </ul>
            </div>
        <?php endif; ?>

        <!-- Single Task Form Card -->
        <form id="task-form" action="<?php echo e(route('user.tasks.update', $task->id)); ?>" method="POST">
            <?php echo csrf_field(); ?>
            
            <div class="form-card">
                <!-- Project Dropdown -->
                <div class="form-group">
                    <label class="form-label" for="project_id">Project</label>
                    <select id="project_id" name="project_id" class="input-field" required>
                        <option value="" disabled>Select Project</option>
                        <?php $__currentLoopData = $projects; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $project): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($project->id); ?>" <?php echo e($task->project_id == $project->id ? 'selected' : ''); ?>><?php echo e($project->name); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>

                 <div class="form-group">
                            <label for="type" class="form-label">Project Type</label>
                            <div class="input-wrapper">
                                <select name="type" id="type" class="input-field" required>
                                    <option value="" disabled <?php echo e(old('type', $task->type ?? $task->project->type) === null ? 'selected' : ''); ?>>Select Project Type</option>
                                    <option value="Web" <?php echo e(old('type', $task->type ?? $task->project->type) === 'Web' ? 'selected' : ''); ?>>Web Application (Web)</option>
                                    <option value="App" <?php echo e(old('type', $task->type ?? $task->project->type) === 'App' ? 'selected' : ''); ?>>Mobile Application (App)</option>
                                    <option value="API" <?php echo e(old('type', $task->type ?? $task->project->type) === 'API' ? 'selected' : ''); ?>>API Integration (API)</option>
                                    <option value="UI/UX" <?php echo e(old('type', $task->type ?? $task->project->type) === 'UI/UX' ? 'selected' : ''); ?>>UI/UX Design (UI/UX)</option>
                                </select>
                            </div>
                </div>

                <!-- Task Name -->
                <div class="form-group">
                    <label class="form-label" for="name">Task Name</label>
                    <input type="text" id="name" name="name" class="input-field" placeholder="Enter task title" value="<?php echo e($task->name); ?>" required>
                </div>
                


                <!-- Status -->
                <!-- <div class="form-group">
                    <label class="form-label" for="status">Status</label>
                    <select id="status" name="status" class="input-field" required>
                        <option value="Pending" <?php echo e($task->status == 'Pending' ? 'selected' : ''); ?>>Pending</option>
                        <option value="In Progress" <?php echo e($task->status == 'In Progress' ? 'selected' : ''); ?>>In Progress</option>
                        <option value="Hold" <?php echo e($task->status == 'Hold' ? 'selected' : ''); ?>>Hold</option>
                        <option value="Completed" <?php echo e($task->status == 'Completed' ? 'selected' : ''); ?>>Completed</option>
                        <option value="Cancelled" <?php echo e($task->status == 'Cancelled' ? 'selected' : ''); ?>>Cancelled</option>
                    </select>
                </div> -->

                <!-- Shared Link Field -->
                <div class="form-group">
                    <label class="form-label" for="link">Link</label>
                    <input type="text" id="link" name="link" class="input-field" placeholder="Enter link" value="<?php echo e($task->link); ?>">
                </div>

                <!-- Form Action Buttons -->
                <div class="form-actions-footer">
                    <a href="<?php echo e(route('user.tasks.index')); ?>" class="btn btn-cancel">Cancel</a>
                    <button type="submit" class="btn btn-submit">Update Task</button>
                </div>
            </div>
        </form>
    </main>
</div>

</body>
</html>
<?php /**PATH D:\New\New\admin-panel\resources\views/user/task/edittask.blade.php ENDPATH**/ ?>