/* ── V4 Activity Feed Styles ── */
.v4-activity-feed-panel {
  --ig: #7c3aed;
  --ig2: #6d28d9;
  --ig-light: #f5f0ff;

  --ig-mid: #e0d4fb;
  --v4-text: #111827;
  --v4-sub: #4b5563;
  --v4-muted: #9ca3af;
  --v4-border: #e5e7eb;
  --v4-bg: #f3f4f6;
  --v4-card: #ffffff;
  --pin-color: #f59e0b;
  --v4-radius: 12px;
  --v4-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 6px rgba(0, 0, 0, 0.04);
  --v4-shadow-md: 0 6px 24px rgba(0, 0, 0, 0.09);
  padding: 12px 16px;
}

/* Feed section tabs */
.v4-feed-section-tabs {
  display: flex;
  border-bottom: 1px solid var(--v4-border);
  margin-bottom: 12px;
}

.v4-feed-section-tab {
  flex: 1;
  padding: 11px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--v4-muted);
  cursor: pointer;
  text-align: center;
  border-bottom: 2.5px solid transparent;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.v4-feed-section-tab:hover {
  color: var(--v4-sub);
  background: #fafafa;
}
.v4-feed-section-tab.active {
  color: var(--buttonBackgroundColor2);
  border-color: var(--buttonBackgroundColor2);
  font-weight: 700;
  background: #fff;
}
.v4-feed-section-tab.active .v4-feed-section-tab-badge {
  background: var(--ig-light);
  color: var(--buttonBackgroundColor2);
}

.v4-feed-section-tab-badge {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  background: #fee2e2;
  color: #dc2626;
  min-width: 16px;
  text-align: center;
  display: none;
}

/* Pinned section label */
.v4-pinned-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #92400e;
  margin-bottom: 8px;
}
.v4-pinned-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, #fde68a55, transparent);
}

/* Activity card */
.v4-activity-card {
  background: #fff;
  border: 1px solid var(--v4-border);
  border-radius: var(--v4-radius);
  padding: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: box-shadow 0.2s, border-color 0.2s;
  margin-bottom: 8px;
  position: relative;
}
.v4-activity-card:hover {
  box-shadow: var(--v4-shadow-md);
  border-color: var(--buttonBackgroundColor2);
}
.v4-activity-card.is-pinned {
  border-left: 3px solid var(--pin-color, #f59e0b);
  background: linear-gradient(to right, var(--pin-bg, #fffdf5), #fff);
}
.v4-activity-card:last-child {
  margin-bottom: 0;
}

/* Checkbox for select/remove */
.v4-checkbox-container {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.v4-checkbox-container .form-check-input {
  margin: 0;
  cursor: pointer;
}

/* User avatar */
.v4-user-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  border: none;
  outline: none;
  box-shadow: none;
}
.v4-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: none;
  outline: none;
}

/* Card content */
.v4-activity-card-content {
  flex: 1;
  min-width: 0;
}

.v4-activity-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.v4-activity-card-header-left {
  flex: 1;
  min-width: 0;
}

.v4-activity-type-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--v4-muted);
  margin-bottom: 3px;
}

.v4-activity-actor-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--v4-text);
}
.v4-profile-link {
  color: var(--v4-text);
  text-decoration: none;
  margin-left: 4px;
  font-size: 0.8rem;
  vertical-align: middle;
}
.v4-profile-link:hover {
  color: var(--buttonBackgroundColor2);
}

.v4-activity-actor-role {
  font-size: 0.84rem;
  color: var(--v4-muted);
  margin-left: 5px;
}

.v4-activity-action-summary {
  margin-top: 4px;
  font-size: 0.87rem;
  color: var(--v4-sub);
  line-height: 1.55;
}
.v4-activity-action-summary .name {
  font-weight: 600;
  color: var(--v4-text);
}
.v4-activity-action-summary .link {
  font-weight: 600;
  color: var(--v4-text);
  cursor: pointer;
}
.v4-activity-action-summary .link a {
  color: var(--v4-text);
  text-decoration: none;
  cursor: pointer;
}
.v4-activity-action-summary a {
  color: var(--v4-text);
  text-decoration: none;
  cursor: pointer;
}

/* Card meta */
.v4-activity-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.v4-activity-timestamp {
  font-size: 0.82rem;
  color: var(--v4-muted);
  white-space: nowrap;
}

/* 3-dot menu */
.v4-card-menu-wrap {
  position: relative;
}

.v4-card-menu-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1.5px solid var(--v4-border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--v4-muted);
  transition: all 0.15s;
  flex-shrink: 0;
}
.v4-card-menu-btn:hover,
.v4-card-menu-btn.active {
  border-color: var(--buttonBackgroundColor2);
  color: var(--buttonBackgroundColor2);
  background: var(--ig-light);
}

.v4-card-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--v4-border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  z-index: 100;
  overflow: hidden;
  animation: v4-dropdown-in 0.15s ease;
}
.v4-card-dropdown.open {
  display: block;
}

