/* Composant réutilisable : sélecteur d'emojis (EasyMDE + TUIEditor). */

.fb-emoji-picker {
    position: fixed;
    z-index: 10050;
    width: 340px;
    max-width: calc(100vw - 16px);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.fb-emoji-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 6px 4px;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
}
.fb-emoji-tab {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    font-size: 1.15rem;
    line-height: 1;
    padding: 6px 7px;
    border-radius: 8px;
    cursor: pointer;
    opacity: .65;
    transition: background-color .15s ease, opacity .15s ease;
}
.fb-emoji-tab:hover { opacity: 1; background: #f2f2f2; }
.fb-emoji-tab.active { opacity: 1; background: #e9f0ff; box-shadow: inset 0 -2px 0 #4a86ff; }

.fb-emoji-search { padding: 8px 10px; }
.fb-emoji-search input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: .45rem .7rem;
    font-size: .9rem;
    outline: none;
    background: #fafafa;
    color: #222;
}
.fb-emoji-search input:focus { border-color: #4a86ff; background: #fff; }

.fb-emoji-section-title {
    padding: 2px 12px 4px;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #888;
    font-weight: 600;
}

.fb-emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 4px 8px 10px;
    overflow-y: auto;
    max-height: 240px;
}
.fb-emoji-item {
    border: none;
    background: transparent;
    font-size: 1.35rem;
    line-height: 1;
    padding: 5px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .12s ease, transform .05s ease;
}
.fb-emoji-item:hover { background: #f0f0f0; transform: scale(1.15); }
.fb-emoji-item:active { transform: scale(.95); }

.fb-emoji-noresults {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    font-size: .85rem;
    padding: 1.5rem 0;
}

/* ── Thème sombre ── */
[data-theme="dark"] .fb-emoji-picker,
.dark .fb-emoji-picker,
.toastui-editor-dark .fb-emoji-picker {
    background: #1f2330;
    border-color: #333a4d;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .5);
}
[data-theme="dark"] .fb-emoji-tabs,
.toastui-editor-dark .fb-emoji-tabs { border-bottom-color: #333a4d; }
[data-theme="dark"] .fb-emoji-tab:hover { background: #2a3040; }
[data-theme="dark"] .fb-emoji-tab.active { background: #2a3550; box-shadow: inset 0 -2px 0 #5b8cff; }
[data-theme="dark"] .fb-emoji-search input {
    background: #161a24;
    border-color: #333a4d;
    color: #e6e6e6;
}
[data-theme="dark"] .fb-emoji-search input:focus { border-color: #5b8cff; background: #1b2030; }
[data-theme="dark"] .fb-emoji-section-title { color: #8b93a7; }
[data-theme="dark"] .fb-emoji-item:hover { background: #2a3040; }
[data-theme="dark"] .fb-emoji-noresults { color: #8b93a7; }

@media (max-width: 400px) {
    .fb-emoji-grid { grid-template-columns: repeat(7, 1fr); }
}
