/* ========== PROFILE ========== */

.avatar-large { width: 90px; height: 90px; border-radius: 20px; object-fit: cover; display: block; margin: 0 auto 16px; border: 3px solid var(--primary); }

.profile-info-block { text-align: center; margin-bottom: 16px; }

.profile-display-name { font-weight: 700; font-size: 1.3rem; }

.profile-handle { color: var(--text2); font-size: 0.9rem; }

.profile-status { font-size: 0.85rem; margin-top: 4px; }

.role { font-size: 0.78rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; display: inline-block; margin-top: 4px; }

.role-user { background: rgba(148,163,184,.15); color: #94a3b8; }

.profile-bio-view { color: var(--text2); line-height: 1.5; margin: 8px 0; padding: 8px; background: var(--surface2); border-radius: 8px; font-size: 0.9rem; }

.profile-fields { display: none; }

.avatar-menu { display: none; position: absolute; top: 100px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px; z-index: 10; flex-direction: column; gap: 4px; min-width: 200px; box-shadow: 0 12px 40px rgba(0,0,0,.4); }

.avatar-menu.show { display: flex; }

.avatar-menu button { background: transparent; border: none; color: var(--text); padding: 8px 14px; border-radius: 8px; text-align: left; cursor: pointer; font-size: 0.9rem; transition: 0.15s; }

.avatar-menu button:hover { background: rgba(124,92,252,.15); }

.profile-confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(12px); z-index: 10000; display: none; align-items: center; justify-content: center; }

.profile-confirm-overlay.show { display: flex; }

.profile-confirm-box { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; min-width: 320px; max-width: 92vw; box-shadow: 0 20px 60px rgba(0,0,0,.5); text-align: center; }

.profile-confirm-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }

.profile-confirm-desc { font-size: 0.9rem; color: var(--text2); margin-bottom: 20px; }

.profile-confirm-actions { display: flex; gap: 10px; }

.profile-confirm-btn { flex: 1; padding: 12px; border-radius: 12px; font-size: 0.9rem; font-weight: 600; cursor: pointer; font-family: inherit; border: 1px solid; transition: 0.2s; }

.profile-confirm-btn-discard { background: transparent; border-color: var(--border); color: var(--text2); }

.profile-confirm-btn-discard:hover { background: rgba(239,68,68,.1); border-color: var(--danger); color: var(--danger); }

.profile-confirm-btn-save { background: var(--primary); border-color: transparent; color: white; }

.profile-confirm-btn-cancel { background: transparent; border-color: var(--border); color: var(--text); }

/* ========== NEW PROFILE DESIGN (Reference) ========== */

#profileOverlay .app-card {
  margin-top: 60px;

  background: var(--bg-soft);

  border: 1px solid var(--border);

  border-radius: 28px;

  box-shadow: 0 20px 50px rgba(0,0,0,.5);

  overflow: hidden;

  position: relative;

  min-height: 580px;

  display: flex;

  flex-direction: column;

  width: 460px;

  max-width: 95vw;

  max-height: 85vh;

  transition: all .4s cubic-bezier(.16,1,.3,1);

}

#profileOverlay .screen {

  width: 100%;

  flex-shrink: 0;

  transition: transform .4s cubic-bezier(.16,1,.3,1), opacity .3s;

  position: absolute;

  top: 0; left: 0; bottom: 0;

  overflow-y: auto;

  scrollbar-width: none;

  background: var(--bg-soft);

}

#profileOverlay .screen::-webkit-scrollbar { width: 0; }

#profileOverlay .screen::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }

#profileOverlay .screen-profile { transform: translateX(0); opacity: 1; z-index: 2; background: var(--bg-soft); }

#profileOverlay .screen-edit { transform: translateX(100%); opacity: 0; z-index: 1; background: var(--bg-soft); }

#profileOverlay.mode-edit .screen-profile { transform: translateX(-100%); opacity: 0; pointer-events: none; }

#profileOverlay.mode-edit .screen-edit { transform: translateX(0); opacity: 1; z-index: 5; pointer-events: auto; }

.prof-top-bar { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; }

.prof-top-bar .back-nav { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--accent); cursor: pointer; border: none; background: transparent; transition: color .2s; }

.prof-top-bar .back-nav:hover { color: var(--text); }

.prof-top-bar .back-nav svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2.2; fill: none; }

.btn-edit-prof { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; background: var(--border); color: var(--text); font-size: 13px; font-weight: 600; border-radius: 100px; border: 1px solid transparent; cursor: pointer; transition: all .2s; }

