/**
 * Evabiz — Instagram-style action bar
 * Đồng cảm (heart) · Bình luận · Đăng lại · Chia sẻ
 */

/* Meta counts (Bovagau/IG social proof) — hide zeros via PHP */
.eb-engage-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.85rem 0.15rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #8C8479; /* --c-stone */
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.eb-engage-stats .eb-engage-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: inherit;
  text-decoration: none;
}
.eb-engage-stats a.eb-engage-stat:hover {
  color: #5C2A2F; /* burgundy */
}
.eb-engage-stats .eb-engage-stat i {
  font-size: 0.75rem;
  opacity: 0.85;
}
.eb-engage-stats .fa-heart {
  color: #C29A8E; /* rose soft */
}
.eb-engage-stats .fa-retweet {
  color: #00ba7c;
}

/* —— Evabiz emotion tray (flat / luxury) —— */
/* Allow tray to escape card/action overflow */
.fb-feed-card,
.post-item.osahan-post,
.eb-status-card,
.action-panel.eb-ig-actions,
.fb-action-bar.eb-ig-actions,
.eb-ig-actions .social-button,
.eb-react-wrap {
  overflow: visible !important;
}

.eb-rx-stack {
  gap: 0.35rem !important;
}
.eb-rx-icons {
  display: inline-flex;
  align-items: center;
  flex-direction: row-reverse;
}
.eb-rx-dot {
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
  align-items: center;
  justify-content: center;
  margin-left: -0.32rem;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(20, 19, 15, 0.08);
  font-size: 0.85rem;
  line-height: 1;
}
.eb-rx-dot:last-child {
  margin-left: 0;
}
.eb-rx-dot-emoji {
  font-size: 0.85rem;
  line-height: 1;
  display: block;
}
/* Fluent Emoji Flat images (local SVG) */
.eb-rx-img,
.eb-rx-opt-img,
.eb-rx-dot-img {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  flex-shrink: 0;
}
.eb-rx-opt-img {
  width: 2rem;
  height: 2rem;
}
.eb-rx-dot-img {
  width: 1.1rem;
  height: 1.1rem;
}
.eb-rx-total {
  font-variant-numeric: tabular-nums;
}

