﻿/* ============ Wrapper ============ */
.cmt-wrap {
    margin-top: 1.5rem;
    font-size: .875rem;
    color: #2c2c2c;
}

.cmt-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: .75rem;
    border-bottom: 1px solid #ececec;
    margin-bottom: .5rem;
}

.cmt-count {
    font-weight: 600;
    font-size: .95rem;
}

.cmt-btn-add {
    background: none;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    padding: .3rem .75rem;
    font-size: .8rem;
    color: #444;
    cursor: pointer;
    transition: all .15s;
}

    .cmt-btn-add:hover {
        background: #f5f5f5;
        border-color: #bbb;
        color: #000;
    }

/* ============ Form ============ */
#addCommentForm {
    margin: .75rem 0 1rem;
}

.cmt-textarea {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: .5rem .75rem;
    font-size: .85rem;
    resize: vertical;
    outline: none;
    transition: border-color .15s;
}

    .cmt-textarea:focus {
        border-color: #0d6efd;
    }

.cmt-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    margin-top: .5rem;
}

.cmt-btn-primary, .cmt-btn-ghost {
    border-radius: 6px;
    padding: .3rem .9rem;
    font-size: .8rem;
    cursor: pointer;
    border: 1px solid transparent;
}

.cmt-btn-primary {
    background: #0d6efd;
    color: #fff;
}

    .cmt-btn-primary:hover {
        background: #0b5ed7;
    }

.cmt-btn-ghost {
    background: transparent;
    border-color: #ddd;
    color: #666;
}

    .cmt-btn-ghost:hover {
        background: #f5f5f5;
    }

.cmt-empty {
    color: #888;
    font-size: .85rem;
    padding: 1rem 0;
    text-align: center;
}

/* ============ Comment ============ */
.cmt {
    display: flex;
    gap: .6rem;
    padding: .7rem 0;
    border-bottom: 1px solid #f2f2f2;
}

    .cmt:last-child {
        border-bottom: none;
    }

.cmt-avatar-col {
    flex: 0 0 28px;
}

.cmt-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.cmt-avatar--letter {
    background: #e9ecef;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 600;
}

.cmt-main {
    flex: 1;
    min-width: 0;
}

/* ============ Meta row ============ */
.cmt-meta {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .75rem;
    color: #666;
    margin-bottom: .15rem;
    flex-wrap: wrap;
}

.cmt-author {
    font-weight: 600;
    color: #222;
}

.cmt-dot {
    color: #bbb;
}

.cmt-date {
    color: #999;
}

/* ============ Text ============ */
.cmt-text {
    margin: 0 0 .3rem;
    font-size: .85rem;
    line-height: 1.5;
    color: #333;
    white-space: pre-line;
    word-break: break-word;
}

/* ============ Reply button ============ */
.cmt-reply {
    background: none;
    border: none;
    padding: 0;
    color: #888;
    font-size: .72rem;
    cursor: pointer;
    transition: color .15s;
}

    .cmt-reply:hover {
        color: #0d6efd;
        text-decoration: underline;
    }

/* ============ Children ============ */
.cmt-children {
    margin-top: .5rem;
    padding-left: .6rem;
    border-left: 2px solid #f0f0f0;
}

    .cmt-children .cmt {
        padding: .5rem 0;
    }

/* ============ Votes (inline, compact) ============ */
.cmt-votes {
    display: inline-flex;
    gap: .4rem;
    margin-inline-start: auto;
}

.cmt-vote {
    background: none;
    border: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    cursor: pointer;
    color: #999;
    font-size: .72rem;
    transition: color .15s;
}

.vote-icon {
    width: 13px;
    height: 13px;
    object-fit: contain;
    opacity: .7;
    transition: opacity .15s;
}

.cmt-vote:hover .vote-icon,
.cmt-vote.active .vote-icon {
    opacity: 1;
}

.cmt-vote:hover .vote-count,
.cmt-vote.active .vote-count {
    color: #333;
}

.like-btn.active .vote-icon,
.like-btn:hover .vote-icon {
    filter: brightness(0) saturate(100%) invert(39%) sepia(97%) saturate(2000%) hue-rotate(200deg) brightness(97%) contrast(105%);
}

.dislike-btn.active .vote-icon,
.dislike-btn:hover .vote-icon {
    filter: brightness(0) saturate(100%) invert(16%) sepia(89%) saturate(6059%) hue-rotate(358deg) brightness(95%) contrast(112%);
}

.like-btn.active .vote-count {
    color: #0d6efd;
}

.dislike-btn.active .vote-count {
    color: #c0392b;
}

/* ============ Load more ============ */
.cmt-loadmore {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    width: 100%;
    margin-top: .5rem;
    padding: .55rem;
    background: none;
    border: none;
    color: #777;
    font-size: .8rem;
    cursor: pointer;
    transition: color .15s, background .15s;
}

    .cmt-loadmore:hover {
        color: #0d6efd;
        background: #fafafa;
    }

    .cmt-loadmore .bi {
        transition: transform .25s;
    }

    .cmt-loadmore.expanded .bi {
        transform: rotate(180deg);
    }

.remaining-comments {
    animation: cmtFade .25s ease forwards;
}

@keyframes cmtFade {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
