<?php $__env->startSection('title', 'Edit Profile'); ?>

<?php $__env->startSection('content'); ?>

<div class="d-flex justify-content-between align-items-center mb-4">
    <div>
        <h1 class="h3 mb-1 text-gray-800 fw-bold">Edit Profile</h1>
        <p class="text-muted small">Update your username and profile picture</p>
    </div>
</div>

<div class="row g-5">
    
    <div class="col-lg-8">
        <div class="card shadow border-0 h-100">
            <div class="card-header py-4 text-white text-center fw-bold"
                 style="background: linear-gradient(90deg, #4e73df, #224abe);">
                <h5 class="mb-0">Profile Settings</h5>
            </div>

            <div class="card-body p-5">
                <form method="POST" action="<?php echo e(route('user.profile.updateprofile')); ?>" enctype="multipart/form-data">
                    <?php echo csrf_field(); ?>

                    
                    <div class="mb-4">
                        <label class="form-label fw-bold">Email Address</label>
                        <input type="email"
       name="email"
       class="form-control form-control-lg bg-white"
       value="<?php echo e($user->email); ?>"
       readonly>

                    </div>

                    
                    <div class="mb-4">
                        <label class="form-label fw-bold">Username</label>
                        <input type="text"
                               name="name"
                               class="form-control form-control-lg <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                               value="<?php echo e(old('name', $user->name)); ?>"
                               required>
                        <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <div class="invalid-feedback d-block mt-2"><?php echo e($message); ?></div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>


<div class="mb-4">
    <label class="form-label fw-bold">Player Type</label>
    <select name="player_type"
            class="form-control form-control-lg <?php $__errorArgs = ['player_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
            required>
        <option value="java" <?php echo e($user->player_type == 'java' ? 'selected' : ''); ?>>
            Java Edition
        </option>
        <option value="bedrock" <?php echo e($user->player_type == 'bedrock' ? 'selected' : ''); ?>>
            Bedrock Edition
        </option>
    </select>

    <?php $__errorArgs = ['player_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
        <div class="invalid-feedback d-block mt-2"><?php echo e($message); ?></div>
    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>



                    
                    <div class="mb-5">
                        <label class="form-label fw-bold">Profile Picture</label>
                        <input type="file"
                               name="avatar"
                               id="avatarInput"
                               class="form-control form-control-lg <?php $__errorArgs = ['avatar'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                               accept="image/*">
                        <div class="form-text">Max 2MB • PNG, JPG, JPEG only</div>
                        <?php $__errorArgs = ['avatar'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <div class="invalid-feedback d-block mt-2"><?php echo e($message); ?></div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>

                    
                    <div class="d-flex flex-wrap gap-3">
                        <button type="submit" class="btn btn-primary btn-lg px-5 shadow-sm fw-bold">
                            Save Changes
                        </button>
                        <a href="<?php echo e(route('profile.index')); ?>" class="btn btn-outline-secondary btn-lg px-5">
                            Cancel
                        </a>
                    </div>
                </form>
            </div>
        </div>
    </div>

    
    <div class="col-lg-4">
        <div class="card shadow border-0 text-center h-100">
            <div class="card-header py-4 text-white fw-bold"
                 style="background: linear-gradient(90deg, #4e73df, #224abe);">
                Current Avatar
            </div>
            <div class="card-body p-5">
                <img src="<?php echo e($user->profile_image_path
                    ? asset('storage/avatar/' . $user->profile_image_path)
                    : asset('img/undraw_profile.svg')); ?>"
                     alt="Current Profile Picture"
                     class="rounded-circle shadow-lg border border-5 border-white mb-4"
                     style="width: 220px; height: 220px; object-fit: cover;">
                <p class="text-muted">This is how others see you</p>
            </div>
        </div>
    </div>
</div>


<style>
    .card:hover {
        transform: translateY(-8px);
        box-shadow: 0 1.5rem 3.5rem rgba(0,0,0,.2) !important;
        transition: all 0.4s ease;
    }
    .form-control-lg {
        height: 56px;
        border-radius: 12px;
    }
    .form-text {
        font-size: 0.9rem;
        color: #6c757d;
    }
    @media (max-width: 768px) {
        .row.g-5 > div { margin-bottom: 2rem; }
        img[alt="Current Profile Picture"] {
            width: 180px !important;
            height: 180px !important;
        }
    }
</style>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('manage.user.index', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp8.2\htdocs\MCCMS\resources\views/manage/user/profile/editprofile.blade.php ENDPATH**/ ?>