/* =====================================================
   BlogTech — Main Stylesheet
   Design System: Dark Slate + Emerald accent
   ===================================================== */

/* ── Reset & Variables ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0f1117;
  --bg-card:    #1a1d27;
  --bg-hover:   #212435;
  --border:     #2a2d3e;
  --accent:     #10b981;
  --accent-dim: #059669;
  --accent-glow: rgba(16,185,129,.18);
  --text:       #e2e8f0;
  --text-muted: #6b7280;
  --text-dim:   #9ca3af;
  --red:        #ef4444;
  --blue:       #3b82f6;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 4px 24px rgba(0,0,0,.4);
  --shadow-sm:  0 2px 8px rgba(0,0,0,.25);
  --transition: .2s ease;
  --font:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; }

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ── Utility ────────────────────────────────────────── */
.container { width: min(1200px, 92%); margin-inline: auto; }

/* ── Animations ─────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  70%  { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.fade-up  { animation: fadeUp  .5s ease both; }
.fade-in  { animation: fadeIn  .4s ease both; }

/* ── Navbar ─────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,17,23,.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.navbar-logo {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.5px;
}
.navbar-logo span { color: var(--accent); }

.navbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  border: none;
}
.nav-btn-ghost { background: transparent; color: var(--text-dim); }
.nav-btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.nav-btn-accent { background: var(--accent); color: #fff; }
.nav-btn-accent:hover { background: var(--accent-dim); }
.nav-btn-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.nav-btn-outline:hover { background: var(--accent-glow); }

/* ── Hero ───────────────────────────────────────────── */
.hero {
  position: relative;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(.35);
  transform: scale(1.04);
  transition: transform 8s ease;
}
.hero:hover .hero-bg { transform: scale(1); }
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--bg));
}
.hero-content {
  position: relative;
  z-index: 1;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  animation: fadeUp .7s ease both;
}
.hero-title span { color: var(--accent); }
.hero-subtitle {
  margin-top: 12px;
  font-size: 1.1rem;
  color: var(--text-dim);
  animation: fadeUp .7s .15s ease both;
}

/* ── Section Heading ────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 48px 0 24px;
}
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
}
.section-title span { color: var(--accent); }

/* ── Post Grid ──────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

/* ── Post Card ──────────────────────────────────────── */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: fadeUp .5s ease both;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.post-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  transition: transform .4s ease;
}
.post-card:hover .post-card-img { transform: scale(1.04); }
.post-card-img-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--bg-hover) 0%, var(--border) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2.5rem;
}
.post-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.post-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--text-muted);
}
.post-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition);
}
.post-card:hover .post-card-title { color: var(--accent); }
.post-card-author {
  margin-top: auto;
  font-size: .8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.post-card-stats {
  display: flex;
  gap: 14px;
  font-size: .8rem;
  color: var(--text-muted);
}
.post-card-stats span { display: flex; align-items: center; gap: 4px; }

/* ── Badge ──────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.badge-accent { background: var(--accent-glow); color: var(--accent); }
.badge-muted  { background: var(--bg-hover); color: var(--text-muted); }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dim); transform: translateY(-1px); }
.btn-danger  { background: var(--red); color: #fff; }
.btn-danger:hover  { filter: brightness(1.15); transform: translateY(-1px); }
.btn-ghost   { background: var(--bg-hover); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); }
.btn-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-outline:hover { background: var(--accent-glow); }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); width: 36px; height: 36px; justify-content: center; }

/* ── Post Detail ────────────────────────────────────── */
.post-detail { max-width: 760px; margin: 40px auto 80px; }
.post-detail-header { margin-bottom: 24px; }
.post-detail-title { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -.5px; line-height: 1.25; }
.post-detail-meta  { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 12px; color: var(--text-muted); font-size: .875rem; }
.post-detail-meta a { color: var(--accent); }
.post-detail-img   { width: 100%; border-radius: var(--radius); margin: 24px 0; object-fit: cover; max-height: 480px; }
.post-detail-body  { font-size: 1.05rem; line-height: 1.85; color: var(--text-dim); }
.post-detail-body h1,.post-detail-body h2,.post-detail-body h3 { color: var(--text); margin: 1.5em 0 .5em; }
.post-detail-body p { margin-bottom: 1em; }
.post-detail-body img { border-radius: var(--radius-sm); margin: 1em 0; }

/* ── Reactions Bar ──────────────────────────────────── */
.reactions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 28px 0;
  flex-wrap: wrap;
}
.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: .875rem;
  cursor: pointer;
  transition: all var(--transition);
}
.reaction-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.reaction-btn.active-like   { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.reaction-btn.active-dislike{ border-color: var(--red);    color: var(--red);    background: rgba(239,68,68,.1); }
.reaction-count { font-weight: 600; }
.share-btn { margin-left: auto; }

/* ── Read count chip ───────────────────────────────── */
.read-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .8rem;
  color: var(--text-muted);
}

