/* Modern Search and Filter Topbar */
.feed-topbar {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 20px rgba(0,0,0,0.08) !important;
  margin-bottom: 1.5rem !important;
  padding: 1.5rem !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  backdrop-filter: blur(10px) !important;
  z-index: 100 !important;
}

.feed-topbar #feed-search,
#feed-search {
  border: 2px solid transparent !important;
  border-radius: 25px !important;
  padding: 12px 20px !important;
  background: rgba(255,255,255,0.9) !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
  transition: all 0.3s ease !important;
  font-size: 14px !important;
  backdrop-filter: blur(10px) !important;
  outline: none !important;
  width: 100% !important;
}

.feed-topbar #feed-search:focus,
#feed-search:focus {
  border-color: #667eea !important;
  box-shadow: 0 6px 25px rgba(102,126,234,0.25) !important;
  background: rgba(255,255,255,1) !important;
  transform: translateY(-1px) !important;
}

.feed-topbar #feed-search::placeholder,
#feed-search::placeholder {
  color: #6c757d !important;
  font-weight: 400 !important;
}

/* Custom Glassmorphic Filter Chips */
.feed-filter-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  position: relative !important;
  overflow: visible !important;
  justify-content: flex-end !important;
}



.feed-filter-chip {
  border: 1px solid rgba(99,102,241,0.35) !important;
  padding: 10px 16px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  letter-spacing: 0.2px !important;
  transition: all 0.25s ease !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.75)) !important;
  color: #0f172a !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 6px 18px rgba(15,23,42,0.06), inset 0 1px 0 rgba(255,255,255,0.65) !important;
  z-index: 2 !important;
  text-transform: capitalize !important;
  border-radius: 999px !important;
  outline: none !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  cursor: pointer !important;
  text-decoration: none !important;
  font-family: inherit !important;
}



.feed-filter-chip:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.85)) !important;
  border-color: rgba(99,102,241,0.5) !important;
  color: #4f46e5 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 10px 24px rgba(99,102,241,0.18), inset 0 1px 0 rgba(255,255,255,0.75) !important;
}

.feed-filter-chip.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: #ffffff !important;
  border-color: rgba(102,126,234,0.6) !important;
  box-shadow: 0 10px 30px rgba(102,126,234,0.4), inset 0 1px 0 rgba(255,255,255,0.35) !important;
  transform: translateY(-1px) !important;
}

/* Focus ring for accessibility */
.feed-filter-chip:focus-visible {
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25), 0 8px 20px rgba(99,102,241,0.15) !important;
}

/* Allow wrapping and maintain spacing on smaller screens */
@media (max-width: 992px) {
  .feed-filter-group { flex-wrap: wrap !important; gap: 8px 10px !important; }
}



/* Modern admin delete buttons */
.btn[data-delete-post],
.btn[data-delete-comment] {
  border: 1px solid rgba(220, 53, 69, 0.3);
  color: #dc3545;
  background: rgba(220, 53, 69, 0.05);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  transition: all 0.2s ease;
  border-radius: 6px;
}

