<?php $__env->startSection('title', isset($realisation) ? 'Modifier la réalisation' : 'Nouvelle réalisation'); ?>

<?php $__env->startSection('content'); ?>
<div class="max-w-4xl mx-auto">
    
    <div class="mb-10">
        <a href="<?php echo e(route('dashboard.realisations.index')); ?>" class="inline-flex items-center gap-2 text-slate-600 hover:text-slate-900 mb-6 transition">
            <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"/>
            </svg>
            Retour aux réalisations
        </a>
        <h1 class="text-3xl font-bold text-slate-900 tracking-tight">
            <?php echo e(isset($realisation) ? 'Modifier la réalisation' : 'Nouvelle réalisation'); ?>

        </h1>
        <p class="mt-2 text-slate-600">
            <?php echo e(isset($realisation) ? 'Mettez à jour les informations de cette réalisation.' : 'Renseignez les détails du projet pour l\'ajouter à votre portfolio.'); ?>

        </p>
    </div>

    
    <form action="<?php echo e(isset($realisation) ? route('dashboard.realisations.update', $realisation) : route('dashboard.realisations.store')); ?>" method="POST" enctype="multipart/form-data">
        <?php echo csrf_field(); ?>
        <?php if(isset($realisation)): ?>
        <?php echo method_field('PUT'); ?>
        <?php endif; ?>

        <div class="bg-white rounded-2xl shadow-sm border border-slate-200/80 overflow-hidden">
            
            <div class="p-8 md:p-10 space-y-8">
                <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
                    
                    <div class="md:col-span-2">
                        <label for="lieu" class="block text-sm font-semibold text-slate-800 mb-2">
                            Lieu <span class="text-amber-500">*</span>
                        </label>
                        <input type="text" name="lieu" id="lieu" value="<?php echo e(old('lieu', isset($realisation) ? $realisation->lieu : '')); ?>" required
                               placeholder="Ex : Casablanca, Quartier Anfa"
                               class="w-full px-4 py-3.5 rounded-xl border border-slate-200 bg-slate-50/50 focus:bg-white focus:ring-2 focus:ring-amber-500/20 focus:border-amber-500 transition placeholder:text-slate-400 <?php $__errorArgs = ['lieu'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> border-red-300 focus:ring-red-500/20 focus:border-red-500 <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                        <?php $__errorArgs = ['lieu'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <p class="mt-1.5 text-sm text-red-600"><?php echo e($message); ?></p>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>

                    
                    <div>
                        <label for="type_travaux" class="block text-sm font-semibold text-slate-800 mb-2">
                            Type de travaux <span class="text-amber-500">*</span>
                        </label>
                        <input type="text" name="type_travaux" id="type_travaux" value="<?php echo e(old('type_travaux', isset($realisation) ? $realisation->type_travaux : '')); ?>" required
                               placeholder="Ex : Installation électrique, Rénovation"
                               class="w-full px-4 py-3.5 rounded-xl border border-slate-200 bg-slate-50/50 focus:bg-white focus:ring-2 focus:ring-amber-500/20 focus:border-amber-500 transition placeholder:text-slate-400 <?php $__errorArgs = ['type_travaux'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> border-red-300 <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                        <?php $__errorArgs = ['type_travaux'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <p class="mt-1.5 text-sm text-red-600"><?php echo e($message); ?></p>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>

                    
                    <div>
                        <label for="duree_travaux" class="block text-sm font-semibold text-slate-800 mb-2">
                            Durée des travaux <span class="text-amber-500">*</span>
                        </label>
                        <input type="text" name="duree_travaux" id="duree_travaux" value="<?php echo e(old('duree_travaux', isset($realisation) ? $realisation->duree_travaux : '')); ?>" required
                               placeholder="Ex : 2 semaines, 3 mois"
                               class="w-full px-4 py-3.5 rounded-xl border border-slate-200 bg-slate-50/50 focus:bg-white focus:ring-2 focus:ring-amber-500/20 focus:border-amber-500 transition placeholder:text-slate-400 <?php $__errorArgs = ['duree_travaux'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> border-red-300 <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                        <?php $__errorArgs = ['duree_travaux'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <p class="mt-1.5 text-sm text-red-600"><?php echo e($message); ?></p>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>

                    
                    <div class="md:col-span-2">
                        <label for="client" class="block text-sm font-semibold text-slate-800 mb-2">
                            Client <span class="text-slate-400 font-normal">(optionnel)</span>
                        </label>
                        <input type="text" name="client" id="client" value="<?php echo e(old('client', isset($realisation) ? $realisation->client : '')); ?>"
                               placeholder="Ex : Société XYZ, Particulier"
                               class="w-full px-4 py-3.5 rounded-xl border border-slate-200 bg-slate-50/50 focus:bg-white focus:ring-2 focus:ring-amber-500/20 focus:border-amber-500 transition placeholder:text-slate-400 <?php $__errorArgs = ['client'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> border-red-300 <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                        <?php $__errorArgs = ['client'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <p class="mt-1.5 text-sm text-red-600"><?php echo e($message); ?></p>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>

                    
                    <div class="md:col-span-2">
                        <label for="description" class="block text-sm font-semibold text-slate-800 mb-2">
                            Description <span class="text-amber-500">*</span>
                        </label>
                        <textarea name="description" id="description" rows="5" required
                                  placeholder="Décrivez le projet, les travaux réalisés, les défis rencontrés..."
                                  class="w-full px-4 py-3.5 rounded-xl border border-slate-200 bg-slate-50/50 focus:bg-white focus:ring-2 focus:ring-amber-500/20 focus:border-amber-500 transition placeholder:text-slate-400 resize-none <?php $__errorArgs = ['description'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> border-red-300 <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"><?php echo e(old('description', isset($realisation) ? $realisation->description : '')); ?></textarea>
                        <?php $__errorArgs = ['description'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <p class="mt-1.5 text-sm text-red-600"><?php echo e($message); ?></p>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>

                    
                    <div class="md:col-span-2">
                        <label for="image" class="block text-sm font-semibold text-slate-800 mb-2">Image du projet</label>
                        <?php if(isset($realisation) && $realisation->image): ?>
                        <div class="mb-4 flex items-center gap-4">
                            <img src="<?php echo e(asset('storage/' . $realisation->image)); ?>" alt="Aperçu actuel du projet" class="h-24 w-auto rounded-lg object-cover border border-slate-200">
                            <span class="text-sm text-slate-500">Image actuelle</span>
                        </div>
                        <?php endif; ?>
                        <div class="relative">
                            <input type="file" name="image" id="image" accept="image/*"
                                   class="block w-full text-sm text-slate-600 file:mr-4 file:py-2.5 file:px-4 file:rounded-lg file:border-0 file:bg-amber-500 file:text-white file:font-medium file:cursor-pointer hover:file:bg-amber-600 cursor-pointer px-4 py-3.5 rounded-xl border-2 border-dashed border-slate-200 bg-slate-50/30 hover:border-amber-400 hover:bg-amber-50/30 focus:border-amber-500 focus:bg-white transition">
                        </div>
                        <p class="mt-1.5 text-xs text-slate-500">PNG, JPG ou WEBP. Max 2 Mo recommandé.</p>
                    </div>
                </div>
            </div>

            
            <div class="px-8 md:px-10 py-6 bg-slate-50/80 border-t border-slate-100 flex flex-col sm:flex-row gap-4 justify-end">
                <a href="<?php echo e(route('dashboard.realisations.index')); ?>" class="inline-flex justify-center items-center px-6 py-3 rounded-xl border border-slate-200 text-slate-700 font-medium hover:bg-white hover:border-slate-300 transition">
                    Annuler
                </a>
                <button type="submit" class="inline-flex justify-center items-center gap-2 px-8 py-3.5 rounded-xl bg-amber-500 hover:bg-amber-600 text-white font-semibold shadow-lg shadow-amber-500/25 hover:shadow-amber-500/30 transition">
                    <?php echo e(isset($realisation) ? 'Mettre à jour' : 'Créer la réalisation'); ?>

                    <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>
                    </svg>
                </button>
            </div>
        </div>
    </form>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.dashboard', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Softsys\emelec_2\resources\views/dashboard/realisations/form.blade.php ENDPATH**/ ?>