/**
 * Newsfeed CSS
 * Main stylesheet for the newsfeed page
 * Optimized for performance with critical styles
 */

/* CSS Variables */
:root {
  --lunker-primary: #2d5a2d;
  --lunker-cream-light: #f5f3f0;
  --lunker-cream: #e8e4df;
  --background-cream: #f5f3f0;
  --card-background: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --border-light: #dee2e6;
  --shadow-light: 0 2px 12px rgba(45, 90, 45, 0.08);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.12);
  --border-radius-card: 22px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-sm: 8px;
  --spacing-xs: 4px;
  --transition-medium: 0.2s ease;
  --border-radius: 8px;
  --border-radius-pill: 20px;
  --lunker-hover: rgba(45, 90, 45, 0.1);
}

/* Base Styles */
body {
  margin: 0;
  padding: 0;
  background: var(--background-cream);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary);
}

/* Container */
.container-feed {
  max-width: 600px;
  margin: 2rem auto;
  padding: 0 var(--spacing-md);
}

/* Catch Card */
.catch-card {
  background: var(--card-background);
  border-radius: var(--border-radius-card);
  box-shadow: var(--shadow-light);
  margin-bottom: var(--spacing-xl);
  overflow: hidden;
  border: 1px solid var(--border-light);
  opacity: 1;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.catch-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* Removed fadeIn animation */

/* Removed staggered animation for cards to prevent flashing */

/* First two images load eagerly */
.catch-card:nth-child(-n+2) .catch-image {
  content-visibility: auto;
}

/* Post Header */
.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  gap: var(--spacing-md);
  background: var(--lunker-cream-light);
  border-bottom: 1px solid var(--lunker-cream);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--lunker-cream);
  box-shadow: var(--shadow-light);
}

.username {
  font-weight: 600;
  color: var(--text-primary);
}

.post-time {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Follow Button */
.post-follow-btn {
  background: white;
  border: 1px solid var(--lunker-primary);
  color: var(--lunker-primary);
  padding: 4px 12px;
  border-radius: var(--border-radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.post-follow-btn:hover {
  background: var(--lunker-primary);
  color: white;
}

.post-follow-btn.following {
  background: var(--lunker-primary);
  color: white;
}

.post-follow-btn.following:hover {
  background: #234523;
}

/* Image Wrapper */
.image-wrapper {
  position: relative;
  background: var(--lunker-cream-light);
  min-height: 200px;
}

.catch-image {
  width: 100%;
  height: auto;
  display: block;
  background: var(--lunker-cream-light);
}

/* Removed loading animation for images */

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Post Body */
.post-body {
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--card-background);
}

.status {
  margin: 0 0 var(--spacing-sm);
  line-height: 1.5;
}

.hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.hashtags span {
  background: var(--lunker-cream-light);
  padding: 4px 10px;
  border-radius: var(--border-radius-pill);
  font-size: 0.9rem;
  color: var(--lunker-primary);
}

/* Three Dots Menu */
.card-actions-menu {
  position: relative;
}

.dots-menu-btn {
  background: none;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  border-radius: 50%;
}

.dots-menu-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.dots-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  min-width: 180px;
  display: none;
  overflow: hidden;
  margin-top: 8px;
  z-index: 100;
}

.dots-menu-dropdown.show {
  display: block;
  animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #333;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: #f8f9fa;
}

.dropdown-item.delete {
  color: #dc3545;
}

.dropdown-item i {
  font-size: 16px;
}

.dropdown-divider {
  height: 1px;
  background: #e9ecef;
  margin: 0;
}

/* Comment Sections */
.feed-comments, .feed-comment-form {
  display: none;
}

.feed-comments.show, .feed-comment-form.show {
  display: block;
}

.feed-comments {
  padding: var(--spacing-lg);
  background: rgba(255, 255, 255, 0.3);
  border-top: 1px solid var(--lunker-cream);
}

.feed-comment-form {
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--lunker-cream-light);
  border-top: 1px solid var(--lunker-cream);
  display: none;
  gap: var(--spacing-sm);
}

.feed-comment-form.show {
  display: flex;
}

.feed-comment-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-pill);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.feed-comment-form input:focus {
  border-color: var(--lunker-primary);
}

