<?php $__env->startSection('title', 'Profile & Account Security – Customer Portal'); ?>
<?php $__env->startSection('page_title', 'Profile & Settings'); ?>

<?php $__env->startSection('content'); ?>
<div class="max-w-4xl space-y-8">
    
    <div>
        <h2 class="text-xl font-bold text-white font-heading">Account Information & Security</h2>
        <p class="text-xs text-slate-400">Update your verified contact details, delivery address, and login credentials.</p>
    </div>

    <?php if($errors->any()): ?>
        <div class="p-4 rounded-xl bg-rose-500/10 border border-rose-500/30 text-rose-400 text-xs space-y-1">
            <span class="font-bold block">Please resolve the following errors:</span>
            <ul class="list-disc pl-5 space-y-0.5">
                <?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; ?>

    <form method="POST" action="<?php echo e(route('customer.profile.update')); ?>" class="space-y-8">
        <?php echo csrf_field(); ?>

        <!-- Contact Information -->
        <div class="bg-slate-900 border border-white/10 rounded-2xl p-6 sm:p-8 shadow-xl space-y-6">
            <h3 class="text-base font-bold text-white font-heading border-b border-white/10 pb-4 flex items-center gap-2">
                <i class="fa-solid fa-id-card text-red-500"></i> Personal & Contact Details
            </h3>

            <div class="grid grid-cols-1 sm:grid-cols-2 gap-5">
                <div>
                    <label class="block text-xs font-bold uppercase tracking-wider text-slate-300 mb-1.5">Full Name *</label>
                    <input type="text" name="name" value="<?php echo e(old('name', $user->name)); ?>" required class="w-full bg-slate-950 border border-white/10 rounded-xl px-4 py-2.5 text-white text-xs font-semibold focus:border-red-500 focus:outline-none">
                </div>
                <div>
                    <label class="block text-xs font-bold uppercase tracking-wider text-slate-300 mb-1.5">Email Address</label>
                    <input type="email" value="<?php echo e($user->email); ?>" disabled class="w-full bg-slate-950/50 border border-white/5 rounded-xl px-4 py-2.5 text-slate-500 text-xs font-semibold cursor-not-allowed">
                    <span class="text-[10px] text-slate-500 mt-1 block">Email is your permanent login identifier.</span>
                </div>
            </div>

            <div class="grid grid-cols-1 sm:grid-cols-3 gap-5">
                <div>
                    <label class="block text-xs font-bold uppercase tracking-wider text-slate-300 mb-1.5">Primary Phone / WhatsApp *</label>
                    <input type="text" name="phone" value="<?php echo e(old('phone', $user->phone ?? $customer->phone ?? '')); ?>" required class="w-full bg-slate-950 border border-white/10 rounded-xl px-4 py-2.5 text-white text-xs font-semibold focus:border-red-500 focus:outline-none" placeholder="01711-XXXXXX">
                </div>
                <div>
                    <label class="block text-xs font-bold uppercase tracking-wider text-slate-300 mb-1.5">Alternate Phone</label>
                    <input type="text" name="alternate_phone" value="<?php echo e(old('alternate_phone', $customer->alternate_phone ?? '')); ?>" class="w-full bg-slate-950 border border-white/10 rounded-xl px-4 py-2.5 text-white text-xs font-semibold focus:border-red-500 focus:outline-none" placeholder="Emergency contact">
                </div>
                <div>
                    <label class="block text-xs font-bold uppercase tracking-wider text-slate-300 mb-1.5">Preferred Contact Method *</label>
                    <select name="preferred_contact" class="w-full bg-slate-950 border border-white/10 rounded-xl px-3 py-2.5 text-white text-xs font-semibold focus:border-red-500 focus:outline-none">
                        <option value="whatsapp" <?php echo e(old('preferred_contact', $customer->preferred_contact ?? '') === 'whatsapp' ? 'selected' : ''); ?>>WhatsApp Messaging</option>
                        <option value="call" <?php echo e(old('preferred_contact', $customer->preferred_contact ?? '') === 'call' ? 'selected' : ''); ?>>Phone Voice Call</option>
                        <option value="email" <?php echo e(old('preferred_contact', $customer->preferred_contact ?? '') === 'email' ? 'selected' : ''); ?>>Email Communication</option>
                    </select>
                </div>
            </div>

            <!-- Delivery Address -->
            <div class="grid grid-cols-1 sm:grid-cols-2 gap-5 pt-2">
                <div>
                    <label class="block text-xs font-bold uppercase tracking-wider text-slate-300 mb-1.5">City</label>
                    <input type="text" name="city" value="<?php echo e(old('city', $customer->city ?? 'Dhaka')); ?>" class="w-full bg-slate-950 border border-white/10 rounded-xl px-4 py-2.5 text-white text-xs font-semibold focus:border-red-500 focus:outline-none">
                </div>
                <div>
                    <label class="block text-xs font-bold uppercase tracking-wider text-slate-300 mb-1.5">District</label>
                    <input type="text" name="district" value="<?php echo e(old('district', $customer->district ?? 'Dhaka')); ?>" class="w-full bg-slate-950 border border-white/10 rounded-xl px-4 py-2.5 text-white text-xs font-semibold focus:border-red-500 focus:outline-none">
                </div>
            </div>

            <div>
                <label class="block text-xs font-bold uppercase tracking-wider text-slate-300 mb-1.5">Street Address (For BRTA & Delivery)</label>
                <textarea name="address" rows="2" class="w-full bg-slate-950 border border-white/10 rounded-xl px-4 py-2.5 text-white text-xs font-semibold focus:border-red-500 focus:outline-none"><?php echo e(old('address', $customer->address ?? '')); ?></textarea>
            </div>
        </div>

        <!-- Password Change -->
        <div class="bg-slate-900 border border-white/10 rounded-2xl p-6 sm:p-8 shadow-xl space-y-6">
            <h3 class="text-base font-bold text-white font-heading border-b border-white/10 pb-4 flex items-center gap-2">
                <i class="fa-solid fa-lock text-amber-400"></i> Change Password
            </h3>
            <p class="text-xs text-slate-400">Leave blank if you do not wish to update your current account password.</p>

            <div class="grid grid-cols-1 sm:grid-cols-3 gap-5">
                <div>
                    <label class="block text-xs font-bold uppercase tracking-wider text-slate-300 mb-1.5">Current Password</label>
                    <input type="password" name="current_password" class="w-full bg-slate-950 border border-white/10 rounded-xl px-4 py-2.5 text-white text-xs font-semibold focus:border-red-500 focus:outline-none">
                </div>
                <div>
                    <label class="block text-xs font-bold uppercase tracking-wider text-slate-300 mb-1.5">New Password</label>
                    <input type="password" name="new_password" class="w-full bg-slate-950 border border-white/10 rounded-xl px-4 py-2.5 text-white text-xs font-semibold focus:border-red-500 focus:outline-none">
                </div>
                <div>
                    <label class="block text-xs font-bold uppercase tracking-wider text-slate-300 mb-1.5">Confirm New Password</label>
                    <input type="password" name="new_password_confirmation" class="w-full bg-slate-950 border border-white/10 rounded-xl px-4 py-2.5 text-white text-xs font-semibold focus:border-red-500 focus:outline-none">
                </div>
            </div>
        </div>

        <button type="submit" class="px-6 py-3 rounded-xl bg-red-600 hover:bg-red-700 text-white font-bold text-xs shadow-lg shadow-red-900/30 transition flex items-center gap-2">
            <i class="fa-solid fa-floppy-disk"></i>
            <span>Save Profile Updates</span>
        </button>
    </form>

</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.customer', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Users/redwoneferdous/Desktop/MotoSolution/resources/views/customer/profile.blade.php ENDPATH**/ ?>