/* ── Comments ───────────────────────────────────────── */
.comments-section { margin-top: 40px; }
.comments-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }
.comment-form-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 24px; }
.comment-item {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  animation: fadeIn .3s ease;
}
.comment-item:hover { border-color: var(--bg-hover); }
.comment-author { font-weight: 600; font-size: .875rem; }
.comment-date   { font-size: .75rem; color: var(--text-muted); }
.comment-body   { margin-top: 8px; font-size: .95rem; color: var(--text-dim); }

/* ── Forms ──────────────────────────────────────────── */
.form-page {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}
.form-card {
  width: min(480px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  animation: fadeUp .5s ease;
}
.form-card-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
.form-card-sub   { color: var(--text-muted); font-size: .9rem; margin-bottom: 28px; }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: 6px; color: var(--text-dim); }
.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input-file {
  width: 100%;
  padding: 10px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: .875rem;
  cursor: pointer;
  transition: border-color var(--transition);
}
.form-input-file:hover { border-color: var(--accent); }
textarea.form-input { resize: vertical; min-height: 100px; }
.form-footer { text-align: center; margin-top: 20px; font-size: .875rem; color: var(--text-muted); }
.form-footer a { color: var(--accent); }

/* ── Create Post Page ──────────────────────────────── */
.create-post-page { max-width: 760px; margin: 40px auto 80px; }
.create-post-page h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 28px; }

/* Quill override */
.ql-toolbar.ql-snow { background: var(--bg-hover); border-color: var(--border) !important; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.ql-container.ql-snow { background: var(--bg); border-color: var(--border) !important; border-radius: 0 0 var(--radius-sm) var(--radius-sm); min-height: 200px; }
.ql-editor { color: var(--text); font-size: .95rem; }
.ql-stroke { stroke: var(--text-dim) !important; }
.ql-fill   { fill:   var(--text-dim) !important; }
.ql-picker-label { color: var(--text-dim) !important; }

/* ── Profile Page ───────────────────────────────────── */
.profile-page { max-width: 900px; margin: 40px auto 80px; }
.profile-cover {
  height: 200px;
  background: linear-gradient(135deg, #0f1a2e 0%, #1a2d1a 100%);
  border-radius: var(--radius);
  margin-bottom: -60px;
  position: relative;
  overflow: hidden;
}
.profile-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--accent-glow), transparent);
}
.profile-header { padding: 0 24px 24px; }
.profile-avatar {
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 4px solid var(--bg-card);
  object-fit: cover;
  background: var(--bg-hover);
  animation: pulse-ring 2s ease 1;
}
.profile-name { font-size: 1.4rem; font-weight: 700; margin-top: 12px; }
.profile-handle { color: var(--text-muted); font-size: .9rem; }
.profile-bio { color: var(--text-dim); margin-top: 10px; font-size: .9rem; max-width: 500px; }
.profile-stats { display: flex; gap: 28px; margin: 16px 0; }
.profile-stat strong { font-size: 1.1rem; }
.profile-stat small  { display: block; color: var(--text-muted); font-size: .75rem; }
.profile-actions { display: flex; gap: 10px; margin-top: 16px; }

.profile-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px;
  border-radius: var(--radius);
  overflow: hidden;
}
.profile-post-thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-hover);
}
.profile-post-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.profile-post-thumb:hover img { transform: scale(1.08); }
.profile-post-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}
.profile-post-thumb:hover .profile-post-thumb-overlay { opacity: 1; }

/* ── Followers List ─────────────────────────────────── */
.followers-list { max-width: 600px; margin: 40px auto; }
.follower-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  transition: border-color var(--transition), transform var(--transition);
}
.follower-item:hover { border-color: var(--accent); transform: translateX(4px); }
.follower-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-hover);
}