.feed-comment-form button {
  background: var(--lunker-primary);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: var(--border-radius-pill);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.feed-comment-form button:hover {
  background: #234523;
}

/* Unified Comments Styles */
.unified-comments-container {
  padding: 0;
}

.comment-threads {
  padding: 0;
}

.comment-thread {
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md);
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--border-radius);
}

.uc-comment {
  display: flex;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-sm);
  position: relative;
  margin-bottom: var(--spacing-sm);
}

.uc-comment.uc-reply {
  margin-left: 48px;
  padding-left: var(--spacing-sm);
  border-left: 2px solid var(--lunker-cream);
  margin-bottom: var(--spacing-sm);
}

.uc-avatar {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

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

.uc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.uc-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex: 1;
}

.uc-username {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
}

.uc-username:hover {
  text-decoration: underline;
}

.uc-follow-btn {
  background: white;
  border: 1px solid var(--lunker-primary);
  color: var(--lunker-primary);
  padding: 2px 8px;
  border-radius: var(--border-radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.uc-follow-btn:hover {
  background: var(--lunker-primary);
  color: white;
}

.uc-follow-btn.following {
  background: var(--lunker-primary);
  color: white;
}

.uc-time {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.uc-menu {
  position: relative;
}

.uc-menu-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s;
}

.uc-menu-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.uc-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 120px;
  display: none;
  z-index: 100;
  margin-top: 4px;
}

.uc-menu-dropdown.show {
  display: block;
}

.uc-delete-btn {
  background: none;
  border: none;
  color: #dc3545;
  padding: 8px 12px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.uc-delete-btn:hover {
  background: rgba(220, 53, 69, 0.1);
}

.uc-body {
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.4;
  word-wrap: break-word;
  margin-bottom: 4px;
}

.uc-reply-tag {
  color: var(--lunker-primary);
  font-weight: 500;
}

.uc-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-top: 4px;
}

.uc-react-btn, .uc-reply-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--border-radius);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.uc-react-btn:hover, .uc-reply-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--lunker-primary);
}

.uc-react-btn.reacted {
  color: #e74c3c;
}