.eb-react-wrap {
  position: relative !important;
  z-index: 2;
}
.eb-react-wrap:hover,
.eb-react-wrap.is-tray-open {
  z-index: 50;
}
.eb-react-wrap .lv-react,
.eb-react-wrap .lv-like {
  border: 0 !important;
  background: transparent !important;
  cursor: pointer;
  font: inherit;
  color: inherit;
  /* FB-like mobile: no double-tap zoom delay, no iOS callout on hold */
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.eb-rx-emoji {
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease;
  width: 1.75rem;
  height: 1.75rem;
}
.eb-rx-label {
  font-size: inherit;
}
.eb-react-wrap .lv-react.is-active .eb-rx-emoji,
.eb-react-wrap .lv-react.is-liked .eb-rx-emoji {
  transform: scale(1.06);
}
.eb-react-wrap .lv-react.is-active .eb-rx-label {
  color: #050505 !important;
  font-weight: 700;
}

/* Tray: transparent shell + padded bridge so hover doesn't flicker */
.eb-rx-tray {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 2px);
  transform: translateX(-50%);
  z-index: 80;
  padding: 0 0 14px; /* hover bridge into button — critical for Bovagau-style pick */
  background: transparent;
  border: 0;
  box-shadow: none;
  pointer-events: none;
  white-space: nowrap;
}
.eb-rx-tray[hidden] {
  display: none !important;
}
.eb-rx-tray.is-open {
  display: block !important;
  pointer-events: auto;
  animation: eb-rx-pop 0.14s ease-out;
}
/* Facebook-style pill tray */
.eb-rx-tray-inner {
  display: flex;
  align-items: flex-end;
  gap: 0.1rem;
  padding: 0.35rem 0.45rem 0.4rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
}
@keyframes eb-rx-pop {
  from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.94); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.eb-rx-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  padding: 0.28rem 0.22rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  color: #050505;
  transition: transform 0.12s ease;
}
.eb-rx-opt:hover,
.eb-rx-opt:focus-visible,
.eb-rx-opt.is-hot {
  background: transparent;
  outline: none;
  transform: scale(1.32) translateY(-6px);
  z-index: 2;
}
.eb-rx-opt.is-selected .eb-rx-opt-img,
.eb-rx-opt.is-selected .eb-rx-opt-emoji {
  filter: drop-shadow(0 0 0 2px #1877f2);
}
.eb-rx-opt-emoji {
  font-size: 1.55rem;
  line-height: 1;
  display: block;
  transition: transform 0.12s ease;
}
/* Emoji-only tray — no text under hover options */
.eb-rx-opt-label {
  display: none !important;
}

/* Mobile backdrop while tray is open (tap outside = close, like FB) */
.eb-rx-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.18);
  -webkit-tap-highlight-color: transparent;
}
.eb-rx-backdrop.is-on {
  display: block;
}
/* Fixed tray on mobile — above cards, not clipped */
.eb-rx-tray.is-fixed {
  position: fixed !important;
  z-index: 90 !important;
  padding: 0 !important;
  max-width: none;
  animation: eb-rx-pop-fixed 0.16s ease-out;
}
.eb-rx-tray.is-fixed .eb-rx-tray-inner {
  width: 100%;
  justify-content: space-between;
  padding: 0.45rem 0.5rem 0.5rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
@keyframes eb-rx-pop-fixed {
  from { opacity: 0; transform: translateY(8px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px), (hover: none) and (pointer: coarse) {
  .eb-rx-tray {
    left: 50%;
    transform: translateX(-50%);
    max-width: min(96vw, 22rem);
  }
  .eb-rx-tray.is-open:not(.is-fixed) {
    animation: none;
  }
  .eb-rx-tray-inner {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: min(94vw, 22rem);
    gap: 0;
  }
  .eb-rx-tray.is-fixed .eb-rx-tray-inner {
    max-width: none;
    overflow: visible;
  }
  .eb-rx-opt {
    min-width: 2.55rem;
    min-height: 2.55rem;
    padding: 0.35rem 0.2rem;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
  .eb-rx-opt-emoji {
    font-size: 1.5rem;
  }
  .eb-rx-opt-img {
    width: 2rem;
    height: 2rem;
  }
  .eb-rx-opt.is-hot {
    transform: scale(1.4) translateY(-8px);
  }
  /* Soft lock: avoid scroll bounce while picking emoji (no overflow:hidden — jumps page) */
  html.eb-rx-locking {
    overscroll-behavior: none;
  }
  html.eb-rx-locking .eb-rx-tray.is-fixed {
    touch-action: none;
  }
}

/* 4 equal columns */
.action-panel.eb-ig-actions,
.fb-action-bar.eb-ig-actions,
body.eb-social-home .osahan-post .action-panel.eb-ig-actions,
body.eb-site-shell .osahan-post .action-panel.eb-ig-actions,
body.eb-social-article .eb-ig-actions,
body.eb-status-detail .eb-ig-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr 1fr !important;
  gap: 0 !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
  margin: 0 !important;
  padding: 0.15rem 0.25rem !important;
  width: 100% !important;
}

.eb-ig-actions .social-button {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  width: auto !important;
  max-width: none !important;
  position: relative;
}

.eb-ig-actions .eb-ig-btn,
.eb-ig-actions .fb-action-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  width: 100% !important;
  min-height: 44px !important;
  padding: 0.4rem 0.2rem !important;
  margin: 0 !important;
  border-radius: 8px !important;
  color: #262626 !important;
  text-decoration: none !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  line-height: 1.15 !important;
  box-sizing: border-box !important;
  transition: color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.eb-ig-actions .eb-ig-btn:hover,
.eb-ig-actions .fb-action-btn:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #000 !important;
}

.eb-ig-actions .eb-ig-btn i,
.eb-ig-actions .fb-action-btn i {
  font-size: 1.25rem !important;
  flex-shrink: 0;
  margin: 0 !important;
  line-height: 1 !important;
  transition: transform 0.15s ease, color 0.15s ease;
}

/* Heart liked — Instagram red */
.eb-ig-actions .lv-like.is-liked,
.eb-ig-actions .lv-like.is-active.is-liked,
.eb-ig-actions .lv-like[data-liked="1"] {
  color: #ed4956 !important;
}
.eb-ig-actions .lv-like.is-liked i,
.eb-ig-actions .lv-like[data-liked="1"] i {
  color: #ed4956 !important;
}
.eb-ig-actions .lv-like.is-liked:active i,
.eb-ig-actions .lv-like[data-liked="1"]:active i {
  transform: scale(1.15);
}

/* Repost active — green like IG repost */
.eb-ig-actions .lv-repost.is-reposted,
.eb-ig-actions .lv-repost.is-active.is-reposted,
.eb-ig-actions .lv-repost[data-reposted="1"] {
  color: #00ba7c !important;
}
.eb-ig-actions .lv-repost.is-reposted i,
.eb-ig-actions .lv-repost[data-reposted="1"] i {
  color: #00ba7c !important;
}

/* Counts next to icons (X-style); hide zero */
.eb-ig-actions .eb-ig-count,
.eb-ig-actions .lv-number-post-like,
.eb-ig-actions .lv-number-post-comment,
.eb-ig-actions .lv-number-post-repost,
.eb-ig-actions .lv-number-post-share {
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  font-variant-numeric: tabular-nums;
  line-height: 1 !important;
  min-width: 0.75rem;
}
.eb-ig-actions .eb-ig-count.is-zero,
.eb-ig-actions .lv-number-post-like.is-zero,
.eb-ig-actions .lv-number-post-comment.is-zero,
.eb-ig-actions .lv-number-post-repost.is-zero,
.eb-ig-actions .lv-number-post-share.is-zero {
  display: none !important;
}

/* Compact cards (related / mọi người cũng đọc): icon + count only */
.eb-card-engage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #8C8479;
  line-height: 1.2;
}
.eb-card-engage-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}
.eb-card-engage-item i {
  font-size: 0.72rem;
  opacity: 0.9;
}

