/**
 * XNForums 点赞系统样式
 * @version 1.0.0
 */

/* ==================== 点赞按钮容器 ==================== */
.xnforums-like-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 8px 0;
}

/* ==================== 点赞按钮 ==================== */
.xnforums-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
}

.xnforums-like-btn:hover {
    border-color: #ff4757;
    background: #fff5f7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.2);
}

.xnforums-like-btn:active {
    transform: translateY(0);
}

/* 已点赞状态 */
.xnforums-like-btn.liked {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    border-color: #ff6b6b;
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.xnforums-like-btn.liked:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e74c3c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

/* 加载状态 */
.xnforums-like-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==================== 图标和文字 ==================== */
.xnforums-like-btn .like-icon {
    font-size: 18px;
    line-height: 1;
    transition: transform 0.3s ease;
}

.xnforums-like-btn:hover .like-icon {
    transform: scale(1.2);
}

.xnforums-like-btn.liked .like-icon {
    animation: heartBeat 0.6s ease;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(1.25);
    }
}

.xnforums-like-btn .like-text {
    font-size: 14px;
}

.xnforums-like-btn .like-count {
    font-size: 13px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.xnforums-like-btn.liked .like-count {
    color: #fff;
}

/* ==================== 点赞用户预览 ==================== */
.xnforums-like-users-preview {
    display: inline-flex;
    align-items: center;
}

.show-like-users {
    font-size: 13px;
    color: #666;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.show-like-users:hover {
    background: #f5f5f5;
    color: #ff4757;
}

/* ==================== 点赞用户弹窗 ==================== */
.xnforums-like-users-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.xnforums-like-users-modal.show {
    display: flex;
}

.like-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.like-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.like-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.like-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.like-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 1;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.like-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.like-modal-body {
    padding: 16px 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.like-users-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.like-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.like-user-item:hover {
    background: #f9f9f9;
}

.like-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.like-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.like-user-info {
    flex: 1;
    min-width: 0;
}

.like-user-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
    margin-bottom: 2px;
}

.like-user-time {
    font-size: 12px;
    color: #999;
}

.like-users-loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.like-users-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* ==================== 主题/回复元信息中的点赞数 ==================== */
.topic-likes,
.reply-likes {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #ff4757;
    font-size: 13px;
    font-weight: 500;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 640px) {
    .xnforums-like-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .xnforums-like-btn .like-icon {
        font-size: 16px;
    }
    
    .xnforums-like-btn .like-text {
        display: none; /* 移动端隐藏文字，只显示图标 */
    }
    
    .like-modal-content {
        width: 95%;
        max-width: none;
        margin: 20px;
    }
    
    .like-modal-header {
        padding: 16px 20px;
    }
    
    .like-modal-body {
        padding: 12px 20px;
    }
    
    .like-user-item {
        padding: 10px 8px;
    }
}

/* ==================== 深色模式 ==================== */
@media (prefers-color-scheme: dark) {
    .xnforums-like-btn {
        background: #2a2a2a;
        border-color: #444;
        color: #ccc;
    }
    
    .xnforums-like-btn:hover {
        background: #333;
        border-color: #ff6b6b;
    }
    
    .like-modal-content {
        background: #2a2a2a;
    }
    
    .like-modal-header {
        border-bottom-color: #444;
    }
    
    .like-modal-header h3 {
        color: #eee;
    }
    
    .like-user-item:hover {
        background: #333;
    }
    
    .like-user-name {
        color: #eee;
    }
    
    .show-like-users {
        color: #ccc;
    }
    
    .show-like-users:hover {
        background: #333;
        color: #ff6b6b;
    }
}

/* ==================== 动画效果 ==================== */
.xnforums-like-btn.animate-like {
    animation: likeClick 0.4s ease;
}

@keyframes likeClick {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* 点赞数变化动画 */
.like-count.count-increase {
    animation: countIncrease 0.4s ease;
}

@keyframes countIncrease {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