.uc-reaction-display {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.uc-reaction-emojis {
  display: flex;
  gap: 2px;
}

.uc-reaction-emoji-small {
  font-size: 0.9rem;
  cursor: pointer;
}

.uc-reaction-emoji-small:hover {
  transform: scale(1.1);
}

.uc-reaction-count-text {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.uc-reaction-count-text:hover {
  text-decoration: underline;
}

.uc-reply-form {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
  padding: var(--spacing-sm) 0;
}

.uc-reply-input {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-pill);
  font-size: 0.9rem;
  outline: none;
}

.uc-reply-input:focus {
  border-color: var(--lunker-primary);
}

.uc-reply-submit {
  background: var(--lunker-primary);
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: var(--border-radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.uc-reply-submit:hover {
  background: #234523;
}

.uc-no-comments {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
  color: var(--text-secondary);
}

.uc-no-comments i {
  font-size: 2rem;
  margin-bottom: var(--spacing-sm);
  opacity: 0.5;
}

.uc-no-comments p {
  margin: 0;
  font-size: 0.95rem;
}

.comment-replies {
  margin-left: 48px;
  padding-left: 0;
}

/* Comment Reaction Picker */
.uc-reaction-picker {
  position: absolute;
  background: white;
  border-radius: 25px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  padding: 6px 10px;
  display: flex;
  gap: 2px;
  z-index: 1200;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.uc-reaction-picker button {
  font-size: 1.4rem;
  background: none;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.uc-reaction-picker button:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: scale(1.1);
}

/* Shared Catch Styles */
.shared-catch {
  position: relative;
}

.share-header {
  background: white;
  border-bottom: 1px solid var(--border-light);
  padding: 12px var(--spacing-lg);
  position: relative;
}

.share-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(135deg, var(--lunker-primary), #4a9d4a);
}

.share-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.sharer-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.share-text {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.share-text a {
  color: var(--lunker-primary);
  font-weight: 600;
  text-decoration: none;
}

.share-text a:hover {
  text-decoration: underline;
}

.share-time {
  opacity: 0.7;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.share-description {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--lunker-cream-light);
  border-radius: 8px;
  font-style: italic;
  color: var(--text-primary);
  border-left: 3px solid var(--lunker-primary);
}

.original-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: normal;
}

/* Share Modal */
.share-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: modalFadeIn 0.2s ease;
}

.share-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-modal-content {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from { 
    opacity: 0; 
    transform: translateY(-20px) scale(0.95); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

.share-modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--lunker-cream-light);
}

.share-modal-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}

.share-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.share-modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.share-modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.catch-preview {
  background: var(--lunker-cream-light);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.catch-preview-header {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.catch-preview-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
}

.catch-preview-info {
  flex: 1;
}

.catch-preview-species {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.catch-preview-location {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.catch-preview-owner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.catch-preview-owner img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.share-description-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 1rem;
  resize: vertical;
  min-height: 80px;
  margin-bottom: 16px;
}

.share-description-input:focus {
  outline: none;
  border-color: var(--lunker-primary);
  box-shadow: 0 0 0 3px rgba(45, 90, 45, 0.1);
}

.share-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--lunker-cream-light);
}

.share-btn-cancel, .share-btn-confirm {
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.share-btn-cancel {
  background: none;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.share-btn-cancel:hover {
  background: var(--lunker-cream-light);
}

.share-btn-confirm {
  background: var(--lunker-primary);
  border: none;
  color: white;
}

.share-btn-confirm:hover {
  background: #234523;
}

.share-btn-confirm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Social Interaction Bar */
.social-interaction-bar {
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--card-background);
  border-top: 1px solid var(--lunker-cream);
}

/* --- Single-line social bar layout (all screen sizes) --- */
.social-interaction-bar {
  display: flex;                 /* place both rows side-by-side */
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

/* Treat each existing row as a cluster */
.social-interaction-bar .social-bar-row { width: auto !important; }
.social-interaction-bar .social-bar-row:first-child {
  margin: 0;                     /* remove inter-row gap */
  justify-content: flex-start;
  flex: 0 1 auto;
}
.social-interaction-bar .social-bar-row:last-child {
  margin: 0 0 0 auto;            /* push actions cluster to the right */
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 12px;
}
/* Ensure comment button doesn't push away share inside its cluster */
.social-interaction-bar .social-bar-row:last-child .clean-comment-btn { 
  margin-left: 0 !important; 
}

.social-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  gap: 12px;            /* spacing between items */
  flex-wrap: nowrap;    /* never wrap */
  width: auto !important;          /* allow row clusters to size to content */
  flex: 0 0 auto;                   /* do not grow to 100% */
}
/* Keep social bar on a single line across all sizes */
.social-bar-row > * {
  flex: 0 0 auto;       /* children keep intrinsic width */
  white-space: nowrap;  /* no internal wrapping */
  min-width: 0;         /* allow shrink without wrapping long text */
}

/* Let reaction summary compress if needed, without forcing wraps */
.reaction-display {
  margin-left: 6px;     /* was auto; now a small gap from heart */
  flex: 0 1 auto;       /* allow a little shrink */
  min-width: 0;
}

/* Buttons/text in the bar should never wrap */
.clean-heart-btn,
.clean-heart-btn span,
.action-btn.share-btn,
.clean-comment-btn,
.reaction-count-text {
  white-space: nowrap;
}

/* First row (react + count): keep cluster on the left */
.social-bar-row:first-child {
  margin-bottom: 0;                 /* no vertical gap; single-line layout */
  justify-content: flex-start; /* cluster left */
}

.clean-heart-btn {
  background: none;
  border: none;
  color: #65676b;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--border-radius);
  transition: all var(--transition-medium);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  white-space: nowrap;
  flex: 0 0 auto;
  height: 32px;
}

.clean-heart-btn .reaction-emoji-user {
  font-size: 1.2rem;
  margin-right: 2px;
}

.clean-heart-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #1877f2;
}

.clean-heart-btn.reacted {
  color: #e74c3c;
}

.clean-heart-btn.reacted:hover {
  color: #c0392b;
}

.clean-heart-btn i {
  font-size: 1.2rem;
  transition: all var(--transition-medium);
}

.clean-heart-btn.reacted i {
  animation: heartPop 0.3s ease;
}

@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.reaction-display {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #65676b;
  font-size: 0.9rem;
  margin-left: 6px !important;
  padding: 6px 12px;
  height: 32px;
  background: var(--lunker-cream-light);
  border-radius: var(--border-radius-pill);
}

.reaction-emojis {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: var(--spacing-xs);
}

.reaction-emoji-small {
  font-size: 1rem;
  cursor: pointer;
  transition: transform var(--transition-medium);
}

.reaction-emoji-small:hover {
  transform: scale(1.2);
}

.reaction-count-text {
  font-weight: 500;
  color: #65676b;
  cursor: pointer;
  transition: color var(--transition-medium);
}

.reaction-count-text:hover {
  color: var(--lunker-primary);
  text-decoration: underline;
}

/* Action Buttons */
.action-btn {
  background: none;
  border: none;
  color: #65676b;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--border-radius);
  transition: all var(--transition-medium);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  flex: 0 0 auto;
  justify-content: center;
  height: 32px;
}

.action-btn:hover {
  background: var(--lunker-hover);
  color: var(--lunker-primary);
}

.action-btn i {
  font-size: 1.1rem;
}

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

.action-btn.share-btn:hover {
  background: var(--lunker-hover);
  color: #234523;
}

.share-count, .comment-count {
  background: var(--lunker-cream);
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 4px;
  transition: all 0.3s ease;
  display: inline-block;
  min-width: 20px;
  text-align: center;
}

.share-count.updated {
  animation: countPop 0.4s ease;
}

@keyframes countPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); background: var(--lunker-primary); color: white; }
  100% { transform: scale(1); }
}