/* Narrow: hide text labels — keep icon + count only */
@media (max-width: 640px) {
  .eb-ig-actions .eb-ig-label,
  .eb-ig-actions .eb-rx-label {
    display: none !important;
  }
  .eb-ig-actions .eb-ig-btn i,
  .eb-ig-actions .fb-action-btn i {
    font-size: 1.35rem !important;
  }
  .eb-ig-actions .eb-ig-btn,
  .eb-ig-actions .fb-action-btn {
    min-height: 48px !important;
    gap: 0.3rem !important;
  }
  .eb-ig-actions .eb-ig-count,
  .eb-ig-actions .lv-number-post-like:not(.is-zero),
  .eb-ig-actions .lv-number-post-comment:not(.is-zero),
  .eb-ig-actions .lv-number-post-repost:not(.is-zero),
  .eb-ig-actions .lv-number-post-share:not(.is-zero) {
    display: inline !important;
    font-size: 0.78rem !important;
  }
}

/* Very narrow: still icon + count */
@media (max-width: 400px) {
  .eb-ig-actions .eb-ig-btn,
  .eb-ig-actions .fb-action-btn {
    padding: 0.35rem 0.1rem !important;
    gap: 0.22rem !important;
  }
  .eb-ig-actions .eb-ig-count {
    font-size: 0.72rem !important;
  }
}

/* Profile: X-style “Name reposted” banner */
.eb-repost-banner {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1rem 0.1rem 3.15rem; /* align under avatar column */
  font-size: 0.8125rem;
  font-weight: 600;
  color: #536471; /* X secondary */
  letter-spacing: 0.01em;
  line-height: 1.25;
}
.eb-repost-banner i {
  font-size: 0.9rem;
  color: #00ba7c;
  margin-left: -1.35rem; /* sit left of text like X */
}
.eb-repost-banner strong {
  color: #0f1419;
  font-weight: 700;
}
@media (max-width: 520px) {
  .eb-repost-banner {
    padding-left: 1rem;
  }
  .eb-repost-banner i {
    margin-left: 0;
  }
}

/* Dark chrome (home nav theme) */
body.eb-social-home .eb-ig-actions .eb-ig-btn,
body.eb-social-home .eb-ig-actions .fb-action-btn {
  color: #4a3f42 !important;
}
body.eb-social-home .eb-ig-actions .eb-ig-btn:hover {
  background: rgba(42, 28, 34, 0.06) !important;
  color: #2a1c22 !important;
}
body.eb-social-home .eb-ig-actions .lv-like.is-liked,
body.eb-social-home .eb-ig-actions .lv-like[data-liked="1"],
body.eb-social-home .eb-ig-actions .lv-like.is-liked i,
body.eb-social-home .eb-ig-actions .lv-like[data-liked="1"] i {
  color: #ed4956 !important;
}