@keyframes v4-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.v4-card-dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--v4-sub);
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}
.v4-card-dropdown-item:hover {
  background: var(--buttonBackgroundColor2);
  color: #fff !important;
}
.v4-card-dropdown-item:hover svg {
  stroke: #fff !important;
  fill: none !important;
}
.v4-card-dropdown-item svg {
  flex-shrink: 0;
}
.v4-card-dropdown-item.v4-item-like.is-liked,
.v4-card-dropdown-item.v4-item-pin.is-pinned,
.v4-card-dropdown-item.v4-item-unhide,
.v4-card-dropdown-item.v4-item-unpin {
  color: var(--v4-sub);
}
.v4-card-dropdown-item.v4-item-delete {
  color: #ef4444;
}
.v4-card-dropdown-item.v4-item-delete:hover {
  background: var(--buttonBackgroundColor2);
  color: #fff;
}
.v4-card-dropdown-item.v4-item-delete:hover svg {
  stroke: #fff;
}

.v4-card-dropdown-divider {
  height: 1px;
  background: var(--v4-border);
  margin: 4px 0;
}

/* Recommendation quote */
.v4-recommendation-quote {
  margin-top: 10px;
  padding: 10px 12px 10px 14px;
  background: #fafafa;
  border-left: 3px solid var(--buttonBackgroundColor2);
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  color: var(--v4-sub);
  font-style: italic;
  line-height: 1.65;
}

/* Featured content card */
.v4-featured-card {
  margin-top: 10px;
  border: 1px solid var(--v4-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.v4-featured-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.v4-featured-card-top {
  display: flex;
  align-items: stretch;
}

.v4-featured-thumb {
  width: 56px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--ig-light), var(--ig-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.v4-featured-info {
  padding: 10px 12px;
  flex: 1;
  min-width: 0;
}

.v4-featured-content-type {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--v4-muted);
  margin-bottom: 3px;
}

.v4-featured-content-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--v4-text);
  line-height: 1.4;
}

.v4-featured-desc-wrap {
  padding: 9px 12px 11px;
  font-size: 0.76rem;
  color: var(--v4-sub);
  line-height: 1.65;
  border-top: 1px solid #f3f4f6;
}

.v4-featured-desc {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.v4-featured-desc.expanded {
  display: block;
  overflow: visible;
}

.v4-featured-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  font-size: 0.7rem;
  color: var(--buttonBackgroundColor2);
  word-break: break-all;
  text-decoration: none;
}
.v4-featured-ext-link:hover {
  text-decoration: underline;
}

.v4-featured-show-more {
  display: none;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--ig);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.v4-featured-show-more:hover {
  opacity: 0.7;
}

/* Media thumbnail */
.v4-media-thumb-wrap {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.v4-media-thumb-wrap img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}
.v4-media-thumb-wrap.v4-audio-thumb img {
  height: 140px;
}
.v4-media-thumb-wrap:hover .v4-media-overlay {
  background: rgba(0, 0, 0, 0.45);
}
.v4-media-thumb-wrap:hover .v4-play-btn {
  transform: scale(1.1);
}

.v4-media-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.v4-play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s;
  background: rgba(255, 255, 255, 0.93);
}
.v4-play-btn svg {
  margin-left: 3px;
}

.v4-media-type-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 7px;
  border-radius: 20px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.v4-media-duration {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

/* Audio waveform */
.v4-audio-wave-row {
  padding: 11px 13px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  gap: 10px;
}

.v4-wave-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
  flex: 1;
}

.v4-wave-bar {
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(to top, #7c3aed, #a855f7);
}

.v4-audio-duration-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--buttonBackgroundColor2);
  white-space: nowrap;
}

/* Empty state */
.v4-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--v4-muted);
  display: none;
}

.v4-empty-state-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  opacity: 0.35;
}

/* Like count beside menu */
.v4-meta-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.v4-like-count-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--v4-sub);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}
.v4-like-count-meta:hover {
  background: #f3f4f6;
}
.v4-like-count-meta i {
  font-size: 0.9rem;
}

/* Responsive */
@media (min-width: 640px) {
  .v4-activity-card {
    padding: 18px 20px;
    gap: 14px;
  }
  .v4-activity-actor-name {
    font-size: 1rem;
  }
  .v4-activity-action-summary {
    font-size: 0.9rem;
  }
  .v4-card-menu-btn {
    width: 30px;
    height: 30px;
  }
}

@media (min-width: 480px) {
  .v4-feed-section-tab {
    font-size: 0.82rem;
    padding: 12px 16px;
  }
}

/* Override overflow:hidden from listingprofilev2.css so V4 dropdown menus are not clipped.
   The V4 feed panel adds min padding at the bottom so the last card's dropdown has space. */
.v4-activity-feed-panel,
.v4-activity-feed-panel #ViewAllContentActivity {
  overflow: visible !important;
}
.v2-main-content .quick-view-settle-block:has(.v4-activity-feed-panel),
.v2-main-content #mainContentPage:has(.v4-activity-feed-panel) {
  overflow: visible !important;
}
.v4-activity-feed-panel #ViewAllContentActivity {
  padding-bottom: 20px;
}

/* Start a Post button override for V4 pages */
.activity-update-padding-2 .bottom-contanct-info-filler .info-adv-btn-style {
    padding: 8px 16px !important;
    font-size: .82rem !important;
    font-weight: 700 !important;
    border-radius: 10px;
    display: flex !important;
    align-items: center;
    gap: 4px;
    width: auto;
    border-style: solid !important;
    cursor: pointer;
    transition: all .18s;
    justify-content: center;
}