/* ════════════════════════════════════════
   profile-ig.css — Instagram-style Profile
   ════════════════════════════════════════ */
#profile-tab {
  justify-content: flex-start !important;
  align-items: stretch !important;
  flex-direction: column !important;
}
.ig-profile { direction:rtl; font-family:Vazir,sans-serif; padding-bottom:80px; }

/* نوار بالا */
.ig-profile__topbar {
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px; position:sticky; top:0; z-index:5;
  background:var(--bg-main,#0f1117);
}
.ig-profile__topbar-user { font-size:18px; font-weight:800; color:#f1f5f9; }
.ig-profile__topbar-actions { display:flex; gap:8px; }
.ig-profile__topbar-btn {
  width:36px; height:36px; border:none; border-radius:10px;
  background:rgba(255,255,255,0.06); color:#f1f5f9; font-size:18px;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
}

/* هدر: آواتار + آمار */
.ig-profile__header {
  display:flex; align-items:center; gap:20px;
  padding:8px 20px 12px;
}
.ig-profile__avatar-wrap {
  flex:0 0 auto; width:86px; height:86px; border-radius:50%;
  padding:3px; cursor:pointer; position:relative;
}
.ig-profile__avatar-wrap--ring { background:linear-gradient(135deg,#10b981,#22c55e,#16a34a); }
.ig-profile__avatar-wrap--no-ring { background:rgba(255,255,255,0.1); }
.ig-profile__avatar {
  width:100%; height:100%; border-radius:50%; object-fit:cover;
  border:3px solid var(--bg-main,#0f1117); display:block;
}
.ig-profile__stats {
  flex:1; display:flex; justify-content:space-around; text-align:center;
}
.ig-profile__stat { cursor:pointer; }
.ig-profile__stat-num { font-size:17px; font-weight:800; color:#f1f5f9; }
.ig-profile__stat-label { font-size:11px; color:rgba(203,213,225,0.5); margin-top:2px; }

/* نام و بیو */
.ig-profile__info { padding:2px 20px 10px; }
.ig-profile__name { font-size:14px; font-weight:700; color:#f1f5f9; margin-bottom:2px; }
.ig-profile__bio { font-size:13px; color:rgba(203,213,225,0.7); line-height:1.5; white-space:pre-wrap; }

/* دکمه‌های اکشن */
.ig-profile__actions { display:flex; gap:8px; padding:6px 20px 12px; }
.ig-profile__btn {
  flex:1; height:36px; border-radius:10px; border:none;
  font-size:13px; font-weight:700; cursor:pointer;
  font-family:inherit; display:flex; align-items:center; justify-content:center;
}
.ig-profile__btn--primary {
  background:rgba(255,255,255,0.1); color:#f1f5f9;
}
.ig-profile__btn--primary:active { background:rgba(255,255,255,0.16); }

/* هایلایت‌ها */
.ig-profile__highlights {
  display:flex; gap:16px; overflow-x:auto; padding:8px 20px 12px;
  -webkit-overflow-scrolling:touch; scroll-snap-type:x mandatory;
}
.ig-profile__highlights::-webkit-scrollbar { display:none; }
.ig-profile__hl-item {
  flex:0 0 auto; width:64px; text-align:center; scroll-snap-align:start; cursor:pointer;
}
.ig-profile__hl-ring {
  width:64px; height:64px; border-radius:50%; padding:2px;
  background:linear-gradient(135deg,#f59e0b,#ef4444,#a855f7);
  margin-bottom:4px;
}
.ig-profile__hl-ring--add {
  background:none; border:2px dashed rgba(203,213,225,0.3);
  display:flex; align-items:center; justify-content:center;
  color:rgba(203,213,225,0.5); font-size:24px;
}
.ig-profile__hl-img {
  width:100%; height:100%; border-radius:50%; object-fit:cover;
  border:2px solid var(--bg-main,#0f1117); display:block;
}
.ig-profile__hl-name {
  font-size:10px; color:rgba(203,213,225,0.6);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}

/* تب‌بار */
.ig-profile__tabs {
  display:flex; border-top:1px solid rgba(255,255,255,0.08);
  border-bottom:1px solid rgba(255,255,255,0.08);
  position:sticky; top:60px; z-index:4;
  background:var(--bg-main,#0f1117);
}
.ig-profile__tab {
  flex:1; padding:12px 0; text-align:center; cursor:pointer;
  font-size:13px; color:rgba(203,213,225,0.5); font-weight:600;
  border:none; background:none; font-family:inherit;
  border-bottom:2px solid transparent; transition:all 0.2s;
}
.ig-profile__tab--active {
  color:#f1f5f9; border-bottom-color:#f1f5f9;
}

/* گرید ۳ ستونه */
.ig-profile__grid {
  display:grid; grid-template-columns:repeat(3,1fr); gap:2px;
  padding:2px;
}
.ig-profile__grid-item {
  aspect-ratio:1; overflow:hidden; cursor:pointer; position:relative;
  background:rgba(255,255,255,0.04);
}
.ig-profile__grid-item img {
  width:100%; height:100%; object-fit:cover; display:block;
}
.ig-profile__grid-item:hover { opacity:0.85; }

/* حالت خالی */
.ig-profile__empty {
  text-align:center; padding:48px 20px; color:rgba(203,213,225,0.4);
}
.ig-profile__empty-icon { font-size:48px; margin-bottom:12px; }
.ig-profile__empty-text { font-size:14px; line-height:1.6; }

/* divider */
.ig-profile__divider { height:1px; background:rgba(255,255,255,0.06); margin:0; }

/* لودینگ */
.ig-profile__loading {
  text-align:center; padding:40px; color:rgba(203,213,225,0.4); font-size:14px;
}

/* ── فیکس عرض و اسکرول موبایل ── */
@media (max-width: 768px) {
  #profile-tab {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 50 !important;
  }
  #profile-tab .ig-profile {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    margin: 0 !important;
  }
  .ig-profile__topbar {
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .ig-profile__header {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 8px 16px 12px !important;
  }
  .ig-profile__actions {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 6px 16px 12px !important;
  }
}

/* رفع: کلیک روی آیکن‌ها حالتِ انتخاب نگیرد + فاصله‌ی پایین تا زیرِ پنل نرود */
.ig-profile { padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
.ig-profile button, .ig-profile__tab, .ig-profile__grid-item, .ig-profile__stat,
.ig-profile__avatar-wrap, .ig-profile__topbar-btn, .ig-profile__hl-item, .ig-profile svg {
  -webkit-user-select: none !important; user-select: none !important; -webkit-tap-highlight-color: transparent !important;
}
.ig-profile img { -webkit-user-drag: none; user-select: none; }

/* آمارِ دریافتیِ کاربر (لایک/نظر) */
.ig-profile__insights { display:flex; gap:18px; padding:4px 20px 8px; font-size:12.5px; color:var(--text-muted,#94a3b8); }
.ig-profile__insights span { display:inline-flex; align-items:center; gap:5px; }
