/*
    User mentions ("@tagging") within discussions, replies, and check-ins.
    Markup is produced by UserMentionProcessor (Copd.Ntm.Social.Services) and the
    UserMentionSuggestions component. Kept global because the content is rendered
    as MarkupString and the suggestion popup is attached to <body>.
*/

/* ── Inline mention within content ─────────────────────────────────────── */
a.user-mention,
span.user-mention {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    max-width: 100%;
    padding: 0 0.45em 0 0.15em;
    border-radius: 999px;
    background-color: rgba(0, 107, 183, 0.1);
    color: #006bb7;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    vertical-align: baseline;
    white-space: nowrap;
}

a.user-mention:hover,
a.user-mention:focus-visible {
    background-color: rgba(0, 107, 183, 0.2);
    text-decoration: underline;
}

/* A mention of a user that is no longer available */
span.user-mention.user-mention-inactive {
    padding: 0 0.45em;
    background-color: rgba(0, 0, 0, 0.06);
    color: inherit;
    font-weight: 400;
}

/* "prose" (Tailwind typography) adds block margins to images; mentions are inline */
.user-mention img.user-mention-avatar,
.prose .user-mention img.user-mention-avatar {
    display: inline-block;
    flex: none;
    width: 1.35em;
    height: 1.35em;
    margin: 0 !important;
    border-radius: 50%;
    object-fit: cover;
}

.user-mention .user-mention-initials {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.1em;
    height: 2.1em;
    border-radius: 50%;
    background-color: #006bb7;
    color: #fff;
    font-size: 0.65em;
    font-weight: 700;
    line-height: 1;
}

.user-mention .user-mention-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Suggestion popup ──────────────────────────────────────────────────── */

/* Editors live in Bootstrap modals (z-index 1055); the popup must appear above them */
.user-mention-popup.e-popup {
    z-index: 2000 !important;
}

.user-mention-popup .e-list-item {
    height: auto !important;
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
    line-height: normal !important;
}

.user-mention-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.user-mention-option-avatar {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-mention-option-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #006bb7;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.user-mention-option-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.user-mention-option-name,
.user-mention-option-designation {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-mention-option-name {
    font-weight: 600;
}

.user-mention-option-designation {
    font-size: 0.75rem;
    opacity: 0.75;
}

.user-mention-no-results {
    display: block;
    padding: 0.5rem 0.75rem;
}
