@import url('./dashboard.css');

/* ================================================================
   FERPEDIA — PROFIL (Premium Account · Natural Navy & White)
   ================================================================ */
body { font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #F7F9FC; }
button, input { font-family: inherit; }
.page-title { font-weight: 800; color: #102A43; letter-spacing: -.01em; }
.profile-page { max-width: 560px; margin: 0 auto; width: 100%; }

/* shimmer */
.sk-line { display: inline-block; width: 60%; height: 14px; border-radius: 6px; }
.sk-light { display: inline-block; border-radius: 8px; background: linear-gradient(90deg, rgba(255,255,255,.12), rgba(255,255,255,.28), rgba(255,255,255,.12)); background-size: 200% 100%; animation: pf-shimmer 1.3s linear infinite; }
@keyframes pf-shimmer { to { background-position: -200% 0; } }

/* ─── HERO ────────────────────────────────────────────────────────────────── */
.profile-hero {
  margin: 14px 16px 0; padding: 28px 20px 20px; text-align: center; color: #fff;
  background: #163B5C; background: linear-gradient(160deg, #1B4768 0%, #102A43 100%);
  border-radius: 28px; box-shadow: 0 22px 40px -24px rgba(16,42,67,.75);
  border: 0;
}
.profile-avatar-wrap { position: relative; display: inline-block; width: 96px; height: 96px; margin: 0 auto 14px; }
.profile-avatar-wrap img {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; background: #EAF2F8;
  border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.18);
}
.avatar-edit-btn {
  position: absolute; right: -2px; bottom: 2px; width: 32px; height: 32px; border-radius: 50%;
  background: #1677E8; color: #fff; border: 2.5px solid #fff; cursor: pointer;
  display: grid; place-items: center; transition: transform .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.avatar-edit-btn:hover { transform: scale(1.06); }
.avatar-edit-btn:active { transform: scale(.92); }
.avatar-edit-btn svg { width: 15px; height: 15px; display: block; }
.profile-username { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; min-height: 30px; display: flex; align-items: center; justify-content: center; word-break: break-word; }
.profile-email { font-size: .82rem; color: rgba(255,255,255,.74); min-height: 20px; margin-top: 2px; display: flex; align-items: center; justify-content: center; word-break: break-all; }
.profile-role-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 5px 12px; border-radius: 999px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
  font-size: .72rem; font-weight: 700; color: #fff; letter-spacing: .02em; background-clip: padding-box;
}
.profile-role-badge svg { width: 13px; height: 13px; display: block; }

.profile-stats { display: flex; margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.16); }
.profile-stat { flex: 1; min-width: 0; text-align: center; padding: 0 6px; border-right: 1px solid rgba(255,255,255,.14); }
.profile-stat:last-child { border-right: none; }
.profile-stat:first-child { flex: 1.7; }
.profile-stat-val { font-size: 1rem; font-weight: 800; color: #fff; margin-bottom: 2px; white-space: nowrap; }
.profile-stat-label { font-size: .68rem; color: rgba(255,255,255,.65); font-weight: 600; }

/* ─── SECTIONS ────────────────────────────────────────────────────────────── */
.profile-section { padding: 18px 16px; padding-bottom: calc(var(--bottom-nav-h) + 20px + env(safe-area-inset-bottom, 0px)); }
.profile-menu-group { margin-bottom: 18px; }
.profile-menu-label { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: #647789; margin: 0 0 8px 6px; }

.profile-menu-list, .info-card {
  background: #fff; border: 1px solid #DFE7EF; border-radius: 20px; overflow: hidden;
  box-shadow: 0 10px 24px -18px rgba(16,42,67,.35);
}

/* info card */
.info-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid #EEF3F8; }
.info-row:last-child { border-bottom: 0; }
.info-ic { width: 36px; height: 36px; border-radius: 11px; background: #EAF2F8; color: #28577A; display: grid; place-items: center; flex-shrink: 0; }
.info-ic svg { width: 17px; height: 17px; display: block; }
.info-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.info-label { font-size: .68rem; color: #647789; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.info-val { font-size: .88rem; color: #172B3A; font-weight: 700; overflow-wrap: anywhere; }
.info-val.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; letter-spacing: .02em; }

/* menu items */
.profile-menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px 16px; text-align: left;
  background: transparent; border: 0; border-bottom: 1px solid #EEF3F8; cursor: pointer; text-decoration: none; color: #172B3A;
  transition: background .18s ease, transform .12s ease; -webkit-tap-highlight-color: transparent;
}
.profile-menu-item:last-child { border-bottom: 0; }
.profile-menu-item:hover { background: #F4F8FC; }
.profile-menu-item:active { background: #EAF2F8; transform: scale(.995); }
.menu-icon { width: 38px; height: 38px; border-radius: 12px; background: #EAF2F8; color: #163B5C; display: grid; place-items: center; flex-shrink: 0; }
.menu-icon svg { width: 18px; height: 18px; display: block; }
.menu-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.menu-name { font-size: .88rem; font-weight: 700; color: #102A43; }
.menu-desc { font-size: .72rem; color: #647789; line-height: 1.35; }
.menu-arrow { color: #9AAABA; flex-shrink: 0; transition: transform .18s ease; }
.menu-arrow svg { width: 16px; height: 16px; display: block; }
.profile-menu-item:hover .menu-arrow { transform: translateX(2px); color: #28577A; }
.profile-menu-item.is-logout .menu-icon { background: #FDF1F0; color: #B42318; }
.profile-menu-item.is-logout .menu-name { color: #B42318; }
.profile-foot { text-align: center; padding: 4px 0 8px; font-size: .7rem; color: #647789; }

/* ─── SHEETS ──────────────────────────────────────────────────────────────── */
.modal-overlay { z-index: 10000; background: rgba(16,42,67,.55); }
.modal-sheet { border-radius: 26px 26px 0 0; padding: 14px 20px calc(20px + env(safe-area-inset-bottom, 0px)); max-width: 520px; max-height: 92vh; overflow-y: auto; box-shadow: none; }
.modal-handle { width: 40px; margin-bottom: 14px; }
.modal-title { font-size: 1.1rem; font-weight: 800; color: #102A43; margin-bottom: 14px; }
.field-label { display: block; font-size: .72rem; font-weight: 800; color: #172B3A; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
.modal-input {
  width: 100%; box-sizing: border-box; min-height: 48px; padding: 12px 14px; margin-bottom: 6px;
  background: #F7F9FC; border: 1.5px solid #DFE7EF; border-radius: 14px; color: #172B3A;
  font-size: .92rem; font-weight: 600; outline: none; transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.modal-input:focus { border-color: #28577A; background: #fff; box-shadow: 0 0 0 4px rgba(40,87,122,.10); }
.modal-input.invalid { border-color: #D14343; }
.field-error { min-height: 18px; font-size: .74rem; color: #B42318; margin-bottom: 8px; }
.btn-save-modal {
  width: 100%; min-height: 50px; border: 0; border-radius: 14px; cursor: pointer; color: #fff;
  background: #163B5C; background: linear-gradient(180deg, #1B4768, #163B5C);
  font-size: .92rem; font-weight: 800; box-shadow: 0 12px 24px -12px rgba(16,42,67,.65);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .15s ease, opacity .2s ease; -webkit-tap-highlight-color: transparent;
}
.btn-save-modal:hover { background: #102A43; }
.btn-save-modal:active:not(:disabled) { transform: scale(.98); }
.btn-save-modal:disabled { opacity: .75; cursor: progress; }
.btn-cancel-modal {
  width: 100%; min-height: 46px; margin-top: 8px; border: 1px solid #DFE7EF; border-radius: 14px; background: #fff;
  color: #647789; font-size: .88rem; font-weight: 700; cursor: pointer; transition: background .2s ease;
}
.btn-cancel-modal:hover { background: #F4F8FC; }
.edit-avatar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.edit-avatar img { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; border: 3px solid #EAF2F8; background: #EAF2F8; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: 12px; cursor: pointer;
  background: #EAF2F8; border: 1px solid #C9DBEA; color: #163B5C; font-size: .82rem; font-weight: 700;
}
.btn-ghost svg { width: 16px; height: 16px; }
.logout-head { text-align: center; margin-bottom: 18px; }
.logout-ic { width: 56px; height: 56px; margin: 4px auto 12px; border-radius: 50%; background: #EAF2F8; color: #163B5C; display: grid; place-items: center; }
.logout-ic svg { width: 24px; height: 24px; }
.logout-sub { font-size: .82rem; color: #647789; }
.logout-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (max-width: 360px) {
  .profile-hero { margin: 12px 12px 0; padding: 24px 14px 16px; }
  .profile-section { padding-left: 12px; padding-right: 12px; }
  .profile-stat-val { font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sk-light { animation: none; } .menu-arrow, .profile-menu-item, .avatar-edit-btn { transition: none; }
}
