/* QC Rich Chat Input - TipTap Editor Styles */

/* === Editor Container === */
.qc-chat-input-wrapper {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.qc-chat-input-wrapper.qc-disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Mount point containers must participate in parent flex layout */
#message-convo-tiptap,
[id^="chat-input-tiptap"] {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

/* Match the existing textarea styles */
.qc-tiptap-editor .ProseMirror {
    width: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    box-sizing: border-box;
    font-size: 13px;
    padding: 6px 4px;
    outline: none;
    position: relative;
    min-height: 32px;
    max-height: 150px;
    resize: none;
    line-height: 20px;
    margin: 0;
    overflow-y: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-family: inherit;
    color: inherit;
}

.qc-tiptap-editor .ProseMirror p {
    margin: 0;
}

/* Placeholder text */
.qc-tiptap-editor .ProseMirror p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    float: left;
    color: #aaa;
    pointer-events: none;
    height: 0;
    font-style: normal;
}

/* Subject chat variant */
.post-chat .qc-tiptap-editor .ProseMirror {
    font-size: inherit;
    max-height: 160px;
}

/* Hide the legacy <label> placeholder when TipTap is mounted (it has its own) */
.post-chat .chat-input-shell:has([id^="chat-input-tiptap"]) > label {
    display: none !important;
}

/* === Inline Emoji Nodes === */
.qc-emoji-node {
    display: inline;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin: 0 1px;
    cursor: default;
}

/* === Mention Chips === */
a.qc-mention-chip,
.qc-mention-chip {
    display: inline;
    background: rgba(93, 212, 188, 0.15);
    color: #5dd4bc;
    border-radius: 3px;
    padding: 1px 3px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

a.qc-mention-chip:hover {
    text-decoration: underline;
}

/* === BBCode Tag Text (inline decorations) === */
.qc-bbcode-tag-inline {
    font-size: .8em;
    font-weight: 600;
    letter-spacing: -0.5px;
    opacity: 0.7;
}

/* Text formatting classes - keep the actual formatting */
.qc-bbfmt-bold { font-weight: bold; }
.qc-bbfmt-italic { font-style: italic; }
.qc-bbfmt-underline { text-decoration: underline; }
.qc-bbfmt-strike { text-decoration: line-through; }
.qc-bbfmt-code { font-family: monospace; padding: 1px 3px; }
.qc-bbfmt-spoiler { /* no special formatting in editor */ }

/* === Suggestion Dropdowns === */
.qc-suggestion-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    margin-bottom: 4px;
}

/* Emoji dropdown entries */
.qc-emoji-dropdown .search-header {
    padding: 6px 10px;
    font-size: 11px;
    color: #888;
    border-bottom: 1px solid #eee;
}

.qc-emoji-dropdown .emoji-container {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    cursor: pointer;
    gap: 8px;
}

.qc-emoji-dropdown .emoji-container:hover,
.qc-emoji-dropdown .emoji-container.selected {
    background: rgba(93, 212, 188, 0.1);
}

.qc-emoji-dropdown .emoji-container .emopick-emj {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.qc-emoji-dropdown .emoji-title {
    flex: 1;
    font-size: 13px;
}

.qc-emoji-dropdown .emoji-server {
    font-size: 11px;
    color: #aaa;
}

/* Mention dropdown entries */
.qc-mention-dropdown .mention-entry {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    cursor: pointer;
    gap: 8px;
}

.qc-mention-dropdown .mention-entry:hover,
.qc-mention-dropdown .mention-entry.selected {
    background: rgba(93, 212, 188, 0.1);
}

.qc-mention-dropdown .mention-entry .avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
}

.qc-mention-dropdown .autocomplete-username {
    font-size: 13px;
}

/* Suggestion text highlight */
.qc-emoji-suggestion-active {
    color: #5dd4bc;
}

.qc-mention-suggestion-active {
    color: #5dd4bc;
}
