/* ============================================================
   Reactions — ReactionBar component (Facebook-style emoji picker)

   Two visual pieces:
     1. .reaction-bar — inline pill containing the "React" button,
        the small "•••" opener, and (when reactions exist) an
        aggregate strip showing top emojis + total count.
     2. .reaction-picker — floating 6-emoji palette that appears
        above the bar on hover / click.
   ============================================================ */

.reaction-bar {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

/* Aggregate strip — sits before the "React" button so a bystander
   sees the social proof first, then the CTA. Hidden when no
   reactions exist yet so we don't render an awkward "0". */
.reaction-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.5rem;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--color-text-muted, #6b7280);
    cursor: default;
}

.reaction-summary-emoji {
    font-size: 0.9rem;
    line-height: 1;
}

.reaction-summary-count {
    font-weight: 600;
    color: var(--color-text, #2c2c2c);
    margin-left: 0.15rem;
}

/* Default "React" button — the primary tap target. Full-width
   emoji + label on the left so the button reads as "act on this",
   not just "look at this". */
.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--color-text, #2c2c2c);
    cursor: pointer;
    transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

    .reaction-btn:hover {
        background: rgba(0, 0, 0, 0.04);
        transform: translateY(-1px);
    }

    .reaction-btn:disabled {
        opacity: 0.6;
        cursor: default;
    }

    /* Reacted state — tinted accent so the user knows their tap stuck. */
    .reaction-btn-reacted {
        background: var(--color-accent-soft, rgba(16, 185, 129, 0.12));
        border-color: var(--color-accent, #10b981);
        color: var(--color-accent, #0f766e);
        font-weight: 600;
    }

.reaction-btn-emoji {
    font-size: 1.05rem;
    line-height: 1;
}

.reaction-btn-label {
    line-height: 1;
}

/* Small "•••" opener — always visible so touch users have a
   deterministic tap target for the picker (hover isn't reliable
   on mobile). Kept subtle so desktop users just hover instead. */
.reaction-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 999px;
    color: var(--color-text-muted, #6b7280);
    cursor: pointer;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.05em;
    transition: background 0.15s;
}

    .reaction-more-btn:hover {
        background: rgba(0, 0, 0, 0.06);
    }

/* Floating emoji palette — appears above the bar. Uses absolute
   positioning against .reaction-bar's relative anchor. z-index
   floats it above surrounding content (lightbox overlays, video
   modal chrome). */
.reaction-picker {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    display: flex;
    gap: 0.15rem;
    padding: 0.35rem 0.55rem;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
    z-index: 40;
    animation: reaction-picker-in 0.15s ease-out;
}

@keyframes reaction-picker-in {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.94);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.reaction-picker-item {
    background: transparent;
    border: none;
    padding: 0.25rem 0.35rem;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 999px;
    transition: transform 0.12s, background 0.12s;
}

    /* Facebook-style: hovering an emoji pops it up and enlarges it
       to preview the reaction before commit. */
    .reaction-picker-item:hover {
        transform: translateY(-4px) scale(1.35);
        background: rgba(0, 0, 0, 0.04);
    }

    .reaction-picker-item:disabled {
        opacity: 0.6;
        cursor: default;
    }

    /* Currently-selected emoji gets a subtle ring so the user sees
       which one is "theirs" when the picker is open. */
    .reaction-picker-item-active {
        background: rgba(0, 0, 0, 0.08);
        box-shadow: inset 0 0 0 2px var(--color-accent, #10b981);
    }

/* ── Dark-backdrop variant ─────────────────────────────────────
   The photo lightbox and video modal render against a near-black
   overlay, so the default light-mode chrome for the bar disappears.
   Wrap any ReactionBar inside a container with this class to swap
   the button chrome for a translucent-on-dark treatment while
   keeping the picker itself light (it sits above the backdrop, so
   readability is unchanged). */
.lightbox-reactions,
.vip-reactions,
.reaction-bar-on-dark {
    display: flex;
    justify-content: center;
    padding: 0.5rem 1rem;
}

    .lightbox-reactions .reaction-btn,
    .lightbox-reactions .reaction-more-btn,
    .vip-reactions .reaction-btn,
    .vip-reactions .reaction-more-btn,
    .reaction-bar-on-dark .reaction-btn,
    .reaction-bar-on-dark .reaction-more-btn {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.25);
        color: #fff;
    }

        .lightbox-reactions .reaction-btn:hover,
        .lightbox-reactions .reaction-more-btn:hover,
        .vip-reactions .reaction-btn:hover,
        .vip-reactions .reaction-more-btn:hover,
        .reaction-bar-on-dark .reaction-btn:hover,
        .reaction-bar-on-dark .reaction-more-btn:hover {
            background: rgba(255, 255, 255, 0.18);
        }

    .lightbox-reactions .reaction-btn-reacted,
    .vip-reactions .reaction-btn-reacted,
    .reaction-bar-on-dark .reaction-btn-reacted {
        background: var(--color-accent-soft, rgba(16, 185, 129, 0.25));
        border-color: var(--color-accent, #10b981);
        color: #fff;
    }

    .lightbox-reactions .reaction-summary,
    .vip-reactions .reaction-summary,
    .reaction-bar-on-dark .reaction-summary {
        background: rgba(255, 255, 255, 0.12);
        color: rgba(255, 255, 255, 0.85);
    }

        .lightbox-reactions .reaction-summary-count,
        .vip-reactions .reaction-summary-count,
        .reaction-bar-on-dark .reaction-summary-count {
            color: #fff;
        }
