/* CommentComposer — shared B/I/U token toolbar + emoji popover editor.
   Lives outside Blazor scoped CSS (like comments.css / wysiwyg-markers.css)
   so it styles the same way regardless of which page hosts the component;
   both App.Web's App.razor and App (MAUI)'s index.html link it alongside
   comments.css. */

.comment-composer {
    display: flex;
    flex-direction: column;
    gap: var(--os-space-sm);
    min-width: 0;
    position: relative;
}

.comment-composer__quote-chip {
    min-width: 0;
}

.comment-composer__toolbar {
    display: flex;
    align-items: center;
    gap: var(--os-space-xs);
}

.comment-composer__tool {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--os-radius-sm);
    background: transparent;
    color: var(--os-text-secondary);
    cursor: pointer;
    font-size: 0.9375rem;
    line-height: 1;
    transition: background var(--os-transition-fast, 120ms);
}

.comment-composer__tool:hover:not(:disabled) {
    background: var(--os-surface-variant);
    color: var(--os-text-primary);
}

.comment-composer__tool:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comment-composer__underline-glyph {
    text-decoration: underline;
}

.comment-composer__tool-spacer {
    flex: 1 1 auto;
    min-width: 0;
}

.comment-composer__input {
    width: 100%;
    min-width: 0;
    resize: vertical;
    font-family: inherit;
}

.comment-composer__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--os-space-sm);
    min-width: 0;
}

.comment-composer__count {
    color: var(--os-text-tertiary);
    font-size: var(--os-font-size-sm, 0.8125rem);
    flex: 0 0 auto;
}

.comment-composer__actions {
    display: flex;
    align-items: center;
    gap: var(--os-space-sm);
    min-width: 0;
}

/* Transparent full-viewport button behind the emoji popover — clicking
   anywhere outside the popover closes it, no click-outside JS needed. */
.comment-composer__emoji-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    border: none;
    background: transparent;
    padding: 0;
    cursor: default;
}

.comment-composer__emoji-pop {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 41;
    margin-top: var(--os-space-xs);
    padding: var(--os-space-sm);
    width: min(320px, 100%);
    max-width: 100%;
    background: var(--os-glass-bg-strong);
    border: 1px solid var(--os-glass-border);
    border-radius: var(--os-radius-lg);
    box-shadow: var(--os-glass-highlight), var(--os-shadow-md, 0 8px 24px rgba(0, 0, 0, 0.18));
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 2px;
}

@supports (backdrop-filter: blur(1px)) {
    .comment-composer__emoji-pop {
        backdrop-filter: blur(var(--os-glass-blur, 16px));
        -webkit-backdrop-filter: blur(var(--os-glass-blur, 16px));
    }
}

.comment-composer__emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    aspect-ratio: 1 / 1;
    border: none;
    border-radius: var(--os-radius-sm);
    background: transparent;
    cursor: pointer;
    font-size: 1.125rem;
    line-height: 1;
    transition: background var(--os-transition-fast, 120ms);
}

.comment-composer__emoji:hover {
    background: var(--os-surface-variant);
}
