/* ═══════════════════════════════════════════════════════════════
   FutiaSpace — Feed Page Styles
   Scoped to .feed-page and feed-specific components only.
   Assumes global CSS vars, resets, and .btn/.modal-overlay exist.
═══════════════════════════════════════════════════════════════ */

/* ── Layout ─────────────────────────────────────────────────── */

.feed-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 12px 120px;
  position: relative;
}

.feed-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 16px);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.see-more-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--violet-400);
  text-decoration: none;
  transition: color 0.15s;
}
.see-more-link:hover { color: var(--violet-500); text-decoration: underline; }

/* ── Skeleton loaders ───────────────────────────────────────── */

.skeleton-post {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 16px);
  height: 120px;
  margin-bottom: 12px;
  background: linear-gradient(
    90deg,
    var(--bg-surface) 25%,
    var(--bg-elevated) 50%,
    var(--bg-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite ease-in-out;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Recently Joined ────────────────────────────────────────── */

.recently-joined-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.recent-person-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  text-align: center;
  transition: transform 0.18s, box-shadow 0.18s;
}
.recent-person-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.15);
}

.recent-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--violet-500);
  cursor: pointer;
  flex-shrink: 0;
}
.recent-avatar img { width: 100%; height: 100%; object-fit: cover; }

.recent-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.recent-dept {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.recent-person-card .btn {
  margin-top: 4px;
  font-size: 0.65rem;
  padding: 4px 8px;
  gap: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Marketplace Mini Grid ──────────────────────────────────── */

.marketplace-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mini-product-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 10px;
  transition: transform 0.18s, box-shadow 0.18s;
}
.mini-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.12);
}

.mini-product-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 14px 14px 0 0;
}

.mini-product-card strong,
.mini-product-card .mini-price {
  padding: 0 10px;
}

.mini-product-card strong {
  font-size: 0.75rem;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mini-price {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--amber-400);
}

.mini-actions {
  display: flex;
  gap: 6px;
  padding: 0 10px;
  flex-wrap: wrap;
}
.mini-actions .btn {
  flex: 1;
  font-size: 0.65rem;
  padding: 5px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.mini-actions .btn svg { width: 12px; height: 12px; }

/* ── Floating Action Button (FAB) ───────────────────────────── */

.feed-fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  background: linear-gradient(135deg, var(--violet-600), var(--violet-500), var(--amber-500));
  background-size: 200% 200%;
  animation: fabGradientShift 5s ease infinite;
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.45), 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  max-width: 260px;
  overflow: hidden;
}

.feed-fab:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.55), 0 4px 12px rgba(0,0,0,0.3);
}
.feed-fab:active { transform: scale(0.97); }

.feed-fab svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

#fabPrompt {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: promptFadeIn 0.4s ease;
}

@keyframes fabGradientShift {
  0%   { background-position: 0% 50%;   }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%;   }
}

@keyframes promptFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ── Feed Posts List ────────────────────────────────────────── */

.vertical-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 32px 16px;
}

/* ── Individual Post Card ───────────────────────────────────── */

.feed-post {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 16px);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
  animation: postSlideIn 0.3s ease both;
}

.feed-post:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(139, 92, 246, 0.25);
}

@keyframes postSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* Post Header */
.feed-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  position: relative;
}

.feed-post-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-subtle);
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.15s;
}
.feed-post-avatar:hover { border-color: var(--violet-500); }
.feed-post-avatar img  { width: 100%; height: 100%; object-fit: cover; }

.feed-post-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.feed-post-author {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-post-author:hover { color: var(--violet-400); }

.feed-post-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Three-dot menu */
.feed-post-menu {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}

.feed-menu-trigger {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.feed-menu-trigger:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.feed-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 6px;
  min-width: 130px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: dropdownPop 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: top right;
}

@keyframes dropdownPop {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1);    }
}

