/* Clout Web UI Styles - feed layer
   Feed items, markdown rendering, virtual scroll, media upload/preview,
   link previews, reactions, emoji picker, content warnings, mentions,
   search results, feed filters/sort/hop tabs, inline compose, thread view. */

@layer feed {
/* Feed */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Virtual Scroll - renders only visible posts for performance */
.virtual-scroll-container {
  position: relative;
  width: 100%;
}

.virtual-scroll-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  will-change: transform;
}

.feed-item {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 1rem 1.25rem;
  transition: background 0.2s, border-color 0.2s, opacity 0.3s ease, transform 0.3s ease;
}

.feed-item:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

/* Entrance animation for real-time prepended posts.
   Added by prependFeedItem() and removed after the transition completes.
   Fades in + slides down from above so new posts arrive visibly without
   yanking the user's scroll position. */
.feed-item.entering {
  opacity: 0;
  transform: translateY(-10px);
}

.feed-item.entered {
  opacity: 1;
  transform: translateY(0);
}

.feed-item-wrapper {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.feed-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--bg-hover);
  border-radius: 50%;
  border: 1px solid var(--border);
  overflow: hidden;
}

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

/* Generative identicon avatar — a div sized to fill its parent avatar
   container, with a fractal SVG (derived from the author's public key)
   as its background. See js/utils/identicon.js. The parent (.feed-avatar /
   .profile-avatar) provides clipping via border-radius + overflow. */
.avatar-identicon {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 50%;
}

.feed-post-content {
  flex: 1;
  min-width: 0;
}

.feed-author {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  font-family: monospace;
}

.feed-content {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  line-height: 1.6;
  /* Prevent long unbroken text from overflowing horizontally */
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Markdown formatting in posts */
.feed-content code {
  background: var(--surface);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  font-size: 0.9em;
  border: 1px solid var(--border);
}

.feed-content pre {
  background: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0.5rem 0;
  border: 1px solid var(--border);
}

.feed-content pre code {
  background: none;
  padding: 0;
  border: none;
  font-size: 0.85em;
  line-height: 1.5;
}

.feed-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 0.5rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  color: var(--text-dim);
  font-style: italic;
}

.feed-content strong {
  font-weight: 600;
  color: var(--text);
}

.feed-content em {
  font-style: italic;
}

.feed-content s {
  text-decoration: line-through;
  opacity: 0.7;
}

.feed-content a {
  color: var(--accent);
  text-decoration: underline;
}

.feed-content a:hover {
  text-decoration: none;
}

