<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('heading', null, []); ?> Log Water Change <?php $__env->endSlot(); ?>

    <div class="mb-6 flex items-center gap-2 text-sm">
        <a href="<?php echo e(route('ponds.index')); ?>" class="text-gray-400 hover:text-gray-600">Ponds</a>
        <svg class="h-4 w-4 text-gray-300" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
            <path stroke-linecap="round" stroke-linejoin="round" d="M8.25 4.5l7.5 7.5-7.5 7.5"/>
        </svg>
        <span class="text-gray-700">Log Water Change</span>
    </div>

    <div class="mx-auto max-w-xl">
        <div class="rounded-xl border border-gray-100 bg-white p-6 shadow-sm">
            <div class="mb-6 flex items-center gap-3">
                <span class="text-3xl">💧</span>
                <div>
                    <h2 class="font-semibold text-gray-900 text-lg">Water Change Log</h2>
                    <p class="text-sm text-gray-500">Record a water change event for a pond</p>
                </div>
            </div>

            <form method="POST" action="<?php echo e(route('water-changes.store')); ?>" class="space-y-5">
                <?php echo csrf_field(); ?>

                
                <div>
                    <label class="mb-1.5 block text-sm font-medium text-gray-700">Pond <span class="text-red-500">*</span></label>
                    <select name="pond_id" required
                            class="w-full rounded-lg border-gray-200 shadow-sm text-sm focus:border-primary-500 focus:ring-primary-500 <?php $__errorArgs = ['pond_id'];
$__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); ?>">
                        <option value="">— Select pond —</option>
                        <?php $__currentLoopData = $ponds; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pond): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($pond->id); ?>"
                                <?php if(old('pond_id', $selectedPondId) == $pond->id): echo 'selected'; endif; ?>>
                            <?php echo e($pond->pond_code); ?> — <?php echo e($pond->name); ?>

                            <?php if($pond->activeCycle): ?>
                                (Cycle #<?php echo e($pond->activeCycle->cycle_number); ?>)
                            <?php endif; ?>
                        </option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                    <?php $__errorArgs = ['pond_id'];
$__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 text-xs text-red-600"><?php echo e($message); ?></p>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>

                
                <div>
                    <label class="mb-1.5 block text-sm font-medium text-gray-700">Date <span class="text-red-500">*</span></label>
                    <input type="date" name="change_date" required
                           value="<?php echo e(old('change_date', today()->toDateString())); ?>"
                           max="<?php echo e(today()->toDateString()); ?>"
                           class="w-full rounded-lg border-gray-200 shadow-sm text-sm focus:border-primary-500 focus:ring-primary-500 <?php $__errorArgs = ['change_date'];
$__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 = ['change_date'];
$__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 text-xs text-red-600"><?php echo e($message); ?></p>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>

                
                <div>
                    <label class="mb-1.5 block text-sm font-medium text-gray-700">Type <span class="text-red-500">*</span></label>
                    <div class="grid grid-cols-2 gap-3">
                        <?php $__currentLoopData = ['partial' => 'Partial Change', 'full' => 'Full Change']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $val => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <label class="flex cursor-pointer items-center gap-3 rounded-lg border border-gray-200 p-3 hover:border-blue-300 hover:bg-blue-50 transition-colors has-[:checked]:border-blue-500 has-[:checked]:bg-blue-50">
                            <input type="radio" name="change_type" value="<?php echo e($val); ?>"
                                   <?php if(old('change_type', 'partial') === $val): echo 'checked'; endif; ?>
                                   class="text-blue-600 focus:ring-blue-500">
                            <div>
                                <p class="text-sm font-medium text-gray-900"><?php echo e($label); ?></p>
                                <p class="text-xs text-gray-500">
                                    <?php if($val === 'partial'): ?> Replace part of the water <?php else: ?> Replace all water <?php endif; ?>
                                </p>
                            </div>
                        </label>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                    <?php $__errorArgs = ['change_type'];
$__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 text-xs text-red-600"><?php echo e($message); ?></p>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>

                
                <div>
                    <label class="mb-1.5 block text-sm font-medium text-gray-700">% Changed (optional)</label>
                    <div class="relative">
                        <input type="number" name="percentage_changed" step="1" min="1" max="100"
                               value="<?php echo e(old('percentage_changed')); ?>"
                               placeholder="e.g. 30"
                               class="w-full rounded-lg border-gray-200 pr-10 shadow-sm text-sm focus:border-primary-500 focus:ring-primary-500 <?php $__errorArgs = ['percentage_changed'];
$__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); ?>">
                        <span class="pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-400">%</span>
                    </div>
                    <?php $__errorArgs = ['percentage_changed'];
$__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 text-xs text-red-600"><?php echo e($message); ?></p>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>

                
                <div>
                    <label class="mb-1.5 block text-sm font-medium text-gray-700">Reason</label>
                    <input type="text" name="reason" value="<?php echo e(old('reason')); ?>"
                           placeholder="e.g. Routine, High ammonia, Pre-treatment…"
                           class="w-full rounded-lg border-gray-200 shadow-sm text-sm focus:border-primary-500 focus:ring-primary-500">
                </div>

                
                <div>
                    <label class="mb-1.5 block text-sm font-medium text-gray-700">Notes</label>
                    <textarea name="notes" rows="3"
                              placeholder="Any additional observations…"
                              class="w-full rounded-lg border-gray-200 shadow-sm text-sm focus:border-primary-500 focus:ring-primary-500"><?php echo e(old('notes')); ?></textarea>
                </div>

                <div class="flex items-center justify-between gap-3 pt-2">
                    <a href="<?php echo e(url()->previous()); ?>"
                       class="rounded-lg border border-gray-200 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50">
                        Cancel
                    </a>
                    <button type="submit"
                            class="rounded-lg bg-blue-600 px-5 py-2 text-sm font-semibold text-white hover:bg-blue-700 shadow-sm">
                        💧 Save Water Change
                    </button>
                </div>
            </form>
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php /**PATH C:\laragon\www\farm\resources\views\water-changes\create.blade.php ENDPATH**/ ?>