.mention-dropdown {
    position: fixed;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 9999;
}

.mention-dropdown__list {
    padding: var(--spacing-2);
}

.mention-dropdown__header {
    padding: var(--spacing-2) var(--spacing-3);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mention-dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.mention-dropdown__item:hover,
.mention-dropdown__item.is-selected,
.mention-dropdown__item--selected {
    background-color: var(--color-bg-tertiary);
}

.mention-dropdown__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mention-dropdown__icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.mention-dropdown__text {
    flex: 1;
    min-width: 0;
}

.mention-dropdown__label {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

.mention-dropdown__subtitle {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: 2px;
}

.mention-dropdown__empty {
    padding: var(--spacing-4);
    text-align: center;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.mention-dropdown__loading {
    padding: var(--spacing-4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-2);
}

.mention-dropdown__spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: mention-spinner 0.6s linear infinite;
}

@keyframes mention-spinner {
    to {
        transform: rotate(360deg);
    }
}

.mention-dropdown__loading-text {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.mention {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
}

.mention:hover {
    text-decoration: underline;
}

.mention-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 2px;
}

.ProseMirror .mention {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--color-primary);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.ProseMirror .mention:hover {
    background-color: rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.ProseMirror .mention__icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.ProseMirror .mention__icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.ProseMirror .mention__text {
    display: inline-block;
}

.ProseMirror .mention__edit-input {
    font: inherit;
    color: inherit;
    background: white;
    border: 2px solid #3b82f6;
    border-radius: 4px;
    padding: 2px 6px;
    outline: none;
    min-width: 100px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ProseMirror .mention--user {
    background-color: rgba(139, 92, 246, 0.1);
}

.ProseMirror .mention--user:hover {
    background-color: rgba(139, 92, 246, 0.15);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.3);
}

.ProseMirror .mention--book {
    background-color: rgba(16, 185, 129, 0.1);
}

.ProseMirror .mention--book:hover {
    background-color: rgba(16, 185, 129, 0.15);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3);
}

.ProseMirror .mention--chapter {
    background-color: rgba(245, 158, 11, 0.1);
}

.ProseMirror .mention--chapter:hover {
    background-color: rgba(245, 158, 11, 0.15);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.3);
}

.ProseMirror .mention--encyclopedia_article {
    background-color: rgba(236, 72, 153, 0.1);
}

.ProseMirror .mention--encyclopedia_article:hover {
    background-color: rgba(236, 72, 153, 0.15);
    box-shadow: 0 0 0 1px rgba(236, 72, 153, 0.3);
}

.ProseMirror .mention--universe {
    background-color: rgba(99, 102, 241, 0.1);
}

.ProseMirror .mention--universe:hover {
    background-color: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3);
}

/* Map Embeds */
.mention-map-embed {
    display: block;
    margin: 20px 0;
    clear: both;
    max-width: 100%;
}

.mention-map-embed .map-widget-container,
.mention-map-embed .map-embed-canvas-container {
    max-width: 100%;
}

/* Float left - text wraps on the right */
.mention-map-embed[data-float="left"] {
    float: left;
    margin: 0 20px 20px 0;
    clear: none;
    max-width: 60%; /* Limit width when floating to leave space for text */
}

/* Float right - text wraps on the left */
.mention-map-embed[data-float="right"] {
    float: right;
    margin: 0 0 20px 20px;
    clear: none;
    max-width: 60%; /* Limit width when floating to leave space for text */
}

/* Responsive: disable float on mobile */
@media (max-width: 768px) {
    .mention-map-embed[data-float="left"],
    .mention-map-embed[data-float="right"] {
        float: none;
        margin: 20px 0;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .mention-map-embed .map-embed-canvas-container {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 4 / 3;
    }
}
