/* Comment System - Reddit-style voting, badges, sorting, reporting */

/* Sort bar */
.cv-sort-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}
.cv-sort-bar .cv-sort-label {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    font-weight: 500;
}
.cv-sort-btn {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--text-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.cv-sort-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.cv-sort-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-primary-content);
}

/* Comment layout with vote column */
.comment {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--color-border);
}
.comment:last-child {
    border-bottom: none;
}

/* Vote column */
.cv-vote-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 36px;
    padding-top: 2px;
    flex-shrink: 0;
}
.cv-vote-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: var(--text-base);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    line-height: 1;
    padding: 0;
}
.cv-vote-btn:hover {
    background: var(--color-hover-bg);
}
.cv-vote-btn.cv-upvote:hover,
.cv-vote-btn.cv-upvoted {
    color: #ff6b35;
}
.cv-vote-btn.cv-downvote:hover,
.cv-vote-btn.cv-downvoted {
    color: #7193ff;
}
.cv-vote-score {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    line-height: 1;
    min-width: 20px;
    text-align: center;
}
.cv-vote-score.cv-positive {
    color: #ff6b35;
}
.cv-vote-score.cv-negative {
    color: #7193ff;
}
.cv-vote-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    color: var(--color-text-muted);
    font-size: var(--text-base);
    line-height: 1;
}

/* Comment content */
.comment-content {
    flex: 1;
    min-width: 0;
}
.comment-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
    flex-wrap: wrap;
}
.comment-body {
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--color-text-secondary);
    word-break: break-word;
}
.comment-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    align-items: center;
}

/* Role badges */
.cv-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cv-role-admin {
    background: rgba(229, 57, 53, 0.15);
    color: #e53935;
    border: 1px solid rgba(229, 57, 53, 0.3);
}
.cv-role-editor {
    background: rgba(170, 68, 255, 0.15);
    color: #aa44ff;
    border: 1px solid rgba(170, 68, 255, 0.3);
}

/* Gems display */
.cv-gems {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}
.cv-gems-icon {
    font-size: 11px;
    line-height: 1;
}

/* Replies */
.comment-replies {
    margin-left: var(--space-xl);
    border-left: 2px solid var(--color-border);
    padding-left: var(--space-md);
}
.comment.reply {
    padding: var(--space-sm) 0;
}
.comment.reply .cv-vote-col {
    min-width: 30px;
}
.comment.reply .cv-vote-btn {
    width: 24px;
    height: 20px;
    font-size: var(--text-sm);
}
.comment.reply .cv-vote-icon {
    width: 24px;
    height: 20px;
    font-size: var(--text-sm);
}
.comment.reply .cv-vote-score {
    font-size: var(--text-xs);
}

/* Report button */
.cv-report-btn {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}
.cv-report-btn:hover {
    color: var(--color-warning);
}
.cv-report-btn.cv-reported {
    color: var(--color-warning);
    cursor: default;
    opacity: 0.7;
}

/* Report modal */
.cv-report-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-modal-backdrop);
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
}
.cv-report-modal.active {
    display: flex;
}
.cv-report-modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    width: 90%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color-border);
}
.cv-report-modal-content h3 {
    margin: 0 0 var(--space-md) 0;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-heading);
}
.cv-reason-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}
.cv-reason-option:hover {
    background: var(--color-hover-bg);
}
.cv-reason-option input[type="radio"] {
    accent-color: var(--color-primary);
}
.cv-reason-option label {
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--color-text);
}
.cv-report-details {
    width: 100%;
    margin-top: var(--space-sm);
    padding: var(--space-sm);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-family: inherit;
    font-size: var(--text-sm);
    resize: vertical;
    min-height: 60px;
}
.cv-report-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

/* Pinned badge */
.comment .badge-primary {
    font-size: 10px;
    padding: 1px 6px;
}

/* Reply form inline */
.comment-reply-form {
    margin-top: var(--space-sm);
    padding: var(--space-sm);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}
.comment-reply-form textarea {
    width: 100%;
    padding: var(--space-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-family: inherit;
    font-size: var(--text-sm);
    resize: vertical;
    min-height: 60px;
}
.comment-reply-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    justify-content: flex-end;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .cv-vote-col {
        min-width: 28px;
    }
    .cv-vote-btn {
        width: 24px;
        height: 20px;
        font-size: var(--text-sm);
    }
    .cv-vote-icon {
        width: 24px;
        height: 20px;
        font-size: var(--text-sm);
    }
    .comment-replies {
        margin-left: var(--space-md);
        padding-left: var(--space-sm);
    }
}