/* ── Inbox / Thread ─────────────────────────────────── */
.inbox-page { max-width: 700px; margin: 40px auto 80px; }
.thread-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  cursor: pointer;
  transition: all var(--transition);
}
.thread-item:hover { border-color: var(--accent); transform: translateX(4px); }

.thread-page { max-width: 700px; margin: 40px auto 80px; }
.messages-wrap { display: flex; flex-direction: column; gap: 12px; min-height: 300px; max-height: 560px; overflow-y: auto; padding: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; }
.message-bubble { max-width: 70%; padding: 12px 16px; border-radius: 18px; font-size: .9rem; line-height: 1.5; }
.message-sent { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.message-received { background: var(--bg-hover); color: var(--text); align-self: flex-start; border-bottom-left-radius: 4px; }
.message-time { font-size: .7rem; opacity: .7; margin-top: 4px; }

/* ── Confirm Delete ─────────────────────────────────── */
.confirm-page { max-width: 480px; margin: 80px auto; text-align: center; }
.confirm-icon { font-size: 3rem; color: var(--red); margin-bottom: 16px; }
.confirm-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; }
.confirm-text  { color: var(--text-muted); margin-bottom: 28px; }
.confirm-actions { display: flex; gap: 12px; justify-content: center; }

/* ── Alerts ─────────────────────────────────────────── */
.alert-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: fadeIn .3s ease;
  box-shadow: var(--shadow);
}
.alert-success { background: rgba(16,185,129,.15); border: 1px solid var(--accent); color: var(--accent); }
.alert-error   { background: rgba(239,68,68,.15);  border: 1px solid var(--red);    color: var(--red); }
.alert-close   { background: none; border: none; color: inherit; cursor: pointer; font-size: 1rem; }

/* ── Footer ─────────────────────────────────────────── */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}
.footer-heading { font-size: .9rem; font-weight: 600; margin-bottom: 14px; color: var(--text); }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: .85rem; color: var(--text-muted); transition: color var(--transition); }
.footer-links a:hover { color: var(--accent); }
.footer-socials { display: flex; gap: 10px; margin-top: 10px; }
.footer-social-link {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  transition: all var(--transition);
}
.footer-social-link:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.footer-bottom { text-align: center; font-size: .8rem; color: var(--text-muted); padding-top: 20px; border-top: 1px solid var(--border); }

/* ── Empty State ────────────────────────────────────── */
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 14px; }
.empty-state-text { font-size: 1rem; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; }
  .form-card { padding: 28px 20px; }
  .profile-stats { gap: 16px; }
  .profile-posts-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =====================================================
   ADDITIONS — v2 feature set
   ===================================================== */

/* ── Navbar Search ─────────────────────────────────── */
.navbar-search {
  display: flex;
  align-items: center;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 7px 14px;
  gap: 8px;
  flex: 0 1 340px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.navbar-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.navbar-search-icon { color: var(--text-muted); font-size: 1rem; flex-shrink: 0; }
.navbar-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: .875rem;
  width: 100%;
}
.navbar-search-input::placeholder { color: var(--text-muted); }

/* Hide label text on smaller screens to keep navbar tidy */
@media (max-width: 900px) {
  .navbar-search { flex: 0 1 200px; }
  .nav-label { display: none; }
}
@media (max-width: 640px) {
  .navbar-search { display: none; }
}

/* ── Navbar unread badge ────────────────────────────── */
.nav-icon-wrap { position: relative; display: inline-flex; align-items: center; }
.nav-badge {
  position: absolute;
  top: -7px;
  right: -10px;
  background: var(--red);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg);
  animation: pulse-ring .8s ease 1;
}