.feed-timestamp {
  color: var(--text-dim);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.witness-emoji {
  font-size: 1rem;
  line-height: 1;
}

.feed-reply-indicator {
  color: var(--secondary);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  font-style: italic;
}

.feed-reply-indicator a {
  color: var(--primary);
  text-decoration: none;
  font-style: normal;
  font-weight: 500;
}

.feed-reply-indicator a:hover {
  text-decoration: underline;
  color: var(--secondary);
}

/* Reply button in thread view */
.btn-reply {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-reply:hover {
  background: var(--secondary);
}

.feed-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}

/* Feed actions container */
.feed-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Action buttons in feed (Save, Reply, Mute, Edit, Delete) */
.btn-action {
  background: transparent;
  color: var(--text-dim);
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.btn-action.active {
  color: var(--primary);
}

.btn-action.btn-reply:hover {
  background: rgba(34, 197, 94, 0.1);
  color: var(--hop-1, #22c55e);
}

.btn-action.btn-save:hover {
  background: rgba(234, 179, 8, 0.1);
  color: var(--hop-2, #eab308);
}

.btn-action.btn-revise:hover {
  background: rgba(139, 92, 246, 0.1);
  color: var(--secondary, #8b5cf6);
}

.btn-action.btn-mute:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.btn-action.btn-retract:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Edited badge */
.edited-badge {
  font-size: 0.7rem;
  color: var(--text-dim);
  background: rgba(99, 102, 241, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.5rem;
}

/* Thread View */
.thread-parent-post {
  border: 2px solid var(--primary) !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
}

.thread-replies {
  margin-top: 2rem;
}

.thread-replies h3 {
  color: var(--text);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  padding-left: 0.5rem;
  border-left: 3px solid var(--secondary);
}

.thread-replies-list .feed-item {
  margin-left: 1.5rem;
  border-left: 2px solid var(--border);
}

/* =========================================================================
   MEDIA UPLOAD STYLES
   ========================================================================= */

/* Media upload section in post form */
.media-upload-section {
  margin: 1rem 0;
}

/* Drop zone */
.media-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.media-drop-zone:hover,
.media-drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.drop-icon {
  font-size: 2rem;
}

.drop-text {
  color: var(--text);
}

.drop-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
  padding: 0;
}

.btn-link:hover {
  color: var(--primary-hover);
}

/* Media preview */
.media-preview {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.media-preview-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}

#media-preview-name {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#media-preview-size {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.btn-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-remove:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.media-preview-content {
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: 300px;
  overflow: hidden;
}

.media-preview-content img {
  max-width: 100%;
  max-height: 280px;
  border-radius: 4px;
  object-fit: contain;
}

.media-preview-content video {
  max-width: 100%;
  max-height: 280px;
  border-radius: 4px;
}

.media-preview-content audio {
  width: 100%;
}

.file-icon {
  font-size: 3rem;
  color: var(--text-dim);
  padding: 2rem;
}

/* Upload progress */
.media-upload-progress {
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border);
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
  border-radius: 2px;
}

#progress-text {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* =========================================================================
   POST MEDIA DISPLAY STYLES
   ========================================================================= */

/* Media in feed posts */
.post-media {
  margin-top: 1rem;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.post-media img {
  max-width: 100%;
  max-height: 400px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

.post-media video {
  max-width: 100%;
  max-height: 400px;
  display: block;
  margin: 0 auto;
}

.post-media audio {
  width: 100%;
  display: block;
}

.post-media-file {
  padding: 1rem;
  text-align: center;
}

.media-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s;
}

.media-link:hover {
  background: var(--primary-hover);
}

.media-error {
  color: var(--text-dim);
  font-style: italic;
  padding: 1rem;
  display: block;
  text-align: center;
}

/* Media unavailable state (hop distance or offline author) */
.media-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px dashed var(--border);
  color: var(--text-dim);
  text-align: center;
  min-height: 100px;
}

.media-unavailable-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

.media-unavailable-text {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.media-unavailable-hint {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Feed item with media indicator */
.feed-item.has-media {
  border-left: 3px solid var(--primary);
}

/* =========================================================================
   LINK PREVIEW STYLES
   ========================================================================= */

/* Attachment type selector */
.attachment-type-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.attachment-label {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.attachment-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.attachment-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.attachment-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.attachment-icon {
  font-size: 1rem;
}

/* Link input section */
.link-input-section {
  margin: 1rem 0;
}

.link-input-wrapper {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.link-input-wrapper .input {
  flex: 1;
}

/* Link preview card (in post form) */
.link-preview-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 1rem;
}

.link-preview-card .btn-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 1;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
}

.link-preview-image {
  width: 100%;
  height: 150px;
  background: var(--bg-hover);
  background-size: cover;
  background-position: center;
}

.link-preview-image:empty {
  display: none;
}

.link-preview-content {
  padding: 1rem;
}

.link-preview-site {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.link-preview-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-preview-description {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Link fetch status */
.link-fetch-status {
  padding: 1rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.link-fetch-status.error {
  color: var(--error);
}

/* Link preview in feed posts */
.post-link-preview {
  display: block;
  text-decoration: none;
  margin-top: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
}

.post-link-preview:hover {
  border-color: var(--primary);
}

.post-link-preview-image {
  width: 100%;
  max-height: 200px;
  overflow: hidden;
  background-color: var(--bg-hover);
}

.post-link-preview-image img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: cover;
  display: block;
}

.post-link-preview-image.loaded {
  background-color: transparent;
}

.post-link-preview-content {
  padding: 0.75rem 1rem;
}

.post-link-preview-site {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-link-preview-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0.25rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-link-preview-description {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-link-preview-url {
  font-size: 0.7rem;
  color: var(--primary);
  margin-top: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Expired link preview */
.post-link-expired {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 1rem;
}

.post-link-expired-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

.post-link-expired-text {
  font-size: 0.9rem;
}

.post-link-expired-url {
  font-size: 0.75rem;
  color: var(--primary);
  margin-top: 0.5rem;
  word-break: break-all;
}

/* Feed item with link - no extra indicator needed, preview card is visible */
.feed-item.has-link {
  /* Link preview card provides visual indication */
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    white-space: nowrap;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .media-drop-zone {
    padding: 1.5rem;
  }

  .post-media img,
  .post-media video {
    max-height: 300px;
  }

  /* Mobile feed footer - stack vertically */
  .feed-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  /* Ensure reactions stay in a horizontal row */
  .reactions-bar {
    flex-direction: row;
    width: 100%;
  }

  /* Feed actions row on mobile */
  .feed-actions {
    width: 100%;
    justify-content: flex-start;
  }

  /* Tighten the helpful empty-state (incl. the visitor "Welcome to Clout"
     card) on small screens — the default 3rem 2rem padding is heavy on
     ~320px viewports and makes the card feel cramped next to the grid. */
  .empty-state-helpful {
    padding: 2rem 1.25rem;
  }

  /* Reduce feed-item chrome on mobile so post content has more room next
     to the 48px avatar. */
  .feed-item {
    padding: 1rem;
  }

  .feed-item:hover {
    /* translateX on touch devices can cause a faint horizontal overflow;
       drop it on mobile where hover isn't meaningful anyway. */
    transform: none;
  }
}

/* =========================================================================
   NSFW, REPUTATION, SETTINGS & TAGS STYLES
   ========================================================================= */

/* NSFW Toggle in Post Form */
.nsfw-toggle {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Feed Header with Reputation */
.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.feed-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Reputation Badge */
.reputation-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
}

/* Author Tags */
.author-tags {
  display: inline-flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.tag-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* NSFW Badge */
.nsfw-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: #ef4444;
  color: white;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* NSFW Post styling */
.feed-item.nsfw-post {
  border-left: 3px solid #ef4444;
}
/* =========================================================================
   REACTIONS (Discord-style)
   ========================================================================= */

.reactions-bar {
  display: flex;
  gap: 0.25rem;
  flex-wrap: nowrap;
  align-items: center;
}

.reaction-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.reaction-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.reaction-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
}

.reaction-count {
  font-size: 0.75rem;
  color: var(--text-dim);
  min-width: 0.5rem;
  text-align: center;
}

.reaction-btn.active .reaction-count {
  color: var(--primary);
}

/* Add reaction button (+) */
.reaction-btn.reaction-picker-btn {
  font-size: 0.9rem;
  padding: 0.2rem 0.5rem;
  color: var(--text-dim);
  font-weight: bold;
}

.reaction-btn.reaction-picker-btn:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

/* Expand button for mobile (...) */
.reaction-btn.reaction-expand-btn {
  display: none;
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 0.2rem 0.4rem;
}

.reaction-btn.reaction-expand-btn:hover {
  color: var(--primary);
}

/* Overflow reactions - hidden on mobile by default */
.reaction-btn.reaction-overflow {
  /* Visible on desktop */
}

/* Mobile: hide overflow reactions and show expand button */
@media (max-width: 768px) {
  .reaction-btn.reaction-overflow {
    display: none;
  }

  .reaction-btn.reaction-expand-btn {
    display: inline-flex;
  }

  /* When expanded, show all reactions */
  .reactions-bar.expanded .reaction-btn.reaction-overflow {
    display: inline-flex;
  }

  .reactions-bar.expanded .reaction-btn.reaction-expand-btn {
    display: none;
  }
}
/* =========================================================================
   EMOJI PICKER
   ========================================================================= */

.emoji-picker {
  position: fixed;
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  width: 320px;
  max-height: 400px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.emoji-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.emoji-picker-title {
  font-weight: 600;
  color: var(--text);
}

.emoji-picker-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  line-height: 1;
}

.emoji-picker-close:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.emoji-picker-search {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.emoji-picker-search input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
}

.emoji-picker-search input:focus {
  outline: none;
  border-color: var(--primary);
}

.emoji-picker-content {
  overflow-y: auto;
  padding: 0.5rem;
  flex: 1;
}

.emoji-category {
  margin-bottom: 0.75rem;
}

.emoji-category-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}

.emoji-option {
  background: none;
  border: none;
  padding: 0.35rem;
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  line-height: 1;
}

.emoji-option:hover {
  background: var(--bg-hover);
}

/* Responsive emoji picker */
@media (max-width: 400px) {
  .emoji-picker {
    width: calc(100vw - 32px);
    left: 16px !important;
    right: 16px;
  }

  .emoji-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}
/* =========================================================================
   CONTENT WARNINGS
   ========================================================================= */

.content-warning-section {
  margin-bottom: 1rem;
}

.cw-input-wrapper {
  margin-top: 0.5rem;
  padding-left: 1.5rem;
}

.cw-input-wrapper .input {
  width: 100%;
}

.cw-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 500;
}

.feed-item.has-cw {
  border-left: 3px solid #f59e0b;
}

.cw-wrapper {
  margin: 0.5rem 0;
}

.cw-reveal-btn {
  width: 100%;
  background: rgba(245, 158, 11, 0.1);
  border: 1px dashed #f59e0b;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: #f59e0b;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.cw-reveal-btn:hover {
  background: rgba(245, 158, 11, 0.2);
}

.cw-content {
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* =========================================================================
   MENTIONS
   ========================================================================= */

.mention {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  padding: 0.1rem 0.3rem;
  border-radius: 0.25rem;
  font-family: monospace;
  font-size: 0.85em;
}

.mention:hover {
  background: rgba(99, 102, 241, 0.2);
}
/* =========================================================================
   SEARCH BAR (legacy removed — search is now in sidebar)
   ========================================================================= */

.search-results-header {
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}
/* =========================================================================
   FEED FILTERS
   ========================================================================= */

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.feed-filters {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-card);
  padding: 0.25rem;
  border-radius: 0.5rem;
}

/* Feed Sort (legacy .feed-sort / .filter-btn removed — replaced by .feed-sort-row / .filter-icon-btn) */
/* Load More Button */
.load-more-container {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0;
  margin-top: 0.5rem;
}

.load-more-btn {
  min-width: 150px;
}

.load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Tag Filters */
.tag-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border-radius: 0.5rem;
  flex-wrap: wrap;
}

.tag-filter-label {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
}

.tag-filter-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tag-pill {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  border-radius: 1rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.tag-pill:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--primary);
}

.tag-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* =========================================================================
   NEW POSTS BANNER
   ========================================================================= */

.new-posts-banner {
  margin-bottom: 1rem;
}

.new-posts-banner button {
  width: 100%;
  padding: 0.75rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--primary);
  border-radius: 0.5rem;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.new-posts-banner button:hover {
  background: rgba(99, 102, 241, 0.2);
}
/* Decayed post content - "right to be forgotten" */
.post-decayed {
  color: var(--text-dim);
  font-style: italic;
  padding: 1rem;
  background: var(--bg);
  border-radius: 4px;
  display: block;
  text-align: center;
  border: 1px dashed var(--border);
}

.feed-item.decayed .post-content {
  opacity: 0.7;
}

.feed-item.decayed .feed-actions {
  display: none;
}
/* Media Placeholder for Visitors */
.post-media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  margin-top: 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px dashed var(--border);
}

.media-placeholder-icon {
  font-size: 1.25rem;
  opacity: 0.6;
}

.media-placeholder-text {
  color: var(--text-dim);
  font-size: 0.9rem;
}
/* =========================================================================
   HOP FILTER TABS
   ========================================================================= */

.feed-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.feed-tab-btn {
  flex: 1;
  padding: 0.7rem 0.5rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.feed-tab-btn:hover { color: var(--text); }
.feed-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* =========================================================================
   SORT ROW
   ========================================================================= */

.feed-sort-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.feed-sort-pills { display: flex; gap: 0.35rem; }

.sort-pill {
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  border-radius: 999px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sort-pill:hover { color: var(--text); }
.sort-pill.active { background: var(--primary); color: white; }

.sort-separator {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 0.25rem;
}

.feed-filter-icons { display: flex; gap: 0.35rem; }

.filter-icon-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 999px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-dim);
  cursor: pointer;
}

.filter-icon-btn:hover { color: var(--text); }
.filter-icon-btn.active { background: rgba(99, 102, 241, 0.2); color: var(--primary); }

/* =========================================================================
   INLINE COMPOSE
   ========================================================================= */

.inline-compose {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.inline-compose-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.inline-compose-avatar {
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.inline-compose-field {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
}

.inline-compose-field:focus { outline: none; border-color: var(--primary); }

.inline-compose-expanded {
  margin-top: 0.5rem;
  padding-left: calc(36px + 0.75rem);
}

.inline-compose-textarea {
  width: 100%;
  padding: 0.5rem;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  resize: vertical;
  font-family: inherit;
}

.inline-compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
} /* end @layer feed */
