/**
 * Styles Tribute.js pour Komodr - Dropdown + Badges mention
 *
 * Copyright (C) 2025 Massaoud <massaoud@dzprod.net>
 */

/* ============================================================================
   DROPDOWN TRIBUTE.JS
   ============================================================================ */

.komodr-tribute-container {
    position: absolute;
    z-index: 10001;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    max-height: 240px;
    overflow-y: auto;
    min-width: 220px;
    max-width: 320px;
    margin-top: 4px;
}

.komodr-tribute-container ul {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

.komodr-tribute-container li {
    padding: 8px 14px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f3f4f6;
}

.komodr-tribute-container li:last-child {
    border-bottom: none;
}

.komodr-tribute-container li:hover,
.komodr-tribute-container li.highlight {
    background: #f0f4ff;
}

/* Item du dropdown */
.komodr-tribute-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.komodr-tribute-name {
    font-weight: 500;
    font-size: 0.88rem;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.komodr-tribute-code {
    font-size: 0.75rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Message "aucun résultat" */
.komodr-tribute-no-match {
    padding: 12px 14px;
    color: #9ca3af;
    font-size: 0.85rem;
    font-style: italic;
    text-align: center;
    cursor: default;
}

/* ============================================================================
   BADGE MENTION (inline dans le contenteditable)
   ============================================================================ */

.komodr-mention {
    display: inline-block;
    background: #e8f0fe;
    color: #2c5aa0;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 1px 8px;
    border-radius: 4px;
    border: 1px solid #c4d7f2;
    cursor: default;
    user-select: all;
    white-space: nowrap;
    vertical-align: baseline;
    line-height: 1.4;
}

.komodr-mention::before {
    content: '\1F3E2';  /* emoji building 🏢 */
    margin-right: 3px;
    font-size: 0.8em;
}

/* ============================================================================
   CONTENTEDITABLE PLACEHOLDER
   ============================================================================ */

.komodr-bubble-input[contenteditable="true"]:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
    display: block;
}

/* ============================================================================
   SCROLLBAR DU DROPDOWN
   ============================================================================ */

.komodr-tribute-container::-webkit-scrollbar {
    width: 6px;
}

.komodr-tribute-container::-webkit-scrollbar-track {
    background: transparent;
}

.komodr-tribute-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.komodr-tribute-container::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
