/* =============================================================
   CHAT EMOJI REACTIONS (Standard 6 + Custom Plus Picker)
   ============================================================= */

.chat-msg {
    position: relative;
}

.chat-msg:hover .chat-msg__react-btn,
.chat-msg:focus-within .chat-msg__react-btn {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.chat-msg__bubble-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
}

.chat-msg__react-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    background: rgba(14, 18, 25, 0.95);
    border: none;
    color: var(--text-secondary, #cbd5e1);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    padding: 0;
    margin: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.chat-msg__react-btn:hover {
    color: #f1c40f;
    background: rgba(22, 29, 41, 1);
    border-color: rgba(212, 175, 55, 0.8);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.35);
    transform: scale(1.15);
}

.chat-msg--self .chat-msg__react-btn {
    order: -1;
}

.chat-msg__reactions {
    margin-top: 3px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 100%;
}

.chat-msg--self .chat-msg__reactions {
    justify-content: flex-end;
}

.chat-reactions-wrap {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.chat-reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 12px;
    background: #1A1714;
    border: 1px solid #2A241F;
    color: var(--text-secondary, #E6E2DD);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    line-height: 1.2;
}

.chat-reaction-pill:hover {
    background: #231E19;
    border-color: #3D352E;
    transform: translateY(-1px);
}

.chat-reaction-pill--active {
    background: rgba(201, 162, 39, 0.15) !important;
    border-color: rgba(201, 162, 39, 0.7) !important;
    color: var(--color-gold, #C9A227) !important;
    box-shadow: 0 0 6px rgba(201, 162, 39, 0.25);
}

.chat-reaction-pill--more {
    font-size: 0.7rem;
    color: var(--text-dim, #8A857C);
    background: #13110F;
    border-color: #2A241F;
}

.chat-reaction-emoji {
    font-size: 0.85rem;
    line-height: 1;
}

.chat-reaction-count {
    font-size: 0.7rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Floating Emoji Quick Picker */
.chat-reaction-picker {
    position: absolute;
    z-index: 10000;
    background: var(--bg-elevated, #1F1B17);
    border: 1px solid rgba(201, 162, 39, 0.45);
    border-radius: 20px;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85), 0 0 12px rgba(201, 162, 39, 0.2);
    animation: chatPickerPop 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes chatPickerPop {
    from { opacity: 0; transform: scale(0.85) translateY(4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.chat-reaction-picker__btn {
    background: transparent;
    border: none;
    font-size: 1.15rem;
    padding: 3px 5px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease;
    line-height: 1;
}

.chat-reaction-picker__btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.25);
}

.chat-reaction-picker__plus {
    font-size: 0.85rem;
    font-weight: 700;
    color: #94a3b8;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    border: none;
}

.chat-reaction-picker__plus:hover {
    color: #f1c40f;
    background: rgba(212, 175, 55, 0.25);
}

.chat-reaction-picker__input {
    width: 48px;
    height: 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 6px;
    color: #fff;
    text-align: center;
    font-size: 0.95rem;
    outline: none;
    padding: 0 4px;
}

/* ── Reply Action Button ── */
.chat-msg:hover .chat-msg__reply-btn,
.chat-msg:focus-within .chat-msg__reply-btn {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.chat-msg__reply-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    background: rgba(14, 18, 25, 0.95);
    border: none;
    color: var(--text-secondary, #cbd5e1);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    padding: 0;
    margin: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.chat-msg__reply-btn:hover {
    color: #38bdf8;
    background: rgba(22, 29, 41, 1);
    border-color: rgba(56, 189, 248, 0.7);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
    transform: scale(1.15);
}

.chat-msg--self .chat-msg__reply-btn {
    order: -2;
}

/* ── Copy Action Button ── */
.chat-msg:hover .chat-msg__copy-btn,
.chat-msg:focus-within .chat-msg__copy-btn {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.chat-msg__copy-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
    background: rgba(14, 18, 25, 0.95);
    border: none;
    color: var(--text-secondary, #cbd5e1);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    padding: 0;
    margin: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.chat-msg__copy-btn:hover {
    color: #10b981;
    background: rgba(22, 29, 41, 1);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.35);
    transform: scale(1.15);
}

.chat-msg--self .chat-msg__copy-btn {
    order: -3;
}

/* ── Embedded Reply Quote inside Bubble ── */
.chat-msg__reply-quote {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.35);
    border-left: 3px solid #f1c40f;
    border-radius: 4px;
    padding: 3px 8px;
    margin-bottom: 5px;
    font-size: 0.75rem;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    transition: background 0.15s ease;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.chat-msg__reply-quote:hover {
    background: rgba(255, 255, 255, 0.08);
}

.chat-msg__reply-user {
    font-weight: 700;
    color: #f1c40f;
    white-space: nowrap;
}

.chat-msg__reply-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.85;
}

/* ── Reply Bar Above Input Area ── */
.chat-reply-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    border-left: 3px solid #f1c40f;
    padding: 5px 10px;
    font-size: 0.75rem;
    color: var(--text-secondary, #cbd5e1);
    animation: chatReplySlide 0.15s ease-out;
}

@keyframes chatReplySlide {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-reply-bar__info {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.chat-reply-bar__info i {
    color: #f1c40f;
    font-size: 0.75rem;
}

.chat-reply-bar__user {
    color: #f1c40f;
}

.chat-reply-bar__text {
    opacity: 0.85;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-reply-bar__close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.chat-reply-bar__close:hover {
    color: #ef4444;
}

/* ── Mentions Formatting & Personal Highlight ── */
.chat-mention {
    display: inline-block;
    padding: 0 4px;
    margin: 0 1px;
    border-radius: 4px;
    background: rgba(212, 175, 55, 0.15);
    color: #f1c40f;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s ease;
}

.chat-mention:hover {
    background: rgba(212, 175, 55, 0.3);
    text-decoration: underline;
}

.chat-msg--mentioned .chat-msg__bubble {
    border-color: rgba(212, 175, 55, 0.75) !important;
    background: rgba(212, 175, 55, 0.1) !important;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
}

/* ── Jump Scroll Flash Highlight ── */
.chat-msg--flash {
    animation: chatMsgFlash 1.5s ease-out;
}

@keyframes chatMsgFlash {
    0% { background: rgba(212, 175, 55, 0.35); }
    100% { background: transparent; }
}

/* ── @Mention Autocomplete Dropdown ── */
.chat-mention-autocomplete {
    position: absolute;
    bottom: 50px;
    left: 10px;
    right: 10px;
    max-height: 180px;
    overflow-y: auto;
    background: var(--bg-elevated, #1F1B17);
    border: 1px solid rgba(201, 162, 39, 0.4);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9), 0 0 12px rgba(201, 162, 39, 0.2);
    z-index: 10000;
}

.chat-mention-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    transition: background 0.12s ease;
    border-bottom: 1px solid #231E19;
}

.chat-mention-item:last-child {
    border-bottom: none;
}

.chat-mention-item:hover,
.chat-mention-item--active {
    background: rgba(201, 162, 39, 0.14);
}

.chat-mention-item__avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2A241F;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--color-gold, #C9A227);
    border: 1px solid rgba(201, 162, 39, 0.3);
}

.chat-mention-item__info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
    gap: 6px;
}

.chat-mention-item__name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #E6E2DD);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-mention-item__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    white-space: nowrap;
}

.chat-mention-item__badge--friend {
    color: var(--color-gold, #C9A227);
    background: rgba(201, 162, 39, 0.15);
    border: 1px solid rgba(201, 162, 39, 0.45);
}

/* ── Mobile Action Bar Below Message ── */
.chat-msg__mobile-actions {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 3px 6px;
    background: rgba(14, 18, 25, 0.95);
    border: none;
    border-radius: 18px;
    width: fit-content;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7), 0 0 10px rgba(212, 175, 55, 0.15);
    animation: chatPickerPop 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-msg--self .chat-msg__mobile-actions {
    align-self: flex-end;
}

.chat-msg__mobile-action-btn {
    background: rgba(22, 29, 41, 0.85);
    border: none;
    color: var(--text-secondary, #cbd5e1);
    border-radius: 50%;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
    opacity: 1 !important;
    pointer-events: auto !important;
    margin: 0 !important;
}

.chat-msg__mobile-action-btn:hover,
.chat-msg__mobile-action-btn:active {
    background: rgba(212, 175, 55, 0.25);
    border-color: rgba(212, 175, 55, 0.85);
    color: #f1c40f;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
    transform: scale(1.1);
}

.chat-msg__mobile-action-btn.chat-msg__reply-btn:hover,
.chat-msg__mobile-action-btn.chat-msg__reply-btn:active {
    background: rgba(56, 189, 248, 0.25);
    border-color: rgba(56, 189, 248, 0.85);
    color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
    transform: scale(1.1);
}

.chat-msg__mobile-action-btn.chat-msg__copy-btn:hover,
.chat-msg__mobile-action-btn.chat-msg__copy-btn:active {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.85);
    color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    transform: scale(1.1);
}

@media (max-width: 1023.98px) {
    /* Hide desktop floating hover buttons on mobile/tablet view */
    .chat-msg__bubble-wrap > .chat-msg__react-btn,
    .chat-msg__bubble-wrap > .chat-msg__reply-btn,
    .chat-msg__bubble-wrap > .chat-msg__copy-btn {
        display: none !important;
    }

    /* Reveal the mobile actions bar when the message is tapped / active */
    .chat-msg.chat-msg--active .chat-msg__mobile-actions {
        display: inline-flex !important;
    }
}

/* ── Floating "Scroll to Bottom" Pill ── */
.chat-scroll-bottom-pill {
    position: absolute;
    bottom: 66px;
    right: 18px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(31, 27, 23, 0.96);
    color: var(--color-gold, #C9A227);
    border: 1px solid rgba(201, 162, 39, 0.5);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.85), 0 0 10px rgba(201, 162, 39, 0.25);
    z-index: 15;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.chat-scroll-bottom-pill:hover {
    background: rgba(42, 36, 31, 0.98);
    border-color: var(--color-gold, #C9A227);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.95), 0 0 14px rgba(201, 162, 39, 0.4);
}

.chat-scroll-bottom-pill:active {
    transform: translateY(0) scale(0.96);
}

.chat-scroll-bottom-pill__badge {
    background: var(--color-oxblood, #A6332C);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 2px;
}

/* ── Mention & Reply Alert Badging (Clean Borderless Pill) ── */
.chat-fab__badge--mention {
    background: #0f0d0a !important; /* Deep Obsidian Charcoal */
    color: #fbbf24 !important; /* Vivid 24K Radiant Gold */
    border: none !important;
    outline: none !important;
    box-shadow: 0 0 0 1.5px #12100d, 0 2px 6px rgba(0, 0, 0, 0.75), 0 0 10px rgba(245, 158, 11, 0.6) !important;
    font-weight: 900 !important;
    font-size: 0.625rem !important;
    font-family: var(--font-mono, monospace) !important;
    font-variant-numeric: tabular-nums !important;
    min-width: 1.25rem !important;
    width: auto !important;
    height: 1.1875rem !important;
    line-height: 1.1875rem !important;
    padding: 0 5.5px !important;
    border-radius: 9999px !important;
    white-space: nowrap !important;
    letter-spacing: -0.02em !important;
    z-index: 10;
}
/* ── Regular Unread Badging (Clean Borderless Gold Count) ── */
.chat-fab__badge--unread {
    background: #d97706 !important; /* Rich Syndicate Gold/Amber */
    color: #0b0906 !important;
    border: none !important;
    outline: none !important;
    box-shadow: 0 0 0 1.5px #12100d, 0 2px 6px rgba(0, 0, 0, 0.75), 0 0 8px rgba(217, 119, 6, 0.5) !important;
    font-weight: 800 !important;
    font-size: 0.625rem !important;
    font-family: var(--font-mono, monospace) !important;
    font-variant-numeric: tabular-nums !important;
    min-width: 1.25rem !important;
    width: auto !important;
    height: 1.1875rem !important;
    line-height: 1.1875rem !important;
    padding: 0 5.5px !important;
    border-radius: 9999px !important;
    white-space: nowrap !important;
    letter-spacing: -0.02em !important;
    z-index: 9;
}

/* ── Calm Unread Breathe Glow (No Shaking, No Rings) ── */
.chat-fab--glowing {
    border-color: rgba(245, 158, 11, 0.95) !important;
    animation: chatCalmBreathe 3.5s ease-in-out infinite !important;
}

@keyframes chatCalmBreathe {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 8px rgba(245, 158, 11, 0.35);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 18px rgba(245, 158, 11, 0.8);
    }
}

.chat-tab-badge--mention {
    background: #c99727 !important;
    color: #0b0906 !important;
    font-weight: 800 !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 0 8px rgba(201, 151, 39, 0.5) !important;
}

/* ── Floating "Jump to @mention" Pill ── */
.chat-mention-jump-pill {
    position: absolute;
    top: 54px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 24, 16, 0.96);
    color: #ffd875;
    border: 1px solid rgba(201, 151, 39, 0.7);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.9), 0 0 12px rgba(201, 151, 39, 0.35);
    z-index: 20;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.chat-mention-jump-pill:hover {
    background: rgba(45, 36, 24, 0.98);
    border-color: #ffd875;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.95), 0 0 16px rgba(201, 151, 39, 0.5);
}

.chat-mention-jump-pill:active {
    transform: translateX(-50%) translateY(0) scale(0.96);
}

.chat-mention-jump-pill i {
    font-size: 0.75rem;
}

/* ── Spec / Prototype styles for clean DOM nodes ── */
.msg.flash, .chat-msg.flash {
    background: rgba(201, 162, 39, 0.22) !important;
    transition: background 0.8s ease;
}
.quote, .chat-msg__reply-quote {
    font-size: 12px;
    color: #8A857C;
    border-left: 2px solid #2a251d;
    padding-left: 8px;
    margin-bottom: 4px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.deleted {
    color: #8A857C;
    font-style: italic;
}
.mention {
    color: #C9A227;
    font-weight: 600;
}
.mention.self {
    background: rgba(201, 162, 39, 0.25);
    border-radius: 2px;
    padding: 0 3px;
}



