/* Comment Attachments UI */

.comment-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    border: 1px solid var(--block-border, #d4b896);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: var(--block-bg, #fdf8f3);
}

.comment-toolbar button {
    background: none;
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: background 0.15s;
    color: inherit;
    position: relative;
    z-index: 1;
}

.comment-toolbar button:hover {
    background: rgba(139, 94, 60, 0.1);
}

.comment-toolbar button.active {
    background: rgba(139, 94, 60, 0.2);
}

.comment-toolbar .toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--block-border, #d4b896);
    margin: 0 4px;
}

.comment-textarea-wrapper {
    border: 1px solid var(--block-border, #d4b896);
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    background: var(--block-bg, #fdf8f3);
}

.comment-textarea-wrapper textarea {
    width: 100%;
    padding: 10px 12px;
    border: none;
    font-size: 14px;
    background: transparent;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    box-sizing: border-box;
}

.comment-textarea-wrapper textarea:focus {
    outline: none;
}

.comment-form .submit-row {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-form .submit-row button {
    background: #8b5e3c;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.comment-form .submit-row button:hover {
    background: #7a5234;
}

/* Emoji & Sticker Pickers */
.emoji-picker,
.sticker-picker {
    display: none;
    position: fixed;
    z-index: 10000;
    background: var(--block-bg, #fdf8f3);
    border: 1px solid var(--block-border, #d4b896);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    max-width: 360px;
    max-height: 400px;
    overflow: hidden;
}

.picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--block-border, #d4b896);
}

.picker-tabs {
    display: flex;
    overflow-x: auto;
    flex: 1;
}

.picker-header .picker-close {
    background: none;
    border: none;
    padding: 8px 12px;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary, #666);
    line-height: 1;
    flex-shrink: 0;
}

.picker-header .picker-close:hover {
    color: #dc2626;
}

.picker-tabs button {
    background: none;
    border: none;
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    color: inherit;
}

.picker-header button:hover {
    background: rgba(139, 94, 60, 0.05);
}

.picker-header button.active {
    border-bottom-color: var(--accent, #8b5e3c);
    color: var(--accent, #8b5e3c);
    font-weight: 600;
}

.picker-grid {
    padding: 8px;
    overflow-y: auto;
    max-height: 320px;
}

.picker-grid.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
}

.picker-grid.sticker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.picker-grid .emoji-item,
.picker-grid .sticker-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 20px;
}

.picker-grid .emoji-item:hover,
.picker-grid .sticker-item:hover {
    background: rgba(139, 94, 60, 0.1);
}

.picker-grid .sticker-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

/* Attachment Previews */
.attachment-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.attachment-preview {
    position: relative;
    display: inline-block;
}

.attachment-preview .remove-attachment {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 1;
}

.attachment-preview .remove-attachment:hover {
    background: #b91c1c;
}

.attachment-preview img {
    max-width: 120px;
    max-height: 80px;
    border-radius: 6px;
    border: 1px solid var(--block-border, #d4b896);
}

.attachment-preview audio,
.attachment-preview video {
    max-width: 200px;
    border-radius: 6px;
    border: 1px solid var(--block-border, #d4b896);
}

.attachment-preview .sticker-thumb img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

/* Rendered attachments in comments */
.comment-attachments {
    display: inline;
    margin-top: 2px;
    vertical-align: middle;
}

.comment-attachments img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.15s;
    vertical-align: middle;
    margin: 0 1px;
}

.comment-attachments img:hover {
    transform: scale(1.03);
}

.comment-attachments video,
.comment-attachments audio {
    max-width: 200px;
    border-radius: 4px;
    margin: 0 1px;
    vertical-align: middle;
}

.comment-attachments .sticker-render {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: inline;
    margin: 0 1px;
    vertical-align: middle;
}

/* Upload progress */
.upload-progress {
    font-size: 11px;
    color: #a08b72;
}
