/* =====================================================================
   profile.css — Student profile (EN + KM, Light / Dark / Auto)
   ===================================================================== */
:root {
  --pf-bg: #eef2f8; --pf-card: #ffffff; --pf-soft: #f3f6fb; --pf-line: #e2e8f0; --pf-text: #0f172a; --pf-muted: #64748b;
  --pf-brand: #0b2a55; --pf-brand2: #1d4ed8; --pf-accent: #f59e0b; --pf-red: #dc2626; --pf-ok: #059669;
  --pf-shadow: 0 10px 30px rgba(15,23,42,.08);
}
html[data-theme="dark"] {
  --pf-bg: #0f1522; --pf-card: #171f2e; --pf-soft: #1f293b; --pf-line: #2b3850; --pf-text: #e6edf7; --pf-muted: #9aa6ba;
  --pf-red: #f87171; --pf-ok: #34d399; --pf-shadow: 0 10px 30px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html[data-theme] body.pf-page { min-height: 100vh; background: var(--pf-bg) !important; color: var(--pf-text); font-family: "Inter", "Kantumruy Pro", sans-serif; }
body.pf-page.lang-km { font-family: "Kantumruy Pro", "Inter", sans-serif; }
.pf-wrap { max-width: 720px; margin: 0 auto; padding: 16px 14px 40px; }
.pf-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.pf-back, .pf-out-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; font: inherit; font-weight: 700; font-size: .88rem; text-decoration: none; cursor: pointer; border: 1px solid var(--pf-line); background: var(--pf-card); color: var(--pf-text); }
.pf-back:hover { border-color: var(--pf-brand2); }
.pf-out-btn { color: var(--pf-red); }
.pf-out-btn:hover { background: rgba(220,38,38,.08); border-color: var(--pf-red); }
.pf-page .portal-bar { margin-bottom: 14px; background: var(--pf-card); }

.pf-card { position: relative; background: var(--pf-card); border: 1px solid var(--pf-line); border-radius: 20px; box-shadow: var(--pf-shadow); padding: 20px; margin-bottom: 14px; overflow: hidden; animation: pfIn .4s ease; }
.pf-card[hidden] { display: none; }
@keyframes pfIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.pf-h { margin: 0 0 10px; font-size: 1.05rem; font-weight: 800; color: var(--pf-text) !important; }