.clean-comment-btn {
  background: var(--lunker-cream-light);
  border: none;
  color: #65676b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: var(--border-radius-pill);
  transition: all var(--transition-medium);
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  flex: 0 0 auto;
  margin-left: auto;
  height: 32px;
}

.clean-comment-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #1877f2;
}

.clean-comment-btn.expanded {
  color: #1877f2;
  background: rgba(24, 119, 242, 0.1);
}

.clean-comment-btn i {
  font-size: 1.2rem;
}

/* Reaction Picker */
.clean-reaction-picker {
  position: absolute;
  background: white;
  border-radius: 25px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  padding: 8px 12px;
  display: flex;
  gap: 4px;
  z-index: 1200;
  border: 1px solid rgba(0, 0, 0, 0.1);
  animation: pickerFadeIn 0.2s ease-out;
}

@keyframes pickerFadeIn {
  from { 
    opacity: 0; 
    transform: translateY(8px) scale(0.95); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

.clean-reaction-picker button {
  font-size: 1.8rem;
  background: none;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: all var(--transition-medium);
  display: flex;
  align-items: center;
  justify-content: center;
}

.clean-reaction-picker button:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: scale(1.1);
}

/* Reaction Modal */
.reaction-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.2s ease;
}

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

.reaction-modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease;
}

.reaction-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9fa;
}

.reaction-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1c1e21;
  margin: 0;
}

.reaction-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #65676b;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.reaction-modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.reaction-tabs {
  display: flex;
  background: #f8f9fa;
  border-bottom: 1px solid #e5e5e5;
  overflow-x: auto;
}

.reaction-tab {
  background: none;
  border: none;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #65676b;
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  min-width: max-content;
}

.reaction-tab.active {
  color: #1877f2;
  border-bottom-color: #1877f2;
  background: rgba(24, 119, 242, 0.1);
}

.reaction-tab:hover:not(.active) {
  background: rgba(0, 0, 0, 0.05);
}

.reaction-tab-emoji {
  font-size: 1.2rem;
}

.reaction-tab-count {
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.reaction-users-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px 0;
}

.reaction-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  transition: background 0.2s ease;
  cursor: pointer;
}

.reaction-user-item:hover {
  background: #f8f9fa;
}

.reaction-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e5e5e5;
}

.reaction-user-info {
  flex: 1;
  min-width: 0;
}

.reaction-user-name {
  font-weight: 600;
  color: #1c1e21;
  font-size: 0.95rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reaction-user-username {
  color: #65676b;
  font-size: 0.85rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reaction-user-emoji {
  font-size: 1.2rem;
  opacity: 0.8;
}

.reaction-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #65676b;
}

.reaction-loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e5e5e5;
  border-top: 2px solid #1877f2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 12px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  z-index: 3000;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translate(-50%, 100%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translate(-50%, 0);
    opacity: 1;
  }
  to {
    transform: translate(-50%, 100%);
    opacity: 0;
  }
}

