<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>My Profile</title>
  <?= $this->include("admin/layout/partials/styles") ?>
  <style>
    .profile-wrap { max-width: 1080px; margin: 0 auto; }
    .side-card { border: 1px solid #e9ecef; border-radius: 10px; background: #fff; overflow: hidden; }
    .side-head { padding: 12px 14px; font-weight: 700; border-bottom: 1px solid #e9ecef; }
    .side-menu .item { display: block; padding: 12px 14px; border-bottom: 1px solid #f1f3f5; color: #002f34; text-decoration: none; }
    .side-menu .item:hover { background: rgba(0,47,52,.06); }
    .side-menu .item.active { background: #007bff; color: #fff; }
    .content-card { background: #fff; border: 1px solid #e9ecef; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.06); }
    .content-head { padding: 10px 12px; border-bottom: 1px solid #e9ecef; }
    .nav-pills .nav-link.active { background-color: #007bff; }
    .profile-table td { vertical-align: middle; }
  </style>
</head>
<body class="hold-transition layout-top-nav">
<div class="wrapper">
  <?= $this->include('frontend/partials/top_navbar') ?>
  <div class="content-wrapper rm-mobile-pad">
    <section class="content">
      <div class="container py-3">
        <h1 class="h4 mb-3">My Profile</h1>
        <div class="row">
          <div class="col-md-3 mb-3">
            <?= $this->include('frontend/user/partials/side_menu') ?>
          </div>
          <div class="col-md-9">
            <div class="content-card">
              <div class="content-head">
                <ul class="nav nav-pills">
                  <li class="nav-item"><a class="nav-link active" href="#tab_profile" data-toggle="tab">Profile</a></li>
                  <li class="nav-item"><a class="nav-link disabled" href="javascript:void(0)">Edit</a></li>
                  <li class="nav-item"><a class="nav-link disabled" href="javascript:void(0)">Change Profile Image</a></li>
                  <li class="nav-item"><a class="nav-link disabled" href="javascript:void(0)">Change Password</a></li>
                </ul>
              </div>
              <div class="p-3">
                <div class="tab-content">
                  <div class="active tab-pane" id="tab_profile">
                    <table class="table table-bordered profile-table mb-0">
                      <tbody>
                        <tr><td width="240"><strong>Name:</strong></td><td><?= esc($user->name ?? '-') ?></td></tr>
                        <tr><td><strong>Username:</strong></td><td><?= esc($user->username ?? '-') ?></td></tr>
                        <tr><td><strong>Email:</strong></td><td><?= esc($user->email ?? '-') ?></td></tr>
                        <tr><td><strong>Role:</strong></td><td><?= esc($user->role ?? '-') ?></td></tr>
                        <tr><td><strong>Contact Number:</strong></td><td><?= esc($user->phone ?? '-') ?></td></tr>
                        <tr><td><strong>Address:</strong></td><td><?= esc($user->address ?? '-') ?></td></tr>
                        <tr><td><strong>Last Login:</strong></td><td><?= !empty($user->last_login) ? date('h:i a - d M, Y', strtotime($user->last_login)) : '-' ?></td></tr>
                        <tr><td><strong>Member Since:</strong></td><td><?= !empty($user->created_at) ? date('h:i a - d M, Y', strtotime($user->created_at)) : '-' ?></td></tr>
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </div>
</div>
<?= $this->include('frontend/partials/rm_bottom_nav') ?>
<?= $this->include("admin/layout/partials/scripts") ?>
</body>
</html>
