/* ═══════════════════════════════════════════════════
   Profile page — نسخهٔ کامل با دیتیل
   ═══════════════════════════════════════════════════ */
.profile-scroll{
  flex:1;min-height:0;overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  scrollbar-color:#2b3a4a transparent;
}
.profile-scroll::-webkit-scrollbar{width:6px}
.profile-scroll::-webkit-scrollbar-thumb{background:#2b3a4a;border-radius:999px}

.profile-wrap{
  max-width:680px;
  margin:0 auto;
  padding:16px 20px 32px;
  animation: profileFadeIn .4s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes profileFadeIn{
  from{opacity:0;transform:translateY(10px)}
  to  {opacity:1;transform:translateY(0)}
}

/* ── Alert ── */
.profile-alert{
  display:flex;align-items:flex-start;gap:10px;
  padding:11px 14px;
  border-radius:11px;
  font-size:13px;line-height:1.6;
  margin-bottom:14px;
  border:1px solid var(--line-soft);
  background:var(--bg-elevated);
  color:var(--text);
  animation: profileFadeIn .3s var(--transition);
}
.profile-alert::before{
  content:"ℹ";
  flex-shrink:0;
  font-size:15px;
  color:var(--accent-hover);
}
.profile-alert-success{
  border-color:rgba(63,185,80,.35);
  background:rgba(63,185,80,.08);
  color:#7ee787;
}
.profile-alert-success::before{content:"✓";color:#7ee787}
.profile-alert-error,
.profile-alert-danger{
  border-color:rgba(248,81,73,.35);
  background:rgba(248,81,73,.08);
  color:#f8a5a0;
}
.profile-alert-error::before,
.profile-alert-danger::before{content:"⚠";color:#f8a5a0}


/* ── کارت اصلی ── */
.profile-page-card{
  background:var(--bg-elevated);
  border:1px solid var(--line-soft);
  border-radius:18px;
  overflow:hidden;
  box-shadow:var(--shadow-pop);
  position:relative;
}

/* ── کاور ── */
.profile-page-cover{
  height:140px;
  position:relative;
  overflow:hidden;
  background:
    radial-gradient(circle at 25% 30%, rgba(82,136,193,.4), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(82,136,193,.18), transparent 55%),
    linear-gradient(135deg, #1b2735, #243140);
  border-bottom:1px solid var(--line-soft);
}
/* الگوی نقطه‌چین روی کاور */
.profile-page-cover::before{
  content:"";
  position:absolute;inset:0;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
/* گرادیان تیره در پایین کاور برای خوانایی */
.profile-page-cover::after{
  content:"";
  position:absolute;inset:auto 0 0 0;
  height:50%;
  background: linear-gradient(to top, rgba(0,0,0,.25), transparent);
  pointer-events:none;
}


/* ── بدنه ── */
.profile-page-body{padding:0 24px 24px}


/* ── هدر: آواتار + هویت ── */
.profile-page-head{
  display:flex;
  align-items:flex-start;
  gap:18px;
  margin-top:-52px;
  margin-bottom:20px;
  position:relative;
  z-index:1;
}

.profile-page-avatar{
  flex:0 0 auto;
  width:104px;height:104px;
  border-radius:50%;
  background: linear-gradient(135deg, var(--accent), #3a6fa0);
  color:#fff;
  display:flex;align-items:center;justify-content:center;
  font-size:38px;font-weight:600;
  overflow:hidden;
  border:4px solid var(--bg-elevated);
  box-shadow:
    0 8px 28px rgba(0,0,0,.5),
    0 0 0 1px var(--line-soft);
  transition: transform .25s var(--transition);
  position:relative;
}
.profile-page-avatar:hover{
  transform: scale(1.03) rotate(-1deg);
}
.profile-page-avatar img{
  width:100%;height:100%;object-fit:cover;
}
/* نشان آنلاین روی آواتار */
.profile-page-avatar.is-online::after{
  content:"";
  position:absolute;
  bottom:6px;inset-inline-end:6px;
  width:16px;height:16px;
  background:#3fb950;
  border:3px solid var(--bg-elevated);
  border-radius:50%;
  box-shadow:0 0 10px rgba(63,185,80,.6);
  animation: onlinePulse 2s ease-in-out infinite;
}
@keyframes onlinePulse{
  0%,100%{box-shadow:0 0 10px rgba(63,185,80,.6)}
  50%    {box-shadow:0 0 18px rgba(63,185,80,.9)}
}

.profile-page-identity{
  flex:1;
  min-width:0;
  padding-top:58px;
}
.profile-page-name{
  margin:0 0 6px;
  font-size:20px;
  font-weight:600;
  color:var(--text);
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  letter-spacing:-.01em;
}
.profile-page-username{
  margin:0;
  font-size:13px;
  color:var(--text-dim);
  display:flex;
  align-items:center;
  gap:6px;
}
.profile-page-username::before{
  content:"@";
  color:var(--accent-hover);
  opacity:.7;
}
.profile-page-bio{
  margin:12px 0 0;
  font-size:13.5px;
  line-height:1.75;
  color:var(--text-2);
  padding:10px 14px;
  background:var(--bg-input);
  border-inline-start:3px solid var(--accent);
  border-radius:8px;
}


/* ── بج نقش ── */
.role-badge{
  display:inline-flex;
  align-items:center;
  gap:4px;
  font-size:11px;
  font-weight:500;
  padding:3px 9px;
  border-radius:999px;
  vertical-align:middle;
  line-height:1.4;
}
.role-scientist{
  background:rgba(82,136,193,.15);
  color:var(--accent-hover);
  border:1px solid rgba(82,136,193,.35);
  box-shadow: 0 0 12px rgba(82,136,193,.15);
}
.role-user{
  background:var(--bg-input);
  color:var(--text-2);
  border:1px solid var(--line-soft);
}


/* ═══════════════════════════════════════════════════
   Stats (۳ عدد کنار هم)
   ═══════════════════════════════════════════════════ */
.profile-stats{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:10px;
  margin:20px 0 6px;
}
.profile-stat{
  padding:14px 12px;
  background:var(--bg-input);
  border:1px solid var(--line-soft);
  border-radius:12px;
  text-align:center;
  transition: border-color .15s, transform .15s, background .15s;
  cursor: default;
}
.profile-stat:hover{
  border-color:var(--accent);
  background:var(--bg-hover);
  transform: translateY(-2px);
}
.profile-stat-value{
  font-size:20px;
  font-weight:600;
  color:var(--text);
  line-height:1.2;
  display:block;
  margin-bottom:2px;
}
.profile-stat-label{
  font-size:11px;
  color:var(--text-dim);
  text-transform:uppercase;
  letter-spacing:.05em;
}


/* ═══════════════════════════════════════════════════
   گرید اطلاعات
   ═══════════════════════════════════════════════════ */
.profile-page-info{
  list-style:none;
  padding:0;
  margin:22px 0 0;
  border-top:1px solid var(--line-soft);
}
.profile-page-info li{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:13px 4px;
  border-bottom:1px solid var(--line-soft);
  font-size:13px;
  transition: background .15s, padding .15s;
  position:relative;
}
.profile-page-info li:hover{
  background: var(--bg-input);
  padding-inline: 10px;
  border-radius: 8px;
}
.profile-page-info li span{
  color:var(--text-dim);
  font-size:12.5px;
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}
.profile-page-info li span::before{
  content:"";
  width:6px;height:6px;
  border-radius:50%;
  background: var(--line);
}
.profile-page-info li:hover span::before{
  background: var(--accent);
}

.profile-page-info li b{
  color:var(--text);
  font-weight:500;
  text-align:end;
  word-break:break-word;
  min-width:0;
  display:flex;
  align-items:center;
  gap:8px;
  justify-content:flex-end;
}
.profile-page-info li b.empty{
  color:var(--text-dim);
  font-weight:400;
  font-style:italic;
}

/* ── دکمهٔ کپی روی هر ردیف ── */
.copy-btn{
  flex-shrink:0;
  width:26px;height:26px;
  display:grid;place-items:center;
  background:transparent;
  color:var(--text-dim);
  border:1px solid transparent;
  border-radius:7px;
  cursor:pointer;
  opacity:0;
  transition: opacity .15s, background .15s, color .15s, border-color .15s;
}
.profile-page-info li:hover .copy-btn{
  opacity:1;
}
.copy-btn:hover{
  background:var(--bg-hover);
  color:var(--accent-hover);
  border-color:var(--line-soft);
}
.copy-btn.copied{
  color:#7ee787;
  background:rgba(63,185,80,.12);
  border-color:rgba(63,185,80,.35);
  opacity:1;
}
.copy-btn svg{
  width:14px;height:14px;
  pointer-events:none;
}


/* ── دات وضعیت ── */
.status-dot{
  display:inline-block;
  width:8px;height:8px;
  border-radius:50%;
  margin-inline-end:2px;
  vertical-align:middle;
}
.status-dot.online{
  background:#3fb950;
  box-shadow:0 0 8px rgba(63,185,80,.7);
  animation: onlinePulse 2s ease-in-out infinite;
}
.status-dot.offline{background:#8a8f98}


/* ═══════════════════════════════════════════════════
   اکشن‌ها
   ═══════════════════════════════════════════════════ */
.profile-page-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:22px;
  padding-top:20px;
  border-top:1px solid var(--line-soft);
}
.profile-page-actions .btn-primary,
.profile-page-actions .btn-secondary,
.profile-page-actions .btn-danger{
  flex:1;
  min-width:140px;
  padding:12px 16px;
  border-radius:11px;
  font-family:inherit;
  font-size:13.5px;
  font-weight:500;
  text-align:center;
  text-decoration:none;
  cursor:pointer;
  border:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  transition:
    background .15s var(--transition),
    transform .1s var(--transition),
    box-shadow .15s var(--transition);
}
.profile-page-actions .btn-primary{
  background:var(--accent);
  color:#fff;
  box-shadow:0 4px 14px rgba(82,136,193,.35);
}
.profile-page-actions .btn-primary:hover{
  background:var(--accent-hover);
  box-shadow:0 6px 20px rgba(82,136,193,.5);
  transform:translateY(-1px);
}
.profile-page-actions .btn-primary:active{
  transform:translateY(0) scale(.98);
}
.profile-page-actions .btn-secondary{
  background:var(--bg-input);
  color:var(--text-2);
  border:1px solid var(--line-soft);
}
.profile-page-actions .btn-secondary:hover{
  background:var(--bg-hover);
  color:var(--text);
  border-color:#33465c;
}
.profile-page-actions .btn-danger{
  background:rgba(248,81,73,.10);
  color:#f8a5a0;
  border:1px solid rgba(248,81,73,.28);
}
.profile-page-actions .btn-danger:hover{
  background:rgba(248,81,73,.18);
  color:#ffb3af;
  border-color:rgba(248,81,73,.5);
}


/* ── Toast برای کپی ── */
.profile-toast{
  position:fixed;
  bottom:24px;
  left:50%;
  transform:translateX(-50%) translateY(80px);
  padding:10px 18px;
  background:rgba(20,28,38,.95);
  color:#fff;
  font-size:13px;
  border:1px solid rgba(63,185,80,.4);
  border-radius:999px;
  box-shadow:0 12px 30px rgba(0,0,0,.5);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  z-index:9999;
  opacity:0;
  pointer-events:none;
  transition: opacity .25s, transform .25s var(--transition);
  display:flex;
  align-items:center;
  gap:8px;
}
.profile-toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}
.profile-toast::before{
  content:"✓";
  color:#7ee787;
  font-weight:700;
}


/* ── Responsive ── */
@media (max-width:600px){
  .profile-wrap{padding:12px 12px 28px}
  .profile-page-body{padding:0 16px 18px}
  .profile-page-cover{height:110px}
  .profile-page-head{
    flex-direction:column;
    align-items:center;
    text-align:center;
    margin-top:-48px;
  }
  .profile-page-avatar{
    width:92px;height:92px;font-size:32px;
  }
  .profile-page-identity{
    padding-top:10px;
    width:100%;
  }
  .profile-page-name{justify-content:center}
  .profile-page-username{justify-content:center}

  .profile-stats{grid-template-columns:repeat(3, 1fr);gap:6px}
  .profile-stat{padding:10px 6px}
  .profile-stat-value{font-size:16px}
  .profile-stat-label{font-size:10px}

  .profile-page-info li{
    flex-direction:column;
    align-items:flex-start;
    gap:6px;
  }
  .profile-page-info li b{
    text-align:start;
    justify-content:flex-start;
    width:100%;
  }
  .profile-page-actions .btn-primary,
  .profile-page-actions .btn-secondary,
  .profile-page-actions .btn-danger{
    flex:1 1 100%;
  }
  .copy-btn{opacity:1}
}