/**
 * Mention Dropdown Styles
 *
 * Scoped to #inputContainer .mention-dropdown to prevent conflicts.
 * Positioned above the chat input, similar to autocomplete dropdowns.
 */

/* ── Input highlighter ───────────────────────────────────────────────────── */

#inputContainer .mention-input-shell {
    position: relative;
    display: grid;
    flex: 1 1 auto;
    width: 100%;
}

#inputContainer .mention-input-shell > textarea,
#inputContainer .mention-input-shell > .mention-input-highlight {
    grid-area: 1 / 1;
}

#inputContainer .mention-input-highlight {
    pointer-events: none;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-word;
    color: transparent;
    z-index: 2;
}

#inputContainer .mention-input-shell > textarea {
    position: relative;
    z-index: 1;
    color: var(--text-color, #1f2937);
    -webkit-text-fill-color: currentColor;
    caret-color: var(--text-color, #1f2937);
}

#inputContainer .mention-input-shell > textarea::placeholder {
    -webkit-text-fill-color: initial;
}

#inputContainer .mention-input-highlight__mention {
    color: #2563eb;
}

/* ── Dropdown container ──────────────────────────────────────────────────── */

#inputContainer .mention-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 12px;
    right: 12px;
    max-height: 220px;
    overflow-y: auto;
    background: var(--bg-secondary, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 4px 0;
    margin-bottom: 4px;
}

/* ── Individual item ─────────────────────────────────────────────────────── */

#inputContainer .mention-dropdown__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background-color 0.1s ease;
    font-size: 13px;
    line-height: 1.4;
}

#inputContainer .mention-dropdown__item:hover,
#inputContainer .mention-dropdown__item--active {
    background: var(--bg-hover, #f1f5f9);
}

/* ── Name ────────────────────────────────────────────────────────────────── */

#inputContainer .mention-dropdown__name {
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Secondary @username hint shown when display name differs from username */
#inputContainer .mention-dropdown__handle {
    font-weight: 400;
    font-size: 11px;
    color: var(--text-secondary, #94a3b8);
}

/* ── Role badge ──────────────────────────────────────────────────────────── */

#inputContainer .mention-dropdown__badge {
    font-size: 11px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--bg-tertiary, #e2e8f0);
    color: var(--text-secondary, #64748b);
    white-space: nowrap;
}

#inputContainer .mention-dropdown__badge--everyone {
    background: #fef3c7;
    color: #92400e;
}

/* ── Dark mode ───────────────────────────────────────────────────────────── */

[data-theme="dark"] #inputContainer .mention-dropdown {
    background: var(--bg-secondary, #1e293b);
    border-color: var(--border-color, #334155);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] #inputContainer .mention-input-highlight {
    color: transparent;
}

[data-theme="dark"] #inputContainer .mention-input-highlight__mention {
    color: #60a5fa;
}

[data-theme="dark"] #inputContainer .mention-dropdown__item:hover,
[data-theme="dark"] #inputContainer .mention-dropdown__item--active {
    background: var(--bg-hover, #334155);
}

[data-theme="dark"] #inputContainer .mention-dropdown__name {
    color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] #inputContainer .mention-dropdown__handle {
    color: var(--text-secondary, #64748b);
}

[data-theme="dark"] #inputContainer .mention-dropdown__badge {
    background: var(--bg-tertiary, #334155);
    color: var(--text-secondary, #94a3b8);
}

[data-theme="dark"] #inputContainer .mention-dropdown__badge--everyone {
    background: #451a03;
    color: #fbbf24;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */

#inputContainer .mention-dropdown::-webkit-scrollbar {
    width: 4px;
}

#inputContainer .mention-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-color, #cbd5e1);
    border-radius: 2px;
}
