/* ===== Floating chat heads =====
   Messenger-style avatar bubbles that appear on ANY page (not the chat page
   itself - static/website/js/chat-heads.js no-ops there) when a message
   notification arrives. Loaded on both frontend/website/base.html and
   frontend/dashboard/base.html, so every custom property below has an
   inline fallback rather than relying on either site's own theme variables.
*/
.lx-chat-heads {
    position: fixed;
    inset-inline-end: 18px;
    bottom: 18px;
    z-index: 6000;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
}

.lx-chat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

/* RTL pages (body.rtl, used across this codebase) mirror the preview to the
   other side of the avatar so it still reads outward from the bubble. */
body.rtl .lx-chat-head { flex-direction: row-reverse; }

.lx-chat-head-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    /* A white/light profile photo would otherwise blend into a light
       background - a visible ring around the bubble keeps it readable
       regardless of what the photo looks like. */
    border: 2px solid var(--danger, #ef4444);
    background: var(--accent, #4f46e5);
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    overflow: visible;
    box-shadow: var(--shadow-lg, 0 12px 32px rgba(15, 22, 40, 0.22));
    pointer-events: auto;
    cursor: pointer;
    animation: lxChatHeadPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lx-chat-head-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.lx-chat-head-badge {
    position: absolute;
    top: -4px;
    inset-inline-end: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger, #ef4444);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    border: 2px solid var(--card, #fff);
}

.lx-chat-head-preview {
    max-width: 240px;
    padding: 9px 14px;
    border-radius: 14px;
    background: var(--card, #fff);
    color: var(--text, #0f1628);
    font-size: 0.82rem;
    line-height: 1.4;
    box-shadow: var(--shadow-md, 0 4px 16px rgba(15, 22, 40, 0.12));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateY(6px) scale(0.96);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.lx-chat-head-preview.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@keyframes lxChatHeadPop {
    0% { transform: scale(0.4); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 640px) {
    .lx-chat-heads { inset-inline-end: 12px; bottom: 84px; }
    .lx-chat-head-preview { max-width: 62vw; }
}