.feed-dropdown .dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.13s, color 0.13s;
}
.feed-dropdown .dropdown-item:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}
.feed-dropdown .dropdown-item.delete-feed-btn,
.feed-dropdown .dropdown-item.report-feed-btn {
  color: #f87171;
}
.feed-dropdown .dropdown-item.delete-feed-btn:hover,
.feed-dropdown .dropdown-item.report-feed-btn:hover {
  background: rgba(248, 113, 113, 0.1);
  color: #ef4444;
}

/* Post Content */
.feed-post-content {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0 0 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Post Images */
.feed-images {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  border-radius: 12px;
  overflow: hidden;
}
.feed-images:has(.feed-img:nth-child(2)) {
  grid-template-columns: 1fr 1fr;
}

.feed-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  cursor: pointer;
  border-radius: 10px;
  transition: filter 0.2s, transform 0.2s;
  display: block;
}
.feed-img:hover { filter: brightness(0.9); transform: scale(0.995); }

/* Post Footer (actions) */
.feed-post-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.feed-reply-toggle,
.ai-summary-btn {
  background: none;
  border: 1px solid transparent;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  color: var(--text-muted);
}
.feed-reply-toggle:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--violet-400);
}
.ai-summary-btn:hover {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
  color: var(--amber-400);
}

/* ── Polls ──────────────────────────────────────────────────── */

.poll-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 12px;
}

.poll-option-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-primary);
  transition: border-color 0.15s;
  user-select: none;
  min-height: 40px;
}
.poll-option-bar:hover { border-color: var(--violet-500); }

.poll-fill {
  position: absolute;
  inset: 0;
  left: 0;
  background: linear-gradient(90deg, rgba(139,92,246,0.18), rgba(124,58,237,0.08));
  border-radius: 10px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

.poll-option-bar span:not(.poll-votes) { z-index: 1; font-weight: 500; }
.poll-votes {
  z-index: 1;
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Replies ────────────────────────────────────────────────── */

.feed-replies-container {
  margin-top: 12px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.feed-reply-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.feed-reply-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.feed-reply-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--border-subtle);
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.15s;
}
.feed-reply-avatar:hover { border-color: var(--violet-500); }
.feed-reply-avatar img { width: 100%; height: 100%; object-fit: cover; }

.feed-reply-content {
  flex: 1;
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 8px 12px;
  min-width: 0;
}

.feed-reply-content strong {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.feed-reply-content strong:hover { color: var(--violet-400); }

.feed-reply-content p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 3px 0 5px;
  line-height: 1.5;
  word-break: break-word;
}

.reply-actions { display: flex; gap: 8px; }

.reply-to-reply-btn {
  background: none;
  border: none;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.reply-to-reply-btn:hover {
  color: var(--violet-400);
  background: rgba(139,92,246,0.08);
}

/* Nested replies */
.nested-replies {
  margin-top: 8px;
  padding-left: 10px;
  border-left: 2px solid rgba(139,92,246,0.2);
  animation: fadeIn 0.2s ease;
}

.nested-reply-input { margin-top: 8px; }

/* Reply input area */
.feed-reply-input {
  display: flex;
  gap: 8px;
  align-items: center;
}

.reply-input-field {
  flex: 1;
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.reply-input-field::placeholder { color: var(--text-muted); }
.reply-input-field:focus {
  border-color: var(--violet-500);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.12);
}

.send-feed-reply-btn {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 7px 14px;
}


/* ── Campus Leaderboard ─────────────────────────────────────── */

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.leaderboard-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px;
  transition: transform 0.18s;
}
.leaderboard-card:hover { transform: translateY(-2px); }

.leaderboard-card h5 {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--violet-400);
  margin: 0 0 8px;
}

