/* ---- Mention Autocomplete ---- */

.mention {
    display: inline-flex;
    align-items: baseline;
    cursor: pointer;
    white-space: nowrap;
    font-size: inherit;
    line-height: inherit;
    vertical-align: baseline;
}

.mention:hover {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.mention-icon {
    display: inline-block !important;
    width: 1.1em !important;
    height: 1.1em !important;
    max-width: 1.1em !important;
    object-fit: contain;
    margin: 0 2px 0 0 !important;
    border-radius: 0 !important;
    flex-shrink: 0;
    align-self: center;
    vertical-align: -0.15em;
}

/* Dropdown */
.mention-dropdown {
    position: fixed;
    z-index: 10000;
    background: #1a1b22;
    border: 1px solid #333;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    max-height: 280px;
    overflow-y: auto;
    min-width: 240px;
    display: none;
}

.mention-dropdown__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
}

.mention-dropdown__item:hover,
.mention-dropdown__item--active {
    background: rgba(196, 162, 78, 0.12);
}

.mention-dropdown__icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 2px;
}

.mention-dropdown__icon-placeholder {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.mention-dropdown__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
}

.mention-dropdown__type {
    color: #7a7870;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.mention-dropdown__empty {
    padding: 16px;
    text-align: center;
    color: #7a7870;
    font-size: 13px;
}

/* --- Tooltip (minimal, for pages that only load mentions.css) --- */
/* Full tooltip styles live in gear-slots.css / builds-list.css; these are fallback rules
   so that tooltip.js works on guide pages without loading those heavier stylesheets. */
.item-tooltip {
    position: fixed;
    z-index: 99999;
    background: #1A1B20;
    border: 1px solid #3f3f46;
    border-radius: 2px;
    min-width: 280px;
    max-width: 340px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
    will-change: opacity, transform;
    font-family: 'Roboto', sans-serif;
}

.item-tooltip--visible {
    opacity: 1;
    transform: scale(1);
}

.item-tooltip h1,
.item-tooltip h2,
.item-tooltip h3,
.item-tooltip h4 { font-family: inherit; }

.item-tooltip--mobile-top {
    left: 0 !important;
    top: 0 !important;
    right: 0;
    min-width: 0;
    max-width: none;
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 2px solid #3f3f46;
    transform: translateY(-100%);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.7);
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
}

.item-tooltip--mobile-top.item-tooltip--visible {
    transform: translateY(0);
}

.item-tooltip__close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid #3f3f46;
    border-radius: 4px;
    color: #a1a1aa;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 1;
}

.item-tooltip__name {
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.item-tooltip__name--unique { color: var(--unique-gold, #a37e2c); }
.item-tooltip__name--mythic { color: var(--mythic-red, #c0a1d8); text-shadow: 0 0 12px rgba(192, 161, 216, 0.6); }
.item-tooltip__name--legendary { color: var(--legendary-purple, #d98c3c); }
.item-tooltip__name--rare { color: var(--rare-yellow, #ffd700); }
.item-tooltip__name--magic { color: var(--magic-blue, #6d6ed9); }

.item-tooltip__type { font-size: 0.8rem; color: #a0a0a0; margin-bottom: 0.25rem; }
.item-tooltip__rarity { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.item-tooltip__divider { height: 1px; background: #2a2a35; margin: 0.75rem 0; }
.item-tooltip__affixes { margin: 0.75rem 0; }
.item-tooltip__affix { font-size: 0.85rem; color: #e0ddd5; margin-bottom: 0.4rem; padding-left: 0.5rem; border-left: 2px solid transparent; }
.item-tooltip__affix--greater { color: #c4a24e; border-left-color: #c4a24e; }
.item-tooltip__effect { font-size: 0.85rem; color: #c4a24e; margin: 0.5rem 0; padding: 0.5rem; background: rgba(196, 162, 78, 0.08); border-radius: 4px; }
.item-tooltip__flavor { font-size: 0.8rem; font-style: italic; color: #7a7870; margin-top: 0.5rem; }

/* @ toolbar button */
.ge-toolbar__mention {
    font-weight: 700;
    font-size: 15px;
    color: var(--accent-gold, #c4a24e);
}

#rte-mention-btn {
    font-weight: 700;
    font-size: 15px;
    color: var(--accent-gold, #c4a24e);
}