/* hero */
.pf-hero { text-align: center; padding-top: 0; }
.pf-cover { height: 110px; margin: 0 -20px; background: radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,.18) 0, rgba(255,255,255,0) 45%), linear-gradient(135deg, var(--pf-brand), var(--pf-brand2) 60%, #0ea5a4); }
.pf-avatar-wrap { position: relative; width: 120px; height: 120px; margin: -60px auto 10px; }
.pf-avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid var(--pf-card); box-shadow: 0 0 0 3px var(--pf-accent), 0 8px 20px rgba(0,0,0,.2); background: var(--pf-soft); }
.pf-cam { position: absolute; right: 2px; bottom: 6px; width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--pf-card); background: var(--pf-ok); color: #fff; font-size: 16px; cursor: pointer; display: grid; place-items: center; box-shadow: 0 4px 10px rgba(0,0,0,.2); }
.pf-cam:hover { filter: brightness(1.1); }
.pf-cam:disabled { opacity: .6; cursor: wait; }
.pf-upl { position: absolute; inset: 0; border-radius: 50%; background: rgba(0,0,0,.35); display: grid; place-items: center; }
.pf-upl[hidden] { display: none; }
.pf-upl span { width: 34px; height: 34px; border: 4px solid #fff; border-right-color: transparent; border-radius: 50%; animation: pfSpin .8s linear infinite; }
@keyframes pfSpin { to { transform: rotate(360deg); } }
.pf-name { margin: 4px 0 2px; font-size: 1.45rem; font-weight: 800; color: var(--pf-text) !important; overflow-wrap: anywhere; }
.pf-name span:first-child { font-weight: 600; color: var(--pf-muted); font-size: 1rem; display: block; }
.pf-email { margin: 0 0 10px; color: var(--pf-muted); font-size: .9rem; overflow-wrap: anywhere; }
.pf-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pf-chip { padding: 5px 12px; border-radius: 999px; background: var(--pf-soft); border: 1px solid var(--pf-line); font-size: .85rem; font-weight: 700; }
.pf-note { min-height: 1em; margin: 10px 0 0; font-size: .85rem; font-weight: 600; color: var(--pf-ok); }
.pf-note.err { color: var(--pf-red); }

/* details */
.pf-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pf-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--pf-soft); border: 1px solid var(--pf-line); min-width: 0; }
.pf-row:nth-last-child(2) { grid-column: 1 / -1; }   /* address full width */
.pf-ic { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--pf-card); font-size: 16px; }
.pf-row-txt { min-width: 0; }
.pf-row-txt small { display: block; font-size: .75rem; color: var(--pf-muted); font-weight: 600; }
.pf-row-txt b { display: block; font-size: .95rem; line-height: 1.4; overflow-wrap: anywhere; }
.pf-row-txt b small { color: var(--pf-muted); font-weight: 500; }
.pf-row a { color: var(--pf-brand2); text-decoration: none; }
html[data-theme="dark"] .pf-row a { color: #93c5fd; }

/* links */
.pf-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pf-link { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; background: var(--pf-soft); border: 1px solid var(--pf-line); color: var(--pf-text); text-decoration: none; transition: transform .15s, border-color .15s; }
.pf-link:hover { transform: translateY(-2px); border-color: var(--pf-brand2); }
.pf-link span { font-size: 22px; }
.pf-link b { font-size: .92rem; }
.pf-link small { font-size: .78rem; color: var(--pf-muted); }

/* empty + skeleton */
.pf-empty { text-align: center; }
.pf-empty-ic { font-size: 40px; }
.pf-empty h2 { margin: 6px 0; color: var(--pf-text) !important; }
.pf-empty p { margin: 0; color: var(--pf-muted); }
.pf-skel { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sk { background: linear-gradient(90deg, var(--pf-soft), var(--pf-line), var(--pf-soft)); background-size: 200% 100%; animation: pfShine 1.2s infinite; border-radius: 10px; }
.sk-av { width: 110px; height: 110px; border-radius: 50%; }
.sk-l { width: 60%; height: 22px; } .sk-s { width: 40%; height: 14px; } .sk-row { width: 100%; height: 48px; }
@keyframes pfShine { to { background-position: -200% 0; } }

/* modal */
.pf-modal { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 16px; background: rgba(2,6,23,.55); backdrop-filter: blur(4px); }
.pf-modal[hidden] { display: none; }
.pf-modal-card { width: min(360px, 100%); background: var(--pf-card); color: var(--pf-text); border-radius: 20px; padding: 22px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.35); animation: pfIn .2s ease; }
.pf-modal-ic { font-size: 36px; }
.pf-modal-card h3 { margin: 6px 0 4px; color: var(--pf-text) !important; }
.pf-modal-card p { margin: 0 0 16px; color: var(--pf-muted); font-size: .9rem; }
.pf-modal-btns { display: flex; gap: 8px; }
.pf-btn { flex: 1; padding: 11px; border-radius: 12px; border: 1px solid var(--pf-line); font: inherit; font-weight: 800; cursor: pointer; }
.pf-btn.ghost { background: var(--pf-soft); color: var(--pf-text); }
.pf-btn.danger { background: #ef4444; border-color: #ef4444; color: #fff; }
.pf-btn:disabled { opacity: .7; cursor: wait; }

/* delete account */
.pf-danger { border-color: rgba(220,38,38,.35); }
.pf-danger .pf-h { color: var(--pf-red) !important; }
.pf-danger-txt { margin: 0 0 12px; color: var(--pf-muted); font-size: .9rem; }
.pf-del-open { flex: none; width: auto; padding: 10px 16px; display: inline-flex; gap: 6px; align-items: center; }
.pf-del-card { text-align: center; }
.pf-del-field { display: block; text-align: left; margin-bottom: 10px; }
.pf-del-field span { display: block; font-size: .8rem; font-weight: 700; color: var(--pf-muted); margin-bottom: 4px; }
.pf-del-field input { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--pf-line) !important; background: var(--pf-soft) !important; color: var(--pf-text) !important; font: inherit; outline: none; }
.pf-del-field input:focus { border-color: var(--pf-red) !important; box-shadow: 0 0 0 3px rgba(220,38,38,.15); }
.pf-del-field input.good { border-color: var(--pf-ok) !important; }
.pf-del-err { min-height: 1.2em; margin: 0 0 10px !important; color: var(--pf-red) !important; font-weight: 600; font-size: .85rem; }
.pf-btn.danger:disabled { opacity: .45; cursor: not-allowed; }

.pf-foot { text-align: center; color: var(--pf-muted); font-size: .8rem; margin-top: 20px; }

@media (max-width: 560px) {
  .pf-list { grid-template-columns: 1fr; }
  .pf-links { grid-template-columns: 1fr; }
  .pf-link { flex-direction: row; align-items: center; gap: 10px; }
  .pf-link small { margin-left: auto; text-align: right; }
}
