<div class="page-title">
    <h2><i class="bi bi-person-circle"></i> My Profile</h2>
</div>

<div class="row">
    <div class="col-md-8">
        <div class="card">
            <div class="card-body">
                <h5 class="mb-4"><i class="bi bi-pencil"></i> Update Profile</h5>
                
                <?= validation_errors('<div class="alert alert-danger">', '</div>') ?>
                
                <form method="post" action="">
                    <div class="mb-3">
                        <label class="form-label"><strong>Username *</strong></label>
                        <input type="text" class="form-control" name="username" value="<?= set_value('username', $user->username) ?>" required>
                    </div>
                    
                    <div class="mb-3">
                        <label class="form-label"><strong>Email Address *</strong></label>
                        <input type="email" class="form-control" name="email" value="<?= set_value('email', $user->email) ?>" required>
                    </div>
                    
                    <hr class="my-4">
                    
                    <h6 class="mb-3"><i class="bi bi-lock"></i> Change Password (Optional)</h6>
                    <p class="text-muted small">Leave password fields empty if you don't want to change your password.</p>
                    
                    <div class="mb-3">
                        <label class="form-label"><strong>New Password</strong></label>
                        <input type="password" class="form-control" name="new_password" placeholder="Enter new password (min 6 characters)">
                        <small class="text-muted">Minimum 6 characters</small>
                    </div>
                    
                    <div class="mb-3">
                        <label class="form-label"><strong>Confirm New Password</strong></label>
                        <input type="password" class="form-control" name="confirm_password" placeholder="Re-enter new password">
                    </div>
                    
                    <div class="mt-4">
                        <button type="submit" class="btn btn-primary btn-lg">
                            <i class="bi bi-save"></i> Update Profile
                        </button>
                        <a href="<?= base_url('admin/dashboard') ?>" class="btn btn-secondary">Cancel</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
    
    <div class="col-md-4">
        <div class="card">
            <div class="card-body">
                <h5 class="mb-3"><i class="bi bi-info-circle"></i> Account Information</h5>
                <div class="text-center mb-3">
                    <i class="bi bi-person-circle" style="font-size: 5rem; color: var(--gradient-start);"></i>
                </div>
                <p><strong>Role:</strong> <span class="badge bg-danger">Administrator</span></p>
                <p><strong>Status:</strong> <span class="badge bg-success"><?= ucfirst($user->status) ?></span></p>
                <p><strong>Member Since:</strong> <?= date('M d, Y', strtotime($user->created_at)) ?></p>
                <hr>
                <p class="small text-muted mb-0">
                    <i class="bi bi-shield-check"></i> Your account has full administrative access to all system features.
                </p>
            </div>
        </div>
        
        <div class="card mt-3">
            <div class="card-body">
                <h6><i class="bi bi-bell"></i> Security Tips</h6>
                <ul class="small mb-0">
                    <li>Use a strong password (mix of letters, numbers, symbols)</li>
                    <li>Change your password regularly</li>
                    <li>Never share your credentials</li>
                    <li>Log out when using shared computers</li>
                </ul>
            </div>
        </div>
    </div>
</div>
