<?php $__env->startSection('title', 'Profil Saya'); ?>
<?php $__env->startSection('page-title', 'Profil Karyawan'); ?>
<?php $__env->startSection('page-subtitle', 'Informasi akun dan data kepegawaian pribadi Anda.'); ?>

<?php $__env->startSection('content'); ?>
<div class="row">
    <div class="col-12 col-lg-4 mb-4">
        <div class="card shadow-sm border-0 text-center py-4">
            <div class="card-body">
                <div class="avatar avatar-2xl bg-light-primary mx-auto mb-3">
                    <?php if($employee->photo): ?>
                        <img src="<?php echo e(asset($employee->photo)); ?>" alt="Avatar" style="width: 110px; height: 110px; object-fit: cover; border-radius: 50%;">
                    <?php else: ?>
                        <span class="avatar-content fs-1"><?php echo e(strtoupper(substr($employee->name, 0, 2))); ?></span>
                    <?php endif; ?>
                </div>
                <h4 class="fw-bold mb-1"><?php echo e($employee->name); ?></h4>
                <p class="text-muted mb-2"><?php echo e($employee->email); ?></p>
                <div class="d-flex justify-content-center gap-2 mb-3">
                    <span class="badge bg-light-primary text-primary"><?php echo e($employee->position?->name ?? 'Staff'); ?></span>
                    <span class="badge bg-light-info text-info"><?php echo e($employee->department?->name ?? 'General'); ?></span>
                </div>
                <hr>
                <div class="text-start text-xs text-muted">
                    <div class="d-flex justify-content-between mb-2"><span>NIK:</span><strong><?php echo e($employee->nik); ?></strong></div>
                    <div class="d-flex justify-content-between mb-2"><span>Status:</span><span class="badge bg-success"><?php echo e(ucfirst($employee->employment_status)); ?></span></div>
                    <div class="d-flex justify-content-between mb-2"><span>Bergabung:</span><strong><?php echo e($employee->join_date ? $employee->join_date->translatedFormat('d F Y') : '-'); ?></strong></div>
                    <div class="d-flex justify-content-between"><span>Hak Cuti:</span><strong class="text-primary"><?php echo e($employee->leave_balance); ?> Hari</strong></div>
                </div>
            </div>
        </div>
    </div>

    <div class="col-12 col-lg-8">
        <div class="card shadow-sm border-0">
            <div class="card-header bg-white py-3 border-bottom">
                <h5 class="card-title mb-0 fw-bold"><i class="bi bi-pencil-square me-2 text-primary"></i> Edit Data Pribadi & Password</h5>
            </div>
            <form action="<?php echo e(route('employee.profile.update')); ?>" method="POST" enctype="multipart/form-data">
                <?php echo csrf_field(); ?>
                <?php echo method_field('PUT'); ?>
                <div class="card-body p-4">
                    <div class="row g-3">
                        <div class="col-md-6">
                            <label class="form-label fw-bold">Nomor WhatsApp Aktif</label>
                            <input type="text" name="phone" class="form-control" value="<?php echo e(old('phone', $employee->phone)); ?>" placeholder="0812xxxxxxxx">
                        </div>
                        <div class="col-md-6">
                            <label class="form-label fw-bold">Perbarui Foto Profil</label>
                            <input type="file" name="photo" class="form-control" accept="image/*">
                        </div>
                        <div class="col-12">
                            <label class="form-label fw-bold">Alamat Domisili</label>
                            <textarea name="address" class="form-control" rows="2"><?php echo e(old('address', $employee->address)); ?></textarea>
                        </div>

                        <div class="col-12"><hr class="my-2"></div>
                        <h6 class="fw-bold text-dark mb-0">Ganti Password Akun</h6>

                        <div class="col-md-4">
                            <label class="form-label text-xs fw-bold">Password Saat Ini</label>
                            <input type="password" name="current_password" class="form-control" placeholder="Password lama">
                        </div>
                        <div class="col-md-4">
                            <label class="form-label text-xs fw-bold">Password Baru</label>
                            <input type="password" name="new_password" class="form-control" placeholder="Minimal 6 karakter">
                        </div>
                        <div class="col-md-4">
                            <label class="form-label text-xs fw-bold">Konfirmasi Password Baru</label>
                            <input type="password" name="new_password_confirmation" class="form-control" placeholder="Ulangi password baru">
                        </div>
                    </div>
                </div>
                <div class="card-footer bg-light p-3 text-end">
                    <button type="submit" class="btn btn-primary px-4">
                        <i class="bi bi-save me-1"></i> Simpan Perubahan
                    </button>
                </div>
            </form>
        </div>
    </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:\laragon\www\absensi\resources\views/employee/profile/index.blade.php ENDPATH**/ ?>