/* /css/comment_reaction.css */
.cmt_contents {
    position: relative;
}

.comment-reactions {
    display: inline-flex;
    gap: 5px;
    position: absolute;
    right: 0;
    top: 10px;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border: 1px solid #ddd;
    border-radius: 15px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-size: 12px;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.reaction-btn:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.reaction-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 클릭 효과 - 리플 애니메이션 */
.reaction-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.reaction-btn:active::before {
    width: 300px;
    height: 300px;
}

.reaction-btn.active {
    border-color: #333;
    background: #f0f0f0;
    animation: clickPulse 0.4s ease-out;
}

.reaction-btn.active.like {
    color: #0000ff;
    border-color: #0000ff;
    background: #e6e6ff;
}

.reaction-btn.active.dislike {
    color: #e74c3c;
    border-color: #e74c3c;
    background: #ffeaea;
}

.reaction-btn.active.sad {
    color: #9b59b6;
    border-color: #9b59b6;
    background: #f3e5f5;
}

.reaction-btn .reaction-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.reaction-btn:hover .reaction-icon {
    transform: scale(1.2) rotate(-10deg);
}

.reaction-btn.active .reaction-icon {
    animation: iconBounce 0.6s ease;
}

.reaction-btn .reaction-text {
    font-size: 11px;
    color: #666;
    transition: all 0.3s ease;
}

.reaction-btn.active .reaction-text {
    color: inherit;
}

.reaction-btn .reaction-icon.animated {
    animation: bigBounce 0.6s ease;
}

.reaction-btn .count {
    font-weight: bold;
    color: #666;
    font-size: 11px;
    transition: all 0.3s ease;
    display: inline-block;
}

/* 숫자 변경 애니메이션 */
.reaction-btn .count.changing {
    animation: countChange 0.4s ease;
}

.reaction-btn.active .count {
    color: inherit;
}

.reaction-btn.processing {
    opacity: 0.5;
    cursor: not-allowed;
    animation: shake 0.3s ease;
}

/* 버튼 나타나기 애니메이션 */
.comment-reactions {
    animation: fadeInRight 0.5s ease;
}

/* 애니메이션 정의 */
@keyframes iconBounce {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.3) rotate(-10deg); }
    50% { transform: scale(0.9) rotate(10deg); }
    75% { transform: scale(1.2) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes bigBounce {
    0% { transform: scale(1); }
    20% { transform: scale(1.5) rotate(-15deg); }
    40% { transform: scale(0.8) rotate(10deg); }
    60% { transform: scale(1.3) rotate(-10deg); }
    80% { transform: scale(0.95) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes clickPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes countChange {
    0% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.5) translateY(-5px); }
    100% { transform: scale(1) translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 좋아요 특별 효과 */
.reaction-btn.like.active .reaction-icon {
    animation: heartBeat 0.8s ease;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

/* 슬퍼요 특별 효과 */
.reaction-btn.sad.active .reaction-icon {
    animation: tearDrop 0.8s ease;
}

@keyframes tearDrop {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(3px) scale(1.1); }
    100% { transform: translateY(0) scale(1); }
}

/* 반응형 */
@media (max-width: 768px) {
    .comment-reactions {
        position: static;
        margin-top: 8px;
        justify-content: flex-end;
        animation: fadeInUp 0.5s ease;
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .reaction-btn {
        padding: 2px 6px;
        font-size: 11px;
    }
    
    .reaction-btn .reaction-icon {
        font-size: 12px;
    }
    
    .reaction-btn .reaction-text {
        font-size: 10px;
    }
}