{{--<!-- [NEW] Log Calibration Modal -->--}}
{{--<x-dialog-modal wire:model.live="confirmingLogCreation">--}}
{{--    <x-slot name="title">--}}
{{--        ثبت کالیبراسیون جدید برای: <span class="font-bold">{{ $equipmentForLog?->name }}</span>--}}
{{--    </x-slot>--}}
{{--    <x-slot name="content">--}}
{{--        <div class="space-y-4">--}}
{{--            <div>--}}
{{--                <x-label for="calibration_date" value="تاریخ انجام کالیبراسیون" />--}}
{{--                <x-jalali-date-picker id="calibration_date" wire:model="logState.calibration_date" />--}}
{{--                <x-input-error for="logState.calibration_date" class="mt-2" />--}}
{{--            </div>--}}
{{--            <div>--}}
{{--                <x-label for="notes" value="یادداشت‌ها (اختیاری)" />--}}
{{--                <textarea id="notes" wire:model.defer="logState.notes" class="mt-1 block w-full border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 rounded-md shadow-sm" rows="4"></textarea>--}}
{{--                <x-input-error for="logState.notes" class="mt-2" />--}}
{{--            </div>--}}
{{--            [NEW] بخش آپلود فایل--}}
{{--            <div>--}}
{{--                <x-label for="logAttachment" value="پیوست گواهی (PDF, JPG, PNG)" />--}}
{{--                <input type="file" id="logAttachment" wire:model="logAttachment" class="mt-1 block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100"/>--}}
{{--                <x-input-error for="logAttachment" class="mt-2" />--}}

{{--                <div wire:loading wire:target="logAttachment" class="mt-2 text-sm text-gray-500">در حال آپلود...</div>--}}
{{--            </div>--}}
{{--        </div>--}}
{{--    </x-slot>--}}
{{--    <x-slot name="footer">--}}
{{--        <x-secondary-button wire:click="$set('confirmingLogCreation', false)">انصراف</x-secondary-button>--}}
{{--        <x-button class="ms-3" wire:click="saveCalibrationLog">ثبت</x-button>--}}
{{--    </x-slot>--}}
{{--</x-dialog-modal>--}}
{{-- modal-calibration-log-form.blade.php --}}
<x-dialog-modal wire:model.live="confirmingLogCreation">
    <x-slot name="title">
        <h3 class="text-xl font-bold text-gray-800 dark:text-gray-200">
            ثبت کالیبراسیون برای: <span class="text-blue-600 dark:text-blue-400">{{ $equipmentForLog?->name }}</span>
        </h3>
    </x-slot>

    <x-slot name="content">
        <div class="space-y-5">
            <div>
                <x-label for="calibration_date" value="تاریخ انجام کالیبراسیون" />
                <x-jalali-date-picker id="calibration_date" wire:model="logState.calibration_date" />
                <x-input-error for="logState.calibration_date" class="mt-2" />
            </div>
            <div>
                <x-label for="notes" value="یادداشت‌ها (اختیاری)" />
                <textarea id="notes" wire:model.defer="logState.notes"
                          class="mt-1 block w-full border-gray-300 dark:border-gray-600 dark:bg-gray-900 dark:text-gray-300 rounded-lg shadow-sm focus:border-indigo-500 focus:ring-indigo-500"
                          rows="4"></textarea>
                <x-input-error for="logState.notes" class="mt-2" />
            </div>
            <div>
                <x-label for="logAttachment" value="پیوست گواهی (PDF, JPG, PNG)" />
                <div class="mt-1 flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 dark:border-gray-600 border-dashed rounded-lg">
                    <div class="space-y-1 text-center">
                        <svg class="mx-auto h-12 w-12 text-gray-400" stroke="currentColor" fill="none" viewBox="0 0 48 48" aria-hidden="true">
                            <path d="M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
                        </svg>
                        <div class="flex text-sm text-gray-600 dark:text-gray-400">
                            <label for="logAttachment" class="relative cursor-pointer bg-white dark:bg-gray-800 rounded-md font-medium text-indigo-600 dark:text-indigo-400 hover:text-indigo-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-indigo-500">
                                <span>فایل خود را آپلود کنید</span>
                                <input id="logAttachment" wire:model="logAttachment" type="file" class="sr-only">
                            </label>
                            <p class="ps-1">یا اینجا بکشید و رها کنید</p>
                        </div>
                        <p class="text-xs text-gray-500 dark:text-gray-500">PDF, PNG, JPG up to 10MB</p>
                    </div>
                </div>
                <x-input-error for="logAttachment" class="mt-2" />

                <div wire:loading wire:target="logAttachment" class="w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700 mt-2">
                    <div class="bg-blue-600 h-2.5 rounded-full" style="width: 100%"></div>
                    <p class="text-sm text-center mt-1 text-gray-600 dark:text-gray-400">در حال آپلود...</p>
                </div>
                @if ($logAttachment && !$errors->has('logAttachment'))
                    <div class="mt-2 text-sm text-green-600 dark:text-green-400">
                        فایل {{ $logAttachment->getClientOriginalName() }} با موفقیت انتخاب شد.
                    </div>
                @endif
            </div>
        </div>
    </x-slot>

    <x-slot name="footer">
        <div class="flex justify-start gap-4">
            <x-button class="ms-3" wire:click="saveCalibrationLog">ثبت</x-button>
            <x-secondary-button wire:click="$set('confirmingLogCreation', false)">انصراف</x-secondary-button>
        </div>
    </x-slot>
</x-dialog-modal>