/* ── Thread / Inbox unread indicators ──────────────── */
.thread-avatar {
  position: relative;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: visible;
}
.thread-unread-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}
.thread-info { flex: 1; min-width: 0; }
.thread-username { font-weight: 500; font-size: .925rem; }
.thread-username-unread { font-weight: 700; color: var(--text); }
.thread-preview { font-size: .8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.thread-preview-unread { color: var(--text-dim); font-weight: 500; }
.thread-badge {
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}
.thread-item-unread {
  border-color: rgba(16,185,129,.3);
  background: rgba(16,185,129,.04);
}

/* ── Comments — full overhaul ───────────────────────── */
.comment-item {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  animation: fadeIn .3s ease;
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.comment-avatar-wrap { flex-shrink: 0; }
.comment-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
}
.comment-avatar-sm { width: 26px; height: 26px; }
.comment-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-dim), #0891b2);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
}
.comment-meta { flex: 1; min-width: 0; }
.comment-author {
  font-weight: 600;
  font-size: .875rem;
  color: var(--text);
  display: block;
}
.comment-author:hover { color: var(--accent); }
.comment-date { font-size: .75rem; color: var(--text-muted); }
.comment-body { font-size: .925rem; color: var(--text-dim); line-height: 1.6; margin-bottom: 10px; }
.comment-delete-btn {
  color: var(--text-muted);
  font-size: .875rem;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
  margin-left: auto;
  flex-shrink: 0;
}
.comment-delete-btn:hover { color: var(--red); background: rgba(239,68,68,.1); }

/* Comment action buttons (like/dislike/reply) */
.comment-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.comment-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: .8rem;
  cursor: pointer;
  transition: all var(--transition);
}
.comment-action-btn:hover { background: var(--bg-hover); color: var(--text); }
.comment-action-btn.active-like    { color: var(--accent); border-color: var(--accent); background: var(--accent-glow); }
.comment-action-btn.active-dislike { color: var(--red);    border-color: var(--red);    background: rgba(239,68,68,.1); }
.reply-count { color: var(--text-muted); }

/* Reply form */
.reply-form-wrap {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.reply-input-row { display: flex; flex-direction: column; gap: 8px; }
.reply-textarea { min-height: 64px; font-size: .875rem; }
.reply-btn-row { display: flex; gap: 8px; }

/* Nested replies */
.replies-container { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.reply-item { display: flex; gap: 0; }
.reply-line {
  width: 2px;
  min-height: 100%;
  background: var(--border);
  border-radius: 99px;
  margin-left: 15px;
  margin-right: 12px;
  flex-shrink: 0;
}
.reply-content {
  flex: 1;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid var(--border);
}

/* ── Profile v2 — no overlap layout ────────────────── */
.profile-cover {
  height: 180px;
  background: linear-gradient(135deg, #0f1a2e 0%, #0f2a1e 50%, #0d1a2e 100%);
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
  overflow: hidden;
}
.profile-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(16,185,129,.2) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(59,130,246,.15) 0%, transparent 60%);
}
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0 24px 28px;
  position: relative;   /* so avatar wrap negative margin stays in-flow */
}
.profile-top-row {
  display: flex;
  align-items: flex-end;    /* avatar bottom aligns with button bottom */
  justify-content: space-between;
  margin-bottom: 20px;
}
.profile-avatar-wrap {
  margin-top: -54px;        /* lifts avatar over cover edge */
  flex-shrink: 0;
}
.profile-avatar {
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 4px solid var(--bg-card);
  object-fit: cover;
  background: var(--bg-hover);
  display: block;
}
.profile-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-dim), #0891b2);
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
}
.profile-action-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 12px;        /* keeps buttons below cover line */
  flex-wrap: wrap;
}
.profile-info { /* sits fully inside the card, below the avatar */ }
.profile-name { font-size: 1.3rem; font-weight: 700; }
.profile-handle { color: var(--text-muted); font-size: .875rem; margin-top: 2px; }
.profile-bio { color: var(--text-dim); margin-top: 8px; font-size: .9rem; max-width: 520px; line-height: 1.6; }
.profile-meta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.profile-meta-item { font-size: .8rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.profile-stats { display: flex; gap: 24px; margin-top: 14px; }
.profile-stat strong { font-size: 1.1rem; display: block; }
.profile-stat small  { color: var(--text-muted); font-size: .75rem; }

.profile-posts-section { margin-top: 28px; }
.profile-posts-heading { font-size: .95rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 14px; }

/* ── Follow / Unfollow button state ─────────────────── */
.btn-following {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-following:hover {
  background: rgba(239,68,68,.08);
  color: var(--red);
  border-color: var(--red);
}



/* ── Comment box slide-in ────────────────────────────── */
#comment-box {
  overflow: hidden;
}
#comment-box.show {
  display: block !important;
  animation: fadeUp .25s ease both;
}

/* ── Reaction label text (used by JS to update without breaking icon) ─ */
.reaction-label { /* inline — no special display needed */ }
