/**
 * article-enhance.css - Comment system enhancements
 * English comments only (GBK server compatibility)
 * Features: Image upload, Emoji picker, Edit/Delete, VIP badge, Follow button
 */

/* Comment form tools */
.comment-form-tools {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
}

.comment-tool-btn:hover {
    color: #1890ff;
    border-color: #1890ff;
    background: #e6f7ff;
}

/* Emoji picker */
.emoji-picker {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 8px;
}

.emoji-picker button {
    font-size: 20px;
    padding: 5px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.emoji-picker button:hover {
    background: #f0f0f0;
}

/* VIP badge */
.vip-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #f7ba2a, #f7ba2a);
    margin-left: 6px;
    vertical-align: middle;
}

.vip-badge:contains('SVIP') {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

/* Follow button */
.follow-btn {
    display: inline-block;
    padding: 3px 12px;
    border: 1px solid #1890ff;
    border-radius: 12px;
    font-size: 12px;
    color: #1890ff;
    background: #fff;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.3s;
    vertical-align: middle;
}

.follow-btn:hover {
    background: #e6f7ff;
}

.follow-btn.followed {
    color: #999;
    border-color: #d9d9d9;
    background: #f5f5f5;
}

.follow-btn.followed:hover {
    color: #ff4d4f;
    border-color: #ff4d4f;
    background: #fff1f0;
}

/* Comment edit form */
.comment-edit-form {
    margin-top: 8px;
}

.comment-edit-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

.comment-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
}

/* Comment action buttons */
.comment-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #666;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.2s;
}

.comment-action-btn:hover {
    color: #1890ff;
    background: #e6f7ff;
}

.comment-action-btn.active {
    color: #ff4d4f;
    font-weight: 600;
}

.comment-action-btn.active svg {
    fill: #ff4d4f;
    stroke: #ff4d4f;
}

.comment-delete-btn:hover {
    color: #ff4d4f !important;
    background: #fff1f0 !important;
}

/* Button small */
.btn-small {
    padding: 4px 12px;
    font-size: 13px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-small.btn-primary {
    background: #1890ff;
    color: #fff;
    border-color: #1890ff;
}

.btn-small.btn-primary:hover {
    background: #40a9ff;
}

.btn-small:hover {
    border-color: #1890ff;
    color: #1890ff;
}

/* Comment text with images */
.comment-text img {
    max-width: 200px;
    height: auto;
    border-radius: 6px;
    margin: 4px 0;
}

/* ========== Threaded Reply Styles ========== */
.comment-replies {
    margin-top: 10px;
    padding-left: 12px;
    border-left: 2px solid #f0f0f0;
    margin-left: 36px;
}

.comment-reply-item {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid #fafafa;
}

.comment-reply-item:last-child {
    border-bottom: none;
}

.comment-reply-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.comment-reply-content {
    flex: 1;
    min-width: 0;
}

.comment-reply-header {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    margin-bottom: 3px;
}

.comment-reply-author {
    font-weight: 600;
    color: #333;
}

.vip-small {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
}

.comment-reply-to {
    color: #999;
    font-size: 12px;
}

.comment-reply-to strong {
    color: #666;
    font-weight: 500;
}

.comment-reply-text {
    font-size: 13.5px;
    color: #444;
    line-height: 1.5;
    margin: 0;
    word-break: break-word;
}

.comment-reply-actions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.reply-like-btn, .reply-del-btn {
    font-size: 12px !important;
    padding: 2px 8px !important;
}

/* Inline reply form */
.inline-reply-form {
    margin-top: 12px;
    padding: 12px;
    background: #fafbfc;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.reply-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 50px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.reply-textarea:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.1);
}

.inline-reply-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .comment-form-tools {
        gap: 4px;
    }

    .comment-tool-btn {
        width: 32px;
        height: 32px;
    }

    .emoji-picker {
        grid-template-columns: repeat(7, 1fr);
    }

    .follow-btn {
        padding: 2px 8px;
        font-size: 11px;
    }
}
