/**
 * 父系树评论组件样式
 */

.tree-comment-wrapper {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.comment-header h4 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.comment-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.comment-form .form-group {
    margin-bottom: 15px;
}

.comment-form label {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    display: block;
}

.comment-form .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.comment-form textarea.form-control {
    resize: vertical;
}

.comment-form .text-muted {
    color: #999;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.comment-form .btn {
    margin-right: 10px;
}

.comment-list {
    margin-bottom: 20px;
}

.comment-list .loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.comment-list .alert {
    padding: 15px;
    border-radius: 4px;
}

.comment-list .alert-info {
    background-color: #d9edf7;
    border-color: #bce8f1;
    color: #31708f;
}

.comment-list .alert-warning {
    background-color: #fcf8e3;
    border-color: #faebcc;
    color: #8a6d3b;
}

.comment-list .alert-danger {
    background-color: #f2dede;
    border-color: #ebccd1;
    color: #a94442;
}

.comments {
    margin-top: 10px;
}

.comment-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background 0.3s;
}

.comment-item:hover {
    background: #f8f9fa;
}

.comment-item:last-child {
    border-bottom: none;
}

/* 待审核评论样式 */
.comment-item.comment-pending {
    background-color: #fffbf0;
    border-left: 3px solid #f0ad4e;
}

.comment-item.comment-pending:hover {
    background-color: #fff8e1;
}

.badge-warning {
    background-color: #f0ad4e;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: normal;
}