/* No Content State */
.no-content {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

/* Social Interaction Bar - Mobile Fix */
@media (max-width: 500px) {
  .social-interaction-bar {
    padding: 8px 12px;
  }
  
  /* First row: reactions */
  .social-bar-row:first-child {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 6px;
    height: 32px;
  }
  
  /* Second row: MUST stay on one line */
  .social-bar-row { flex-wrap: nowrap !important; }
  .social-bar-row > * { flex: 0 0 auto !important; white-space: nowrap !important; }

  .social-bar-row:last-child {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    height: 32px !important;
    gap: 8px !important;
    width: auto !important;
    flex-wrap: nowrap !important;
  }
  
  /* Share button styling */
  .social-bar-row:last-child .action-btn.share-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px 8px !important;
    height: 30px !important;
    border: none !important;
    background: none !important;
    color: #65676b !important;
    cursor: pointer !important;
    font-size: 0.9rem !important;
    flex: 0 0 auto !important;
    gap: 4px !important;
  }
  
  /* Comment button styling */
  .social-bar-row:last-child .clean-comment-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px 8px !important;
    height: 30px !important;
    border: none !important;
    background: none !important;
    color: #65676b !important;
    cursor: pointer !important;
    font-size: 0.9rem !important;
    flex: 0 0 auto !important;
    gap: 4px !important;
    margin-left: auto !important;
  }
  
  /* Fix share/comment button width forcing full row */
  .social-interaction-bar .social-bar-row:last-child .action-btn,
  .social-interaction-bar .social-bar-row:last-child .clean-comment-btn {
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    min-width: 0 !important;
  }
  
  /* Hide text labels but keep icons and counts visible */
  .social-bar-row .action-btn.share-btn span:not(.share-count) {
    display: none !important;
  }
  
  .social-bar-row .clean-comment-btn span:not(.comment-count) {
    display: none !important;
  }
  
  .clean-heart-btn .reaction-text {
    display: none !important;
  }
  
  /* Ensure icons are visible */
  .social-bar-row .action-btn i,
  .social-bar-row .clean-comment-btn i {
    display: inline-block !important;
    font-size: 1rem !important;
  }
  
  /* Ensure counts are visible */
  .social-bar-row .share-count,
  .social-bar-row .comment-count {
    display: inline-block !important;
    font-size: 0.8rem !important;
    padding: 0 4px !important;
    margin-left: 2px !important;
  }
  
  /* Reaction display */
  .reaction-display {
    padding: 4px 8px;
    height: 30px;
    font-size: 0.85rem;
    margin-left: auto;
    min-width: 0 !important;
  }
  
  /* Clean heart button */
  .clean-heart-btn {
    padding: 4px 8px;
    height: 30px;
    font-size: 0.9rem;
  }

  /* --- Single-line overrides for mobile --- */
  .social-interaction-bar { display: grid !important; align-items: center !important; grid-auto-flow: column !important; }
  .social-interaction-bar .social-bar-row { width: auto !important; }
  .social-interaction-bar .social-bar-row:first-child { margin-bottom: 0 !important; }
  .social-interaction-bar .social-bar-row:last-child { 
    display: grid !important; 
    grid-template-columns: 1fr 1fr !important; 
    justify-items: center !important; 
    align-items: center !important; 
    width: auto !important; 
    gap: 0 !important; 
    margin: 0 !important;
  }
  .social-interaction-bar .social-bar-row:last-child .clean-comment-btn { margin-left: 0 !important; }
}

/* Remove conflicting mobile styles - DON'T DUPLICATE */
@media (max-width: 480px) {
  .container-feed {
    padding: 0 10px;
    margin: 1rem auto;
  }
  
  .catch-card {
    border-radius: 16px;
    margin-bottom: 20px;
  }
  
  .post-header {
    padding: 12px 16px;
  }
  
  /* Modal styles for mobile */
  .reaction-modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .reaction-tab {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
  
  .reaction-user-avatar {
    width: 32px;
    height: 32px;
  }
  
  .share-modal-content {
    width: 95%;
    margin: 10px;
  }
}

/* Performance Optimizations */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Loading State Animations */
.skeleton-loader {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
