/* ════════════════════════════════════════════════════════════════
   Comment Reputation v3 — Front-end CSS
   ════════════════════════════════════════════════════════════════ */

/* ── Vote bar ────────────────────────────────────────────────────── */
.cr-vote-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    background: #f7f8fa;
    border: 1px solid #e4e6ea;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 13px;
    user-select: none;
}

.cr-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 3px 7px;
    border-radius: 999px;
    line-height: 1;
    transition: background .15s, transform .1s;
    color: #888;
}
.cr-btn:hover { background: #e8eaf0; transform: scale(1.15); color: #333; }

.cr-upvote.cr-active,
.cr-upvote.cr-voted-up   { color: #1a7a35; background: #e6f4ea; }
.cr-downvote.cr-active,
.cr-downvote.cr-voted-down { color: #c5221f; background: #fce8e6; }

.cr-score {
    font-weight: 700;
    font-size: 13px;
    min-width: 28px;
    text-align: center;
    transition: color .2s;
}
.cr-score-pos  { color: #1a7a35; }
.cr-score-neg  { color: #c5221f; }
.cr-score-zero { color: #888;    }

/* ── Tags ────────────────────────────────────────────────────────── */
.cr-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}
.cr-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 500;
}
.cr-tag-up   { background: #e6f4ea; color: #1a7a35; }
.cr-tag-down { background: #fce8e6; color: #c5221f; }

/* ── Modal overlay ───────────────────────────────────────────────── */
#cr-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: crFadeIn .18s ease;
}

#cr-modal {
    background: #fff;
    border-radius: 14px;
    padding: 26px 28px 20px;
    min-width: 260px;
    max-width: 340px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    gap: 9px;
    animation: crSlideUp .2s ease;
}
#cr-modal h3 {
    margin: 0 0 4px;
    font-size: 15px;
    color: #222;
    font-weight: 700;
}

.cr-cat-btn {
    background: #f4f5f7;
    border: 1px solid #dde0e6;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: background .12s, border-color .12s;
    color: #1a7a35;
    font-weight: 500;
}
.cr-cat-btn:hover { background: #e6f4ea; border-color: #a8d5b5; }
.cr-cat-btn-down  { color: #c5221f; }
.cr-cat-btn-down:hover { background: #fce8e6; border-color: #f5a9a4; }

#cr-modal-cancel {
    margin-top: 4px;
    background: none;
    border: none;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 0;
    text-align: center;
    transition: color .12s;
}
#cr-modal-cancel:hover { color: #c00; }

/* ── Toast (vote feedback) ───────────────────────────────────────── */
#cr-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #222;
    color: #fff;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    z-index: 99997;
    transition: opacity .25s, transform .25s;
    white-space: nowrap;
}
#cr-toast.cr-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Animations ──────────────────────────────────────────────────── */
@keyframes crFadeIn  { from { opacity: 0 } to { opacity: 1 } }
@keyframes crSlideUp { from { transform: translateY(16px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