.comment-header-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-meta {
    display: flex;
    align-items: center;
    flex: 1;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-author {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.comment-time {
    color: #999;
    font-size: 12px;
}

/* 删除按钮 */
.btn-delete-comment {
    background: none;
    border: none;
    color: #d9534f;
    font-size: 20px;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
    transition: all 0.3s;
}

.btn-delete-comment:hover {
    color: #c9302c;
    transform: scale(1.2);
}

.comment-content-item {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.comment-pagination {
    margin-top: 20px;
    text-align: center;
}

.comment-pagination .pagination {
    display: inline-block;
    padding-left: 0;
    margin: 0;
    border-radius: 4px;
}

.comment-pagination .pagination > li {
    display: inline;
}

.comment-pagination .pagination > li > a,
.comment-pagination .pagination > li > span {
    position: relative;
    float: left;
    padding: 6px 12px;
    line-height: 1.42857143;
    text-decoration: none;
    color: #337ab7;
    background-color: #fff;
    border: 1px solid #ddd;
    margin-left: -1px;
}

.comment-pagination .pagination > li:first-child > a,
.comment-pagination .pagination > li:first-child > span {
    margin-left: 0;
    border-bottom-left-radius: 4px;
    border-top-left-radius: 4px;
}

.comment-pagination .pagination > li:last-child > a,
.comment-pagination .pagination > li:last-child > span {
    border-bottom-right-radius: 4px;
    border-top-right-radius: 4px;
}

.comment-pagination .pagination > li > a:hover,
.comment-pagination .pagination > li > span:hover,
.comment-pagination .pagination > li > a:focus,
.comment-pagination .pagination > li > span:focus {
    color: #23527c;
    background-color: #eee;
    border-color: #ddd;
}

.comment-pagination .pagination > .active > a,
.comment-pagination .pagination > .active > span,
.comment-pagination .pagination > .active > a:hover,
.comment-pagination .pagination > .active > span:hover,
.comment-pagination .pagination > .active > a:focus,
.comment-pagination .pagination > .active > span:focus {
    z-index: 2;
    color: #fff;
    cursor: default;
    background-color: #337ab7;
    border-color: #337ab7;
}

.btn {
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    text-decoration: none;
}

.btn-primary {
    color: #fff;
    background-color: #337ab7;
    border-color: #2e6da4;
}

.btn-primary:hover {
    color: #fff;
    background-color: #286090;
    border-color: #204d74;
}

.btn-default {
    color: #333;
    background-color: #fff;
    border-color: #ccc;
}

.btn-default:hover {
    color: #333;
    background-color: #e6e6e6;
    border-color: #adadad;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

/* RTL (Right-to-Left) Support for Arabic and other RTL languages */
.tree-comment-rtl .comment-header {
    flex-direction: row-reverse;
}

.tree-comment-rtl .comment-header-item {
    flex-direction: row-reverse;
}

.tree-comment-rtl .comment-form label {
    text-align: right;
}

.tree-comment-rtl .comment-form .text-muted {
    text-align: right;
}

.tree-comment-rtl .btn {
    margin-right: 0;
    margin-left: 10px;
}

.tree-comment-rtl .comment-pagination .pagination > li {
    float: right;
}

.tree-comment-rtl .comment-pagination .pagination > li > a,
.tree-comment-rtl .comment-pagination .pagination > li > span {
    float: right;
}

.tree-comment-rtl .comment-pagination .pagination > li:first-child > a,
.tree-comment-rtl .comment-pagination .pagination > li:first-child > span {
    margin-right: 0;
    margin-left: -1px;
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
    border-bottom-right-radius: 4px;
    border-top-right-radius: 4px;
}

.tree-comment-rtl .comment-pagination .pagination > li:last-child > a,
.tree-comment-rtl .comment-pagination .pagination > li:last-child > span {
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 4px;
    border-top-left-radius: 4px;
}

/* ============================================
   回复列表样式
   ============================================ */
.comment-replies {
    margin-left: 50px;
    margin-top: 15px;
    border-left: 3px solid #e0e0e0;
    padding-left: 20px;
}

/* 回复项样式 */
.reply-item {
    padding: 12px 15px;
    margin-bottom: 12px;
    background-color: #f7f7f7;
    border-radius: 6px;
    border-left: 3px solid #d0d0d0;
    transition: background 0.3s;
}

.reply-item:hover {
    background-color: #ececec;
    border-left-color: #b0b0b0;
}

.reply-item:last-child {
    margin-bottom: 0;
}

.reply-item.reply-pending {
    background-color: #fffbf0;
    border-left: 3px solid #f0ad4e;
}

.reply-item.reply-pending:hover {
    background-color: #fff8e1;
}

/* 回复按钮 */
.btn-reply-comment {
    background: none;
    border: none;
    color: #337ab7;
    cursor: pointer;
    padding: 0 8px;
    font-size: 12px;
    transition: color 0.3s;
}

.btn-reply-comment:hover {
    color: #23527c;
    text-decoration: underline;
}

/* 回复目标显示 */
.reply-to {
    color: #337ab7;
    font-size: 12px;
    margin-left: 8px;
}

/* ============================================
   点赞按钮样式 - 拇指向上设计
   ============================================ */
.btn-like-comment {
    background: none;
    border: 1px solid #ddd;
    border-radius: 16px;
    color: #999;
    cursor: pointer;
    padding: 4px 12px;
    font-size: 13px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-like-comment:hover {
    background-color: #fff5f5;
    border-color: #ff6b6b;
    color: #ff6b6b;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.2);
}

.btn-like-comment.liked {
    background-color: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
}

.btn-like-comment.liked:hover {
    background-color: #ff5252;
    border-color: #ff5252;
}

/* 点赞图标 - 使用 CSS 绘制拇指向上 */
.btn-like-comment .like-icon {
    position: relative;
    display: inline-block;
    width: 14px;
    height: 14px;
    transition: transform 0.3s;
}

.btn-like-comment .like-icon::before {
    content: '👍';
    position: absolute;
    left: 0;
    top: -2px;
    font-size: 14px;
    filter: grayscale(1);
    opacity: 0.6;
}

.btn-like-comment.liked .like-icon::before {
    filter: grayscale(0);
    opacity: 1;
}

.btn-like-comment:hover .like-icon {
    transform: scale(1.15) rotate(-10deg);
}

.btn-like-comment.liked .like-icon {
    animation: like-bounce 0.5s ease;
}

@keyframes like-bounce {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.2) rotate(-15deg);
    }
    50% {
        transform: scale(1.3) rotate(0deg);
    }
    75% {
        transform: scale(1.2) rotate(15deg);
    }
}

.btn-like-comment .like-count {
    font-size: 12px;
    font-weight: 500;
    min-width: 16px;
}

/* ============================================
   点踩按钮样式 - 拇指向下设计
   ============================================ */
.btn-dislike-comment {
    background: none;
    border: 1px solid #ddd;
    border-radius: 16px;
    color: #999;
    cursor: pointer;
    padding: 4px 12px;
    font-size: 13px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-dislike-comment:hover {
    background-color: #f5f5ff;
    border-color: #6b6bff;
    color: #6b6bff;
    transform: translateY(1px);
    box-shadow: 0 -2px 4px rgba(107, 107, 255, 0.2);
}

.btn-dislike-comment.disliked {
    background-color: #6b6bff;
    border-color: #6b6bff;
    color: #fff;
}

.btn-dislike-comment.disliked:hover {
    background-color: #5252ff;
    border-color: #5252ff;
}

/* 点踩图标 - 拇指向下 */
.btn-dislike-comment .dislike-icon {
    position: relative;
    display: inline-block;
    width: 14px;
    height: 14px;
    transition: transform 0.3s;
}

.btn-dislike-comment .dislike-icon::before {
    content: '👎';
    position: absolute;
    left: 0;
    top: -2px;
    font-size: 14px;
    filter: grayscale(1);
    opacity: 0.6;
}

.btn-dislike-comment.disliked .dislike-icon::before {
    filter: grayscale(0);
    opacity: 1;
}

.btn-dislike-comment:hover .dislike-icon {
    transform: scale(1.15) rotate(10deg);
}

.btn-dislike-comment.disliked .dislike-icon {
    animation: dislike-bounce 0.5s ease;
}

@keyframes dislike-bounce {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.2) rotate(15deg);
    }
    50% {
        transform: scale(1.3) rotate(0deg);
    }
    75% {
        transform: scale(1.2) rotate(-15deg);
    }
}

.btn-dislike-comment .dislike-count {
    font-size: 12px;
    font-weight: 500;
    min-width: 16px;
}

/* RTL support for replies and likes */
.tree-comment-rtl .comment-replies {
    margin-left: 0;
    margin-right: 50px;
    border-left: none;
    border-right: 3px solid #e0e0e0;
    padding-left: 0;
    padding-right: 20px;
}

.tree-comment-rtl .reply-to {
    margin-left: 0;
    margin-right: 8px;
}