.leaderboard-card p {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin: 0 0 4px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Medal accents for top 3 */
.leaderboard-card p:first-of-type  { color: #fbbf24; }
.leaderboard-card p:nth-of-type(2) { color: var(--text-secondary); }
.leaderboard-card p:nth-of-type(3) { color: #cd7f32; }

/* ── Compose Modal (Overlay + Form) ─────────────────────────── */

.compose-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.compose-overlay.visible { opacity: 1; }

.product-form-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px 32px;
  width: 100%;
  max-width: 680px;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.25);
  transform: translateY(40px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}
.compose-overlay.visible .product-form-container {
  transform: translateY(0);
}

.product-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.product-form-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.compose-cancel-btn {
  background: var(--bg-elevated);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.compose-cancel-btn:hover {
  background: var(--border-subtle);
  color: var(--text-primary);
}

/* Modal form fields */
#postForm textarea,
#postModalContent {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.88rem;
  line-height: 1.5;
  resize: none;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
#postModalContent::placeholder { color: var(--text-muted); }
#postModalContent:focus {
  border-color: var(--violet-500);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.12);
}

.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Image preview grid inside modal */
.feed-images-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.feed-image-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.feed-image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-img-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(0,0,0,0.6);
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 0;
  transition: background 0.15s;
}
.remove-img-btn:hover { background: rgba(239, 68, 68, 0.85); }
.remove-img-btn svg   { width: 11px; height: 11px; }

/* Poll creator inside modal */
#pollCreator {
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 12px;
  border: 1px dashed var(--border-subtle);
}

.poll-option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.poll-option::placeholder { color: var(--text-muted); }
.poll-option:focus { border-color: var(--violet-500); }

/* Modal action buttons row */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Clickable utility ──────────────────────────────────────── */

.clickable { cursor: pointer; }

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 600px) {
  .feed-page { padding: 12px 8px 110px; gap: 14px; }
  .recently-joined-grid { grid-template-columns: repeat(2, 1fr); }
  .marketplace-mini-grid { grid-template-columns: repeat(2, 1fr); }
  .leaderboard-grid { grid-template-columns: 1fr; gap: 8px; }
  .feed-fab { right: 14px; bottom: 70px; max-width: 220px; padding: 11px 14px 11px 12px; }
  .product-form-container { border-radius: 20px 20px 0 0; padding: 18px 16px 28px; }
}

@media (max-width: 360px) {
  .recently-joined-grid { grid-template-columns: repeat(2, 1fr); }
  #fabPrompt { display: none; }
  .feed-fab { padding: 12px; border-radius: 50%; width: 48px; height: 48px; justify-content: center; }
}

/* ── Light mode overrides ───────────────────────────────────── */

:root[data-theme="light"] .feed-post,
[data-theme="light"] .feed-post {
  box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 2px 12px rgba(0,0,0,0.04);
}
:root[data-theme="light"] .feed-post:hover,
[data-theme="light"] .feed-post:hover {
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.12), 0 2px 8px rgba(0,0,0,0.06);
}
:root[data-theme="light"] .product-form-container,
[data-theme="light"] .product-form-container {
  box-shadow: 0 -8px 40px rgba(0,0,0,0.1);
}
:root[data-theme="light"] .feed-dropdown,
[data-theme="light"] .feed-dropdown {
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
:root[data-theme="light"] .feed-fab,
[data-theme="light"] .feed-fab {
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35), 0 2px 6px rgba(0,0,0,0.12);
}

/* Live activity banner */
.live-avatars {
  display: inline-flex;
  margin-right: 6px;
  vertical-align: middle;
}
.live-avatars .live-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
  margin-left: -8px;
  object-fit: cover;
}
.live-avatars .live-avatar:first-child {
  margin-left: 0;
}
/* ── Leaderboard rows (Top Posters / Sellers / Active) ─────── */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.leaderboard-rank {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 24px;
  text-align: center;
}

.leaderboard-avatar {
  width: 28px;          /* ← fixed size, was missing */
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--violet-500);
  flex-shrink: 0;
}
.leaderboard-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.leaderboard-name {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-score {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--violet-400);
  background: rgba(139, 92, 246, 0.1);
  border-radius: 20px;
  padding: 2px 10px;
  flex-shrink: 0;
}