.btn-edit-prof:hover { background: var(--accent); color: var(--accent-text); }

.btn-edit-prof svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2.2; fill: none; }

.prof-hero { display: flex; flex-direction: column; align-items: center; padding: 10px 24px 16px 24px; text-align: center; }

.prof-avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: flex; justify-content: center; align-items: center; font-size: 38px; font-weight: 700; margin-bottom: 16px; box-shadow: 0 8px 25px -6px rgba(0,0,0,.2); position: relative; flex-shrink: 0; }

.prof-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.prof-name { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 4px; }

.prof-name-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }

.prof-badge { display: inline-flex; justify-content: center; align-items: center; width: 18px; height: 18px; background: var(--accent); color: var(--accent-text); font-size: 10px; font-weight: 800; border-radius: 5px; }

.prof-handle { font-size: 14px; font-weight: 600; color: var(--text-muted); margin-bottom: 16px; }

.prof-bio { font-size: 14px; line-height: 1.5; color: var(--text); background: var(--hover); padding: 12px 20px; border-radius: 16px; max-width: 90%; word-break: break-word; border: 1px solid var(--border); }

.prof-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 20px; gap: 0; margin-top: 16px; }

.prof-tab { padding: 8px 16px; cursor: pointer; color: var(--text-muted); font-size: 13px; font-weight: 500; transition: .2s; position: relative; }

.prof-tab::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 0; height: 2px; background: var(--accent); border-radius: 2px; transition: width .2s; }

.prof-tab.active { color: var(--text); }

.prof-tab.active::after { width: 60%; }

.prof-tab-content { padding: 16px 20px; border-top: 1px solid var(--border); }

.wall { padding: 24px; border-top: 1px solid var(--border); }

.wall-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

.wall-title { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text); display: flex; align-items: center; gap: 8px; }

.wall-title::before { content: ""; width: 8px; height: 8px; background: var(--accent); border-radius: 2px; display: inline-block; }

.wall-count { font-size: 12px; font-weight: 500; color: var(--text-muted); }

.post-form { background: var(--hover); border: 1px solid var(--border); border-radius: 20px; padding: 16px; margin-bottom: 24px; transition: border .2s; }

.post-form:focus-within { border-color: var(--accent); }

.post-textarea { width: 100%; background: transparent; border: none; color: var(--text); font-size: 14px; line-height: 1.5; resize: none; outline: none; }

.post-textarea::placeholder { color: var(--text-muted); }

.post-footer-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

.post-tip { font-size: 11px; color: var(--text-muted); }

.btn-post { padding: 8px 20px; background: var(--accent); color: var(--accent-text); border: none; border-radius: 100px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .2s; }

.btn-post:hover { opacity: 0.85; }

.feed { display: flex; flex-direction: column; gap: 16px; }

.post-item { background: var(--hover); border: 1px solid var(--border); border-radius: 20px; padding: 20px; }

.post-author-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.author-info { display: flex; align-items: center; gap: 10px; }

.author-avatar-sm { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: flex; justify-content: center; align-items: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }

.author-name { font-size: 14px; font-weight: 700; color: var(--text); }

.post-time { font-size: 11px; color: var(--text-muted); }

.post-text { font-size: 14px; line-height: 1.6; color: var(--text); margin-bottom: 16px; word-break: break-word; }

.post-actions { display: flex; justify-content: space-between; align-items: center; }

.btn-like { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: var(--border); border-radius: 100px; border: 1px solid transparent; font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all .2s; }

.btn-like:hover { background: rgba(239,68,68,.12); color: var(--danger); }

.btn-like.liked { color: var(--danger); background: rgba(239,68,68,.12); }

.btn-like svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none; }

.btn-like.liked svg { fill: currentColor; }

.btn-del { font-size: 11px; color: var(--text-muted); cursor: pointer; border: none; background: transparent; padding: 4px; }

.btn-del:hover { color: var(--danger); }

.edit-nav-bar { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }

.edit-nav-left { display: flex; align-items: center; gap: 20px; }

.btn-back-edit { color: var(--text-muted); cursor: pointer; border: none; background: transparent; display: flex; align-items: center; padding: 4px; transition: color .2s; }

.btn-back-edit:hover { color: var(--text); }

.btn-back-edit svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; }

.edit-screen-title { font-size: 18px; font-weight: 600; color: var(--text); }

.edit-nav-right { display: flex; align-items: center; gap: 16px; }

.btn-save-edit { color: var(--accent); cursor: pointer; border: none; background: transparent; padding: 6px; border-radius: 50%; transition: all 0.2s; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }

.btn-save-edit:hover { background: var(--accent); color: var(--accent-text); }

.btn-save-edit svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2.2; fill: none; }

.edit-hero-section { display: flex; flex-direction: column; align-items: center; padding: 32px 20px 24px 20px; }

.edit-name-display { font-size: 22px; font-weight: 700; color: var(--text); margin-top: 12px; display: flex; align-items: center; gap: 8px; }

.edit-name-badge { display: inline-flex; justify-content: center; align-items: center; width: 18px; height: 18px; background: var(--accent); color: var(--accent-text); font-size: 10px; font-weight: 800; border-radius: 5px; }

.edit-name-text { font-size: 22px; font-weight: 700; color: var(--text); }

.edit-fields { padding: 0; margin: 0 20px; border-radius: 12px; overflow: hidden; background: var(--hover); }

.edit-field-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }

.edit-field-row:last-child { border-bottom: none; }

.edit-field-label { font-size: 15px; color: var(--text-muted); font-weight: 400; }

.edit-field-value { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: 15px; cursor: pointer; }

.edit-field-input { background: transparent; border: none; color: var(--text); font-size: 15px; text-align: right; outline: none; width: 200px; font-family: inherit; }

.edit-field-input::placeholder { color: var(--text-muted); }

.edit-hero-section { display: flex; flex-direction: column; align-items: center; padding: 32px 20px 24px 20px; }

.avatar-edit-box { position: relative; margin-bottom: 16px; cursor: pointer; }

.avatar-edit-circle { width: 104px; height: 104px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: flex; justify-content: center; align-items: center; font-size: 42px; font-weight: 700; box-shadow: 0 8px 25px rgba(0,0,0,.15); transition: transform .2s; }

.avatar-edit-circle img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.avatar-edit-box:hover .avatar-edit-circle { transform: scale(1.03); }

.cam-btn-ref { position: absolute; bottom: 0; right: 0; width: 36px; height: 36px; background-color: var(--accent); border: 3px solid var(--bg-soft); border-radius: 50%; display: flex; justify-content: center; align-items: center; color: var(--accent-text); box-shadow: 0 4px 10px rgba(0,0,0,.15); transition: background .2s; }

.cam-btn-ref:hover { opacity: 0.85; }

.cam-btn-ref svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }

.ref-user-id-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }

.ref-badge { display: inline-flex; justify-content: center; align-items: center; width: 18px; height: 18px; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 800; border-radius: 5px; }

.ref-handle { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: .5px; }

.ref-status { font-size: 13px; color: var(--text-muted); font-weight: 400; margin-bottom: 20px; }

.ref-bio-row { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }

.ref-bio-input { width: 100%; background: transparent; border: none; color: var(--text); font-size: 15px; outline: none; font-weight: 400; resize: none; min-height: 40px; font-family: inherit; line-height: 1.5; }

.ref-bio-input::placeholder { color: var(--text-muted); }

.ref-bio-counter { font-size: 14px; color: var(--text-muted); font-weight: 400; margin-left: 10px; flex-shrink: 0; }

.ref-helper-text { font-size: 12px; line-height: 1.5; color: var(--text-muted); padding: 0 20px; margin-bottom: 32px; }

.ref-name-row { padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .2s; }

.ref-name-row:hover { background: var(--border); }

.name-row-left { display: flex; align-items: center; gap: 16px; }

.user-outline-icon { color: var(--text-muted); display: flex; align-items: center; }

.user-outline-icon svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; }

.name-row-label { font-size: 15px; color: var(--text); font-weight: 400; }

.name-row-right { display: flex; align-items: center; gap: 8px; }

#profileOverlay .toast-fixed { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); padding: 10px 20px; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600; border-radius: 100px; box-shadow: 0 10px 30px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: all .3s cubic-bezier(.16,1,.3,1); z-index: 200; }

#profileOverlay .toast-fixed.show { bottom: 40px; opacity: 1; }

/* Profile mini in sidebar */

.profile-mini { padding: 12px 14px; border-top: 1px solid transparent; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: 0.3s; background: linear-gradient(180deg, rgba(0,0,0,.3), rgba(10,8,30,.5)); backdrop-filter: blur(20px); position: relative; overflow: hidden; }

.profile-mini::before { content: ''; position: absolute; top: 0; left: 16px; right: 16px; height: 1px; background: linear-gradient(90deg, transparent, rgba(139,92,246,.5), rgba(34,211,238,.5), transparent); }