.btn[data-delete-post]:hover,
.btn[data-delete-comment]:hover {
  background: #dc3545;
  color: white;
  border-color: #dc3545;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn[data-delete-post] i,
.btn[data-delete-comment] i {
  font-size: 0.7rem;
}

/* Mobile responsiveness for modern topbar */
@media (max-width: 768px) {
  .feed-topbar {
    padding: 1rem !important;
    margin: 0 -15px 1.5rem -15px;
    border-radius: 0;
  }
  
  .feed-filter-group {
    width: 100%;
    margin-top: 1rem;
    justify-content: center !important;
  }
  
  .feed-filter-chip {
    flex: 1;
    padding: 10px 8px !important;
    font-size: 13px !important;
  }
  
  /* Smaller delete buttons on mobile */
  .btn[data-delete-post],
  .btn[data-delete-comment] {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
  }
}

.feed-card{
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feed-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
}

.feed-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}
.feed-skeleton{
    animation: feedShimmer 1.5s ease-in-out infinite; 
    background: linear-gradient(90deg, #f8fafc 25%, #e2e8f0 37%, #f8fafc 63%); 
    background-size: 400% 100%; 
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.feed-skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: skeletonShine 2s ease-in-out infinite;
}

@keyframes skeletonShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
@keyframes feedShimmer{0%{background-position:100% 0}100%{background-position:-100% 0}}
.feed-image-grid{
    display:grid; 
    gap:8px; 
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.feed-image-grid:hover {
    transform: scale(1.02);
}

.feed-image-grid img {
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.feed-image-grid img:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}
.feed-badge{
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.feed-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.feed-badge:hover::before {
    left: 100%;
}

.feed-badge.request{
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    color: #92400e;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.feed-badge.solution{
    background: linear-gradient(135deg, #a7f3d0, #6ee7b7);
    color: #065f46;
    border: 1px solid rgba(110, 231, 183, 0.3);
}

.feed-badge.status{
    background: linear-gradient(135deg, #c7d2fe, #a5b4fc);
    color: #3730a3;
    border: 1px solid rgba(165, 180, 252, 0.3);
}
.feed-link{ text-decoration:none; cursor:pointer; }
.feed-link{ color:#2563eb !important; }
.feed-link:hover{ text-decoration:underline; color:#1d4ed8 !important; }
.feed-modal{ 
    position: fixed; 
    inset: 0; 
    z-index: 1050; 
    animation: modalFadeIn 0.3s ease-out;
}

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

.feed-modal.d-none{ display: none; }

.feed-modal-backdrop{ 
    position: absolute; 
    inset: 0; 
    background: rgba(0,0,0,0.6); 
    backdrop-filter: blur(8px); 
    transition: all 0.3s ease;
}

.feed-modal-dialog{ 
    position: absolute; 
    top: 5%; 
    left: 50%; 
    transform: translateX(-50%) scale(0.95); 
    width: min(900px, 95vw); 
    max-height: 90vh; 
    overflow: auto; 
    background: #fff; 
    border-radius: 20px; 
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { 
        transform: translateX(-50%) scale(0.9); 
        opacity: 0; 
    }
    to { 
        transform: translateX(-50%) scale(1); 
        opacity: 1; 
    }
}

.feed-modal.open .feed-modal-dialog {
    transform: translateX(-50%) scale(1);
}
.feed-modal-body{ padding:16px; }
.feed-modal-close{ position:absolute; top:8px; right:8px; }
.feed-post-clickable{ cursor:pointer; }
.feed-link{ text-decoration:none; cursor:pointer; }
/* Three-dot menu */
.feed-menu{ position:relative; }
.feed-menu-btn{ background:transparent; border:0; width:28px; height:28px; border-radius:14px; display:flex; align-items:center; justify-content:center; color:#64748b; }
.feed-menu-btn:hover{ background:#f1f5f9; }
.feed-menu-list{ position:absolute; right:0; top:100%; background:#fff; border:1px solid rgba(0,0,0,0.08); border-radius:8px; box-shadow:0 8px 20px rgba(0,0,0,0.08); min-width:140px; z-index:10; display:none; }
.feed-menu-list.open{ display:block; }
.feed-menu-list button{ display:block; width:100%; text-align:left; padding:8px 12px; border:0; background:#fff; font-size:14px; }
.feed-menu-list button:hover{ background:#f8fafc; }

/* Inline editor */
.feed-edit-area{ border:1px solid #e5e7eb; border-radius:12px; padding:8px; background:#fff; }
.feed-edit-actions{ display:flex; gap:8px; margin-top:8px; }
.feed-edit-actions .btn{ padding:6px 12px; font-size:13px; border-radius:8px; }

/* Confirm dialog */
.feed-confirm{ position:fixed; inset:0; z-index:10000; display:flex; align-items:center; justify-content:center; }
.feed-confirm .fc-backdrop{ position:absolute; inset:0; background:rgba(0,0,0,0.5); }
.feed-confirm .fc-panel{ position:relative; background:#fff; border-radius:12px; padding:16px; width:min(420px, 92vw); box-shadow:0 20px 40px rgba(0,0,0,0.2); }
.feed-confirm .fc-actions{ display:flex; gap:8px; justify-content:flex-end; margin-top:12px; }
.feed-confirm .btn{ padding:8px 14px; border-radius:8px; }
.feed-link:hover{ text-decoration:none; }

/* Link preview card */
.feed-link-preview{
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  margin-top: 8px;
}
.feed-link-preview:hover{ box-shadow: 0 10px 24px rgba(0,0,0,0.1); }
.feed-link-preview .lp-image{ background:#f8fafc; display:flex; align-items:center; justify-content:center; }
.feed-link-preview .lp-image img{ width:100%; height:100%; object-fit:cover; display:block; }
.feed-link-preview .lp-body{ padding:10px 12px; min-width:0; }
.feed-link-preview .lp-title{ font-weight:600; color:#111827; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.feed-link-preview .lp-desc{ color:#6b7280; font-size:13px; max-height: 3.6em; overflow:hidden; }
.feed-link-preview .lp-url{ color:#4f46e5; font-size:12px; margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

@media (max-width: 576px){
  .feed-link-preview{ grid-template-columns: 96px 1fr; }
}
.feed-composer .input-group textarea{ 
    resize: none; 
    border-radius: 12px 0 0 12px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.feed-composer .input-group textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.feed-composer .input-group-text{ 
    background: #f8fafc; 
    cursor: pointer; 
    border: 1px solid #e5e7eb;
    border-left: none;
    transition: all 0.2s ease;
}

.feed-composer .input-group-text:hover {
    background: #e2e8f0;
}

.feed-composer .input-group .form-control{ 
    border-right: 0; 
}

.feed-composer .input-group .btn{ 
    border-top-left-radius: 0; 
    border-bottom-left-radius: 0; 
    border-radius: 0 12px 12px 0;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: 1px solid #2563eb;
    transition: all 0.2s ease;
}

.feed-composer .input-group .btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.feed-preview-grid{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:6px; }
.feed-preview{ position:relative; width:72px; height:72px; border-radius:8px; overflow:hidden; border:1px solid rgba(0,0,0,0.06); background:#fafafa; }
.feed-preview img{ width:100%; height:100%; object-fit:cover; display:block; }
.feed-preview .feed-remove{ position:absolute; top:4px; right:4px; width:18px; height:18px; border-radius:50%; background:rgba(0,0,0,0.6); color:#fff; display:flex; align-items:center; justify-content:center; font-size:12px; line-height:1; cursor:pointer; }
.feed-add-img-btn{ display:inline-flex; align-items:center; gap:6px; }
/* Thread dropdown inside card */
.feed-thread{ 
    max-height: 0; 
    overflow: hidden; 
    opacity: 0; 
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    -webkit-overflow-scrolling: touch;
    transform: translateY(-10px);
}

.feed-thread.open{ 
    max-height: 480px; 
    overflow: auto; 
    opacity: 1; 
    transform: translateY(0);
}

/* Sticky inline comment composer at bottom of thread */
.feed-thread {
  position: relative;
}
.feed-thread .feed-composer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: #ffffff;
  border-top: 1px solid rgba(0,0,0,0.06);
  margin-top: 8px;
}

/* Compact, professional inline composer like Facebook */
.feed-thread .feed-composer .input-group-sm {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 18px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.04);
  overflow: hidden;
}
.feed-thread .feed-composer .input-group-sm .form-control {
  min-height: 36px !important; /* one line */
  max-height: 72px !important; /* up to ~3 rows */
  padding: 6px 10px !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  resize: none !important;
  overflow-y: hidden; /* JS toggles to auto when exceeding */
  border: none !important;
}
.feed-thread .feed-composer .input-group-sm .input-group-text,
.feed-thread .feed-composer .input-group-sm .btn {
  height: 36px !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
}
.feed-thread .feed-composer .input-group-sm .input-group-text { border: none !important; }
.feed-thread .feed-composer .input-group-sm .btn { border: none !important; border-left: 1px solid rgba(0,0,0,0.06) !important; }

/* Modal composer sticky at bottom of scroll area as well */
.feed-modal .feed-composer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: #ffffff;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.feed-thread .feed-skeleton{ height:64px; }
.feed-actions{ padding-top:8px; margin-top:8px; }
/* Feed Composer - Professional Modern Design */
.feed-composer {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

/* Color effect only for main post composer, not comments */
#feed-composer.feed-composer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
}

.feed-composer:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

/* Comment composers - no color effect */
.feed-composer:not(#feed-composer) {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.feed-composer:not(#feed-composer):hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

/* Hide feed-preview-grid for comment composers */
.feed-composer:not(#feed-composer) .feed-preview-grid {
    display: none;
}

/* Mobile layout for main composer - side by side controls */
@media (max-width: 768px) {
    .feed-composer .composer-controls {
        flex-direction: row !important;
        align-items: center;
        gap: 12px;
        flex-wrap: nowrap !important;
        justify-content: space-between;
        width: 100%;
    }
    
    .feed-composer .composer-controls-left {
        display: flex;
        align-items: center;
        gap: 12px;
        flex: 0 0 auto;
        flex-shrink: 0;
    }
    
    .feed-composer .composer-controls-right {
        display: flex;
        align-items: center;
        gap: 12px;
        flex: 0 0 auto;
        flex-shrink: 0;
        margin-left: auto;
    }
    
    .feed-composer .composer-type-selector {
        flex-shrink: 0;
        min-width: 120px;
    }
    
    .feed-composer .image-upload-btn {
        flex-shrink: 0;
        white-space: nowrap;
        min-width: 120px;
    }
    
    .feed-composer .post-btn {
        width: auto;
        min-width: 80px;
        height: 42px;
        flex-shrink: 0;
    }
    
    .feed-composer .image-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
        padding: 12px;
    }
    
    /* Mobile action buttons - ensure visibility */
    .feed-actions .btn-action {
        padding: 12px 8px;
        font-size: 13px;
        background: rgba(248, 250, 252, 0.8);
        border: 1px solid rgba(0, 0, 0, 0.05);
        margin-bottom: 4px;
    }
    
    .feed-actions .btn-action span:last-child {
        display: inline !important;
    }
    
    .feed-actions .btn-action:hover {
        background: #f1f5f9;
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
}

/* Fix any distorted characters by ensuring proper font rendering */
.feed-composer {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.feed-composer .card-body {
    padding: 24px;
}

.feed-composer textarea {
    border: none;
    background: transparent;
    font-size: 16px;
    line-height: 1.6;
    color: #1f2937;
    resize: none;
    min-height: 80px;
    padding: 0;
    font-family: inherit;
}

.feed-composer textarea:focus {
    outline: none;
    box-shadow: none;
}

.feed-composer textarea::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.feed-composer .composer-type-selector {
    position: relative;
}

.feed-composer .composer-type-selector select {
    appearance: none;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    height: 42px; /* Consistent height with other controls */
    box-sizing: border-box;
}

.feed-composer .composer-type-selector select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.feed-composer .image-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    height: 42px; /* Consistent height with other controls */
    box-sizing: border-box;
}

.feed-composer .image-upload-btn:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feed-composer .image-upload-btn input[type="file"] {
    display: none;
}

.feed-composer .post-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.feed-composer .post-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.feed-composer .post-btn:active {
    transform: translateY(0);
}

/* Image Preview Grid */
.feed-composer .image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    margin-top: 16px;
    padding: 16px;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 12px;
    border: 1px dashed rgba(0, 0, 0, 0.1);
    min-height: 60px;
}

.feed-composer .image-preview-grid:empty {
    display: none;
}

.feed-composer .image-preview-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.feed-composer .image-preview-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.feed-composer .image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.feed-composer .image-preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feed-composer .image-preview-item .remove-btn:hover {
    background: rgba(239, 68, 68, 0.9);
    transform: scale(1.1);
}

/* Action Buttons - Fixed Hover Radius and Mobile Visibility */
.feed-actions .btn-action{ 
    display:flex; 
    align-items:center; 
    gap:6px; 
    color:#475569; 
    background:transparent; 
    border:0; 
    padding:8px 12px; 
    border-radius:12px; 
    width:100%; 
    justify-content:center; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-size: 14px;
    font-weight: 500;
}

.feed-actions .btn-action::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 12px; /* Match the button border-radius */
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.feed-actions .btn-action:hover::before {
    width: 100%;
    height: 100%;
}

.feed-actions .btn-action:hover{ 
    background:#f1f5f9; 
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Mobile layout for main composer - side by side controls */
@media (max-width: 768px) {
    .feed-composer .card-body {
        padding: 20px;
    }
    
    .feed-composer .composer-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .feed-composer .composer-controls-left,
    .feed-composer .composer-controls-right {
        justify-content: center;
    }
    
    .feed-composer .composer-type-selector {
        min-width: auto;
    }
    
    .feed-composer .image-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
        padding: 12px;
    }
    
    /* Mobile action buttons - ensure visibility */
    .feed-actions .btn-action {
        padding: 12px 8px;
        font-size: 13px;
        background: rgba(248, 250, 252, 0.8);
        border: 1px solid rgba(0, 0, 0, 0.05);
        margin-bottom: 4px;
    }
    
    .feed-actions .btn-action span:last-child {
        display: inline !important; /* Always show text on mobile */
    }
    
    .feed-actions .btn-action:hover {
        background: #f1f5f9;
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
}

/* Mobile image upload button - icon only */
@media (max-width: 576px) {
    .feed-composer .composer-controls {
        gap: 8px;
        justify-content: space-between;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }
    
    .feed-composer .composer-controls-left {
        gap: 8px;
        flex: 0 0 auto;
        flex-shrink: 0;
    }
    
    .feed-composer .composer-controls-right {
        flex: 0 0 auto;
        margin-left: auto;
        flex-shrink: 0;
    }
    
    .feed-composer .composer-type-selector select {
        height: 42px;
        padding: 8px 12px;
    }
    
    .feed-composer .image-upload-btn {
        padding: 8px 12px;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .feed-composer .image-upload-btn span {
        display: none !important;
    }
    
    .feed-composer .post-btn {
        padding: 8px 16px;
        font-size: 13px;
        height: 42px;
    }
    
    .feed-composer .image-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
        padding: 10px;
    }
    
    /* Mobile action buttons - enhanced visibility */
    .feed-actions .btn-action {
        padding: 14px 10px;
        font-size: 14px;
        background: #ffffff;
        border: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    .feed-actions .btn-action span:first-child {
        font-size: 16px;
    }
    
    .feed-actions .btn-action span:last-child {
        font-size: 13px;
        font-weight: 500;
    }
}

@media (max-width: 480px) {
    .feed-composer .composer-controls {
        gap: 6px;
        justify-content: space-between;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
    }
    
    .feed-composer .composer-controls-left {
        gap: 6px;
        flex: 0 0 auto;
        flex-shrink: 0;
    }
    
    .feed-composer .composer-controls-right {
        flex: 0 0 auto;
        margin-left: auto;
        flex-shrink: 0;
    }
    
    .feed-composer .composer-type-selector select {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 100px;
    }
    
    .feed-composer .image-upload-btn {
        padding: 6px 10px;
        min-width: 42px;
    }
    
    .feed-composer .post-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 70px;
    }
    
    .feed-actions .btn-action {
        padding: 12px 8px;
        font-size: 12px;
    }
    
    .feed-actions .btn-action span:last-child {
        font-size: 12px;
    }
}
.feed-divider{ margin:16px 0; }
.feed-divider hr{ border-color: #e5e7eb; border-width: 1px; opacity: 0.6; }
.btn-action.active{ background:#e2e8f0; color: #1e40af; }
.btn-action.active span:first-child{ opacity: 1; }
.btn-action:not(.active) span:first-child{ opacity: 0.6; }
.btn-action[data-like] .badge{ font-size: 10px; padding: 2px 6px; }

/* Like button specific styles */
.btn-action[data-like].active{ 
    background: linear-gradient(135deg, #dbeafe, #bfdbfe); 
    color: #1e40af; 
    border: 1px solid #93c5fd;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-action[data-like].active span:first-child{ 
    transform: scale(1.1); 
    transition: transform 0.2s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.btn-action[data-like]:hover{ 
    background: #f1f5f9; 
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.btn-action[data-like].active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

/* Stats row styling - Facebook-like */
.feed-stats-row {
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.feed-stats-row:hover {
    border-bottom-color: #d1d5db;
}

/* Feed divider styling - clear separation between posts */
.feed-divider {
    margin: 0;
    padding: 0;
}

.feed-divider hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, #e5e7eb, #d1d5db, #e5e7eb, transparent);
    margin: 0;
    opacity: 0.6;
    border-radius: 1px;
    transition: opacity 0.2s ease;
}

.feed-divider:hover hr {
    opacity: 0.8;
}

.feed-stat-item {
    display: inline-block;
    margin-right: 16px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.feed-stat-item:hover {
    color: #374151;
}

.feed-comment-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.feed-comment-clickable:hover {
    color: #1e40af;
}

.feed-stat-item:last-child {
    margin-right: 0;
}

/* Remove badge styling since we're not using it anymore */
.btn-action[data-like] .badge {
    display: none;
}

/* Performance optimizations */
.feed-image-grid img {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.feed-card {
    will-change: transform;
    contain: layout style paint;
}

/* Optimize skeleton animations */
.feed-skeleton {
    contain: layout style paint;
}

/* Smooth scrolling for feed */
.feed-list {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Error message styling */
.composer-type-selector .error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

/* Ensure proper spacing for error messages */
.composer-type-selector {
    margin-bottom: 0;
}

/* Comment date styling */
.feed-composer .text-muted.x-small,
.feed-thread .text-muted.x-small,
.feed-modal .text-muted.x-small {
    font-size: 11px !important;
    line-height: 1.2;
    color: #9ca3af !important;
}

/* General x-small utility class */
.x-small {
    font-size: 11px !important;
    line-height: 1.2;
}

/* Comment styling in feed */
.feed-composer .x-small,
.feed-thread .x-small,
.feed-modal .x-small {
    font-size: 11px !important;
    line-height: 1.2;
    color: #9ca3af !important;
}

/* Feed thread comment styling */
.feed-thread .text-muted.x-small,
.feed-thread .x-small {
    font-size: 11px !important;
    line-height: 1.2;
    color: #9ca3af !important;
}

/* Modal comment styling */
.feed-modal .text-muted.x-small,
.feed-modal .x-small {
    font-size: 11px !important;
    line-height: 1.2;
    color: #9ca3af !important;
}

/* Force single line layout for composer controls */
.feed-composer .composer-controls {
    display: flex !important;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    justify-content: space-between;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100%;
}

.feed-composer .composer-controls-left {
    display: flex !important;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
}

.feed-composer .composer-controls-right {
    display: flex !important;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    margin-left: auto;
}

/* Image Modal Preview - Facebook Style */
.feed-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feed-image-modal.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.feed-image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-image-modal img {
    max-width: calc(100vw - 120px) !important;
    max-height: calc(100vh - 120px) !important;
    object-fit: contain !important; /* always show full image */
    width: auto !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.feed-image-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 28px;  /* smaller on desktop */
    height: 28px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 50%;
    color: #111827;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10000;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.feed-image-modal-close:hover {
    background: rgba(255,255,255,0.95);
    transform: scale(1.08);
}

.feed-image-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;  /* smaller on desktop */
    height: 36px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 50%;
    color: #111827;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10000;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.feed-image-modal-nav:hover {
    background: rgba(255,255,255,0.95);
}

.feed-image-modal-prev {
    left: 20px;
}

.feed-image-modal-next {
    right: 20px;
}

.feed-image-modal-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.feed-image-modal-nav:disabled:hover {
    background: rgba(0, 0, 0, 0.7);
}

.feed-image-modal-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    color: #111827;
    padding: 5px 10px;  /* slightly smaller on desktop */
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.15);
    font-size: 12px;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

/* Download button */
/* Bottom info row (counter + download) */
.feed-image-modal-info{ position:absolute; bottom:20px; left:50%; transform:translateX(-50%); display:flex; align-items:center; gap:8px; z-index:10000; }
.feed-image-modal-info .feed-image-modal-counter{ position:static; transform:none; bottom:auto; left:auto; }
.feed-image-modal-download{
    position:static;
    width:36px; height:36px; border-radius:50%;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(6px);
    border:1px solid rgba(0,0,0,0.15);
    display:flex; align-items:center; justify-content:center;
    color:#111827; text-decoration:none;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
.feed-image-modal-download:hover{ background: rgba(255,255,255,0.95); }

/* Mobile optimizations for image modal */
@media (max-width: 768px) {
    .feed-image-modal { padding: 0; }
    .feed-image-modal-content { width: 100vw; height: 100vh; margin: 0; }
    .feed-image-modal-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .feed-image-modal-prev {
        left: 10px;
    }
    
    .feed-image-modal-next {
        right: 10px;
    }
    
    .feed-image-modal-close {
        top: 15px;
        right: 15px;
        width: 34px;
        height: 34px;
        font-size: 18px;
    }
    
    .feed-image-modal-counter {
        bottom: 15px;
        padding: 6px 12px;
        font-size: 12px;
    }
    .feed-image-modal-info{ bottom: 12px; gap:6px; }
    .feed-image-modal-download{ width:34px; height:34px; }
    .feed-image-modal img {
        max-width: 100vw !important;
        max-height: 100vh !important;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .feed-image-modal-nav {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .feed-image-modal-prev {
        left: 8px;
    }
    
    .feed-image-modal-next {
        right: 8px;
    }
    
    .feed-image-modal-close {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .feed-image-modal-counter {
        bottom: 10px;
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* Zoomed state for image modal */
.feed-image-modal .zoomable { transition: transform 0.2s ease; }
.feed-image-modal .zoomed {
    max-width: none !important;
    max-height: none !important;
    cursor: grab;
}
.feed-image-modal .zoomed.dragging { cursor: grabbing; }

/* Zoom indicator */
.feed-zoom-indicator{
    position:absolute; top:12px; left:50%; transform:translateX(-50%);
    background: rgba(255,255,255,0.85); backdrop-filter: blur(6px);
    color:#111827; border:1px solid rgba(0,0,0,0.15);
    padding:4px 10px; border-radius:12px; font-size:12px; z-index:10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Facebook-style Smart Image Grid */
.feed-image-grid {
  display: grid;
  gap: 2px;
  border-radius: 8px;
  overflow: hidden;
  margin: 12px 0;
  position: relative;
  image-rendering: auto; /* improve perceived sharpness */
}

.feed-image-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.2s ease;
  filter: none !important; /* remove any dimming */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.feed-image-grid img:hover {
  opacity: 0.9;
}

/* Single image */
.feed-image-grid.single { grid-template-columns: 1fr; }
.feed-image-grid.single .feed-image-tile { width: 100%; }
.feed-image-grid.single img {
  width: 100%;
  height: auto;
  max-height: clamp(260px, 55vh, 420px);
  object-fit: contain;
}

/* Two images */
.feed-image-grid.two {
  grid-template-columns: 1fr 1fr;
  max-height: 300px;
}

.feed-image-grid.two img {
  max-height: 300px;
}

/* Three images */
.feed-image-grid.three {
  grid-template-columns: 1fr 1fr 1fr;
  max-height: 200px;
}

.feed-image-grid.three img {
  max-height: 200px;
}

/* Exactly four images: 2x2 grid */
.feed-image-grid.four { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; }

/* More than four images: show first 4 in 2x2, with +N overlay on 4th tile */
.feed-image-grid.five-plus { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; }

/* +N Overlay positioning for 4+ images */
/* Image tile wrapper for consistent overlay and sizing */
.feed-image-tile { position: relative; overflow: hidden; border-radius: 8px; }
.feed-image-grid.four .feed-image-tile,
.feed-image-grid.five-plus .feed-image-tile,
.feed-image-grid.two .feed-image-tile,
.feed-image-grid.three .feed-image-tile { aspect-ratio: 1; }

/* Ensure images fill tiles uniformly (override legacy max-heights) */
.feed-image-grid.four img,
.feed-image-grid.five-plus img,
.feed-image-grid.two img,
.feed-image-grid.three img {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
  display: block !important;
}

/* Overlay on the 4th tile for 5+ images */
.feed-image-tile .feed-image-overlay-tile {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
  color: #fff;
}
.feed-image-tile .feed-image-overlay-tile:hover { background: rgba(0,0,0,0.75); }

/* Fix mobile spacing: ensure rows are tight without gaps */
@media (max-width: 768px) {
  .feed-image-grid.four,
  .feed-image-grid.five-plus { gap: 2px; }
  /* Square tiles on mobile to avoid row gaps */
  .feed-image-grid.four .feed-image-tile,
  .feed-image-grid.five-plus .feed-image-tile { aspect-ratio: 1; }
  .feed-image-grid.four img,
  .feed-image-grid.five-plus img { height: 100% !important; max-height: none !important; }
}

/* Desktop: fit 2x2 grids within view without scrolling, with pleasant padding */
@media (min-width: 992px) {
  .feed-image-grid.four,
  .feed-image-grid.five-plus {
    padding: 6px;              /* subtle inner padding */
    gap: 6px;                  /* consistent gutters between tiles */
    max-height: clamp(300px, 55vh, 420px); /* slightly larger for better visibility */
    grid-auto-rows: 1fr;       /* two equal-height rows */
    box-sizing: border-box;
  }
  /* Let container height define tile size on desktop */
  .feed-image-grid.four .feed-image-tile,
  .feed-image-grid.five-plus .feed-image-tile { aspect-ratio: auto; }
  .feed-image-grid.four img,
  .feed-image-grid.five-plus img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
}

/* +N Overlay */
.feed-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.feed-image-overlay:hover {
  background: rgba(0, 0, 0, 0.8);
}

.overlay-content {
  text-align: center;
}

.overlay-text {
  color: white;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Mobile responsiveness for image grid */
@media (max-width: 768px) {
  .feed-image-grid {
    gap: 1px;
    border-radius: 6px;
  }
  
  .feed-image-grid.single {
    max-height: 300px;
  }
  
  .feed-image-grid.two,
  .feed-image-grid.three,
  .feed-image-grid.four-plus {
    max-height: 250px;
  }
  
  .feed-image-grid img {
    max-height: 120px;
  }
  
  .feed-image-grid.four-plus img:nth-child(1),
  .feed-image-grid.four-plus img:nth-child(2) {
    max-height: 120px;
  }
  
  .feed-image-grid.four-plus img:nth-child(3) {
    max-height: 120px;
  }
  
  .feed-image-grid.four-plus .feed-image-overlay {
    top: 120px;
  }
}

/* Comment Image Control - Small size by default, clickable for preview */
.feed-thread .feed-image-grid img,
.feed-modal .feed-image-grid img {
  height: 80px !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.feed-thread .feed-image-grid img:hover,
.feed-modal .feed-image-grid img:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

/* Comment image grid specific sizing */
.feed-thread .feed-image-grid,
.feed-modal .feed-image-grid {
  display: inline-flex !important;
  flex-wrap: wrap !important; /* allow wrapping to next line if needed */
  gap: 6px !important;
  row-gap: 6px !important;
  margin: 8px 0 !important;
}

/* Hide 4+ overlay inside comments; modal still shows all images */
.feed-thread .feed-image-overlay,
.feed-modal .feed-image-overlay { display: none !important; }

.feed-thread .feed-image-grid.single img,
.feed-modal .feed-image-grid.single img {
  max-width: 200px !important;
  max-height: 120px !important;
}

.feed-thread .feed-image-grid.two img,
.feed-modal .feed-image-grid.two img {
  max-width: 120px !important;
  max-height: 80px !important;
}

.feed-thread .feed-image-grid.three img,
.feed-modal .feed-image-grid.three img {
  max-width: 80px !important;
  max-height: 60px !important;
}

.feed-thread .feed-image-grid.four-plus img,
.feed-modal .feed-image-grid.four-plus img {
  max-width: 100px !important;
  max-height: 70px !important;
}

/* Adjust +N overlay position for compact comment grids */
.feed-comment-bubble .feed-image-grid.four-plus .feed-image-overlay {
  top: 100px !important;
}

/* Mobile comment image sizing */
@media (max-width: 768px) {
  .feed-thread .feed-image-grid img,
  .feed-modal .feed-image-grid img {
    max-width: 120px !important;
    max-height: 80px !important;
  }
  
  .feed-thread .feed-image-grid.single img,
  .feed-modal .feed-image-grid.single img {
    max-width: 150px !important;
    max-height: 100px !important;
  }
  
  .feed-thread .feed-image-grid.two img,
  .feed-thread .feed-image-grid.three img,
  .feed-thread .feed-image-grid.four-plus img,
  .feed-modal .feed-image-grid.two img,
  .feed-modal .feed-image-grid.three img,
  .feed-modal .feed-image-grid.four-plus img {
    max-width: 90px !important;
    max-height: 60px !important;
  }
  .feed-comment-bubble .feed-image-grid.four-plus .feed-image-overlay { top: 80px !important; }
}

/* Comment layout: Avatar | Bubble, with date outside bubble. Keep full-width container */
.feed-comment { width: 100%; }
.feed-comment .feed-avatar { border: 2px solid rgba(0,0,0,0.1) !important; border-radius: 50% !important; }
.feed-card img.rounded-circle { border: 2px solid rgba(0,0,0,0.1) !important; }

.feed-comment-content { flex: 1 1 auto; min-width: 0; }
.feed-comment-bubble {
  /* white base with very subtle theme tint */
  background: linear-gradient(180deg, rgba(102,126,234,0.04), rgba(118,75,162,0.02)) , #ffffff !important;
  border: 1px solid rgba(102,126,234,0.12) !important;
  border-radius: 18px !important;
  padding: 8px 12px !important;
  display: inline-block !important; /* shrink to content */
  width: auto !important;
  max-width: calc(100% - 16px) !important; /* leave small right gutter */
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
}

.feed-comment-bubble .fw-semibold { font-size: 13px !important; color: #111827 !important; margin-bottom: 2px !important; }
.feed-comment-bubble .small { font-size: 14px !important; color: #111827 !important; line-height: 1.5 !important; margin: 0 !important; }
.feed-comment-bubble .feed-image-grid { margin-top: 8px !important; margin-bottom: 0 !important; }

.feed-comment-date { font-size: 12px !important; color: #6b7280 !important; margin-top: 4px !important; margin-left: 12px !important; }

/* SPA-like feeds overlay */
.feeds-overlay{position:fixed;inset:0;z-index:1050;display:flex;align-items:center;justify-content:center}
.feeds-overlay.d-none{display:none}
.feeds-overlay-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.6);backdrop-filter:blur(6px)}
.feeds-overlay-panel{position:relative;background:#fff;width:min(980px,95vw);max-height:90vh;overflow:auto;border-radius:16px;padding:16px;box-shadow:0 25px 50px rgba(0,0,0,.25)}

/* Ensure feed images lazy load smoothly */
.feed-image-grid img{loading:lazy}