/* ── Instagram‑style Comments (refined) ─────────────────────── */

.feed-comments-container {
  margin-top: 12px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  animation: fadeIn 0.2s ease;
}

.feed-comment-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}

/* Comment avatar – 32px, subtle, no hover ring */
.feed-comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity 0.15s;
}
.feed-comment-avatar:hover { opacity: 0.85; }

.feed-comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Soft placeholder for users without photo */
.feed-comment-avatar .avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
}

/* Comment body */
.feed-comment-content {
  flex: 1;
  background: var(--bg-elevated);
  border-radius: 14px;
  padding: 8px 12px;
  min-width: 0;
}

/* Header: name + badge + time */
.feed-comment-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.feed-comment-header strong {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.feed-comment-header strong:hover { text-decoration: underline; }
.feed-comment-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Comment text */
.feed-comment-content p {
  font-size: 0.85rem;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.45;
  word-break: break-word;
}

/* Reply / Delete actions */
.feed-comment-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.feed-comment-actions button {
  background: none;
  border: none;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.feed-comment-actions button:hover {
  color: var(--violet-400);
  background: rgba(139,92,246,0.08);
}

/* Nested replies toggle */
.nested-replies-preview {
  margin-top: 6px;
}
.view-replies-btn {
  background: none;
  border: none;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}
.view-replies-btn:hover { color: var(--violet-400); }
.view-replies-btn svg { width: 14px; height: 14px; }

.nested-replies-list {
  margin-top: 8px;
  padding-left: 12px;
  border-left: 2px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Comment toggle button (message-circle under post) */
.feed-comment-toggle {
  background: none;
  border: 1px solid transparent;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  color: var(--text-muted);
}
.feed-comment-toggle:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--violet-400);
}

/* Poll bar pop animation */
.poll-option-bar {
  transition: transform 0.2s ease;
}
.poll-option-bar:active {
  transform: scale(0.97);
}
/* Like button – no hover, pulse when liked, shake on toggle */
.feed-like-btn {
  background: none;
  border: 1px solid transparent;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  transition: color 0.15s;
  user-select: none;
}

/* When liked – red color */
.feed-like-btn.liked {
  color: #ef4444;
}

/* Count badge inside like button (same as comment count) */
.feed-like-btn .feed-like-count {
  font-size: 0.75rem;
  font-weight: 500;
}

/* Pulse animation (heartbeat) */
@keyframes likePulse {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.3); }
  50%  { transform: scale(0.95); }
  75%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Shake animation */
@keyframes likeShake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-3px); }
  40%  { transform: translateX(3px); }
  60%  { transform: translateX(-3px); }
  80%  { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

/* Apply pulse + shake when toggling */
.feed-like-btn.animating {
  animation: likePulse 0.4s ease, likeShake 0.3s ease;
}
.feed-comment-toggle .feed-comment-count {
  font-size: 0.75rem;
  font-weight: 500;
}

/* Shrink comment avatars */
.feed-comment-avatar {
  width: 26px !important;
  height: 26px !important;
}

/* Shrink liked-by faces avatars */
.liked-by-faces img,
.liked-by-faces .avatar-placeholder {
  width: 20px !important;
  height: 20px !important;
  border-radius: 50%;
  object-fit: cover;
}

.liked-by-faces {
  display: flex;
  align-items: center;
  gap: -6px;                 /* negative gap for overlapping effect, adjust via margin */
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.liked-by-faces img + img,
.liked-by-faces .avatar-placeholder + .avatar-placeholder {
  margin-left: -10px;        /* overlap the avatars slightly */
}

.liked-by-faces span {
  margin-left: 8px;
}

.feed-post-avatar {
  width: 34px !important;
  height: 34px !important;
}