.profile-mini::after { content: ''; position: absolute; top: -50%; right: -50%; width: 200%; height: 200%; background: radial-gradient(circle at 70% 50%, rgba(139,92,246,.15) 0%, transparent 50%); opacity: 0; transition: opacity 0.4s; pointer-events: none; }

.profile-mini:hover::after { opacity: 1; }

.profile-mini:hover { background: linear-gradient(135deg, rgba(139,92,246,.18), rgba(34,211,238,.1)); }

.avatar-mini-wrap { position: relative; flex-shrink: 0; }

.avatar-mini { width: 42px; height: 42px; border-radius: 14px; object-fit: cover; flex-shrink: 0; transition: 0.3s; box-shadow: 0 4px 14px rgba(139,92,246,.4); position: relative; }

.profile-mini:hover .avatar-mini { box-shadow: 0 0 28px var(--primary-glow), 0 0 0 2px var(--primary); transform: scale(1.08); }

.avatar-mini-wrap::after { content: ''; position: absolute; bottom: 0; right: 0; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid rgba(10,8,30,.95); box-shadow: 0 0 10px rgba(74,222,128,.7); animation: statusPulse 3s ease-in-out infinite; }

@keyframes statusPulse { 0%, 100% { box-shadow: 0 0 10px rgba(74,222,128,.7); } 50% { box-shadow: 0 0 18px rgba(74,222,128,.9); } }

.profile-info-mini { min-width: 0; flex: 1; }

.profile-name-mini { font-weight: 700; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-username-mini { font-size: 0.75rem; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-mini .icon-chevron { color: var(--text2); font-size: 1.1rem; flex-shrink: 0; transition: transform 0.3s; }

.profile-mini:hover .icon-chevron { transform: translateX(2px); color: var(--text); }

/* ========== WALL POSTS ========== */
.wall-section { padding: 16px 20px; border-top: 1px solid var(--border); }
.wall-section-title { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.wall-section-title::before { content: ""; width: 8px; height: 8px; background: var(--accent); border-radius: 2px; display: inline-block; }
.wall-post-form { background: var(--hover); border: 1px solid var(--border); border-radius: 16px; padding: 12px; margin-bottom: 16px; transition: border .2s; }
.wall-post-form:focus-within { border-color: var(--accent); }
.wall-post-form textarea { width: 100%; background: transparent; border: none; color: var(--text); font-size: 14px; line-height: 1.5; resize: none; outline: none; min-height: 60px; font-family: inherit; }
.wall-post-form textarea::placeholder { color: var(--text-muted); }
.wall-post-form-btn { display: flex; justify-content: flex-end; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.wall-post-form-btn button { padding: 6px 18px; background: var(--accent); color: var(--accent-text); border: none; border-radius: 100px; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity .2s; }
.wall-post-form-btn button:hover { opacity: 0.85; }
.wall-post-list { display: flex; flex-direction: column; gap: 12px; max-height: 400px; overflow-y: auto; }
.wall-post { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 16px; padding: 14px; }
.wall-post-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.wall-post-author-row { display: flex; align-items: center; gap: 8px; }
.wall-post-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.wall-post-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.wall-post-author { font-size: 13px; font-weight: 600; color: var(--text); }
.wall-post-time { font-size: 11px; color: var(--text-muted); }
.wall-post-text { font-size: 14px; line-height: 1.5; color: var(--text); margin-bottom: 10px; word-break: break-word; }
.wall-post-actions { display: flex; align-items: center; gap: 12px; }
.wall-post-like { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--border); border-radius: 100px; border: 1px solid transparent; font-size: 12px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all .2s; }
.wall-post-like:hover { background: rgba(239,68,68,.12); color: var(--danger); }
.wall-post-like.liked { color: var(--danger); background: rgba(239,68,68,.12); }
.wall-post-delete { font-size: 11px; color: var(--text-muted); cursor: pointer; border: none; background: transparent; padding: 4px; transition: color .2s; }
.wall-post-delete:hover { color: var(--danger); }
.wall-post-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 20px 0; }
/* Badge left of name */
.prof-name-row { display: flex; align-items: center; gap: 8px; justify-content: center; }
.prof-badge { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; background: var(--accent); color: var(--accent-text); font-size: 10px; font-weight: 800; border-radius: 5px; }
.edit-name-display { display: flex; align-items: center; gap: 8px; }
.edit-name-badge { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; background: var(--accent); color: var(--accent-text); font-size: 10px; font-weight: 800; border-radius: 5px; }
