/**
 * RaxBoard Emoji Picker — panel UI
 * Scoped to .rb-emoji-panel — safe to load globally.
 */

.rb-emoji-panel {
    position: absolute;
    z-index: 9999;
    width: 340px;
    max-height: 420px;
    display: flex;
    flex-direction: column;
    background: var(--surface, #131110);
    color: var(--foreground, #f5f4f2);
    border: 1px solid var(--border, rgba(255,255,255,0.12));
    border-radius: 12px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.55);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    animation: rb-emoji-pop 0.15s ease-out;
}

@keyframes rb-emoji-pop {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.rb-emoji-panel__head {
    padding: 10px 12px 6px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}

.rb-emoji-panel__search {
    width: 100%;
    padding: 7px 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: inherit;
    font: inherit;
    outline: none;
}

.rb-emoji-panel__search:focus {
    border-color: #ff5722;
    background: rgba(255,87,34,0.06);
}

.rb-emoji-panel__tabs {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
    overflow-x: auto;
    /* Hide the scrollbar — it overlapped the category icons and made the row
       look half-cut. Still scrollable by wheel/drag. */
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 0 0 auto;
}

.rb-emoji-panel__tabs::-webkit-scrollbar { display: none; }

.rb-emoji-panel__tab {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.12s;
}

.rb-emoji-panel__tab:hover   { background: rgba(255,255,255,0.06); }
.rb-emoji-panel__tab.is-active {
    background: rgba(255,87,34,0.15);
    box-shadow: inset 0 -2px 0 #ff5722;
}

.rb-emoji-panel__grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 8px;
    overflow-y: auto;
    scrollbar-width: thin;
    min-height: 260px;
}

.rb-emoji-panel__cell {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 0;
    background: transparent;
    border-radius: 6px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.1s, transform 0.1s;
}

.rb-emoji-panel__cell:hover {
    background: rgba(255,255,255,0.08);
    transform: scale(1.15);
}

.rb-emoji-panel__empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 12px;
    color: rgba(255,255,255,0.4);
    font-size: 13px;
}

.rb-emoji-panel__foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid var(--border, rgba(255,255,255,0.08));
    background: rgba(0,0,0,0.2);
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

.rb-emoji-panel__preview { font-size: 22px; line-height: 1; }
.rb-emoji-panel__name    { font-family: ui-monospace, Menlo, monospace; font-size: 11px; }

/* ─── Reaction picker (facebook-style strip) ─── */
.rb-reactions-strip {
    display: inline-flex;
    gap: 4px;
    padding: 6px 10px;
    background: var(--surface, #131110);
    border: 1px solid var(--border, rgba(255,255,255,0.12));
    border-radius: 999px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.45);
}

.rb-reactions-strip__btn {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.23, 1, 0.32, 1);
}

.rb-reactions-strip__btn img {
    width: 100%;
    height: 100%;
    display: block;
}

.rb-reactions-strip__btn:hover {
    transform: scale(1.35) translateY(-6px);
}

/* Mobile */
@media (max-width: 480px) {
    .rb-emoji-panel {
        width: calc(100vw - 20px);
        max-width: 320px;
    }
    .rb-emoji-panel__grid {
        grid-template-columns: repeat(7, 1fr);
    }
}
