<?php $__env->startSection('title', 'My Profile & Security'); ?>

<?php $__env->startSection('content'); ?>
<div class="max-w-4xl mx-auto space-y-6">
    <?php if(session('warning') || $user->must_change_password): ?>
        <div class="rounded-2xl border border-amber-200 bg-amber-50 px-5 py-4 text-sm text-amber-900" role="alert">
            <div class="font-bold">Password change required</div>
            <p class="mt-1"><?php echo e(session('warning', 'This account is using a temporary password. Set a private password below to unlock the ERP.')); ?></p>
        </div>
    <?php endif; ?>
    <div>
        <h1 class="text-xl font-bold text-slate-900 dark:text-white">User Profile & Security Settings</h1>
        <p class="text-xs text-slate-500 dark:text-slate-400">Manage personal information, language preferences, and security passwords.</p>
    </div>

    <!-- Personal Info Card -->
    <div class="bg-white dark:bg-slate-800 rounded-3xl p-6 border border-slate-200 dark:border-slate-700/60 shadow-sm space-y-4">
        <h3 class="text-sm font-bold text-slate-900 dark:text-white uppercase tracking-wider">Account Details</h3>

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

            <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                <div>
                    <label class="block font-semibold text-slate-700 dark:text-slate-300 mb-1">Full Name</label>
                    <input type="text" name="name" value="<?php echo e($user->name); ?>" required class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl text-slate-900 dark:text-white">
                </div>

                <div>
                    <label class="block font-semibold text-slate-700 dark:text-slate-300 mb-1">Email Address</label>
                    <input type="email" value="<?php echo e($user->email); ?>" readonly class="w-full px-3 py-2 bg-slate-100 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl text-slate-500 cursor-not-allowed">
                </div>

                <div>
                    <label class="block font-semibold text-slate-700 dark:text-slate-300 mb-1">Mobile Number</label>
                    <input type="text" name="mobile" value="<?php echo e($user->mobile); ?>" class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl text-slate-900 dark:text-white">
                </div>

                <div>
                    <label class="block font-semibold text-slate-700 dark:text-slate-300 mb-1">Preferred Language</label>
                    <select name="language" class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl text-slate-900 dark:text-white">
                        <option value="en" <?php echo e($user->language === 'en' ? 'selected' : ''); ?>>English (LTR)</option>
                        <option value="ar" <?php echo e($user->language === 'ar' ? 'selected' : ''); ?>>العربية (RTL)</option>
                    </select>
                </div>
            </div>

            <div class="flex justify-end pt-2">
                <button type="submit" class="px-5 py-2 bg-sky-600 hover:bg-sky-700 text-white font-bold rounded-xl shadow-sm">Save Profile Changes</button>
            </div>
        </form>
    </div>

    <!-- Security & Password Card -->
    <div class="bg-white dark:bg-slate-800 rounded-3xl p-6 border border-slate-200 dark:border-slate-700/60 shadow-sm space-y-4">
        <h3 class="text-sm font-bold text-slate-900 dark:text-white uppercase tracking-wider">Change Password</h3>

        <form action="<?php echo e(route('app.profile.password')); ?>" method="POST" class="space-y-4 text-xs">
            <?php echo csrf_field(); ?>

            <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                <div>
                    <label class="block font-semibold text-slate-700 dark:text-slate-300 mb-1">Current Password *</label>
                    <input type="password" name="current_password" required class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl text-slate-900 dark:text-white">
                </div>

                <div>
                    <label class="block font-semibold text-slate-700 dark:text-slate-300 mb-1">New Password *</label>
                    <input type="password" name="password" required class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl text-slate-900 dark:text-white">
                </div>

                <div>
                    <label class="block font-semibold text-slate-700 dark:text-slate-300 mb-1">Confirm New Password *</label>
                    <input type="password" name="password_confirmation" required class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl text-slate-900 dark:text-white">
                </div>
            </div>

            <div class="flex justify-end pt-2">
                <button type="submit" class="px-5 py-2 bg-sky-600 hover:bg-sky-700 text-white font-bold rounded-xl shadow-sm">Update Password</button>
            </div>
        </form>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\typingcenter\resources\views\tenant\profile.blade.php ENDPATH**/ ?>