/* Sick Animations for MineFun Social */

/* Heart particle animation */
@keyframes heartParticleFloat {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(
            calc(cos(var(--angle)) * var(--distance)),
            calc(sin(var(--angle)) * var(--distance))
        ) scale(0) rotate(180deg);
        opacity: 0;
    }
}

.heart-particle {
    filter: drop-shadow(0 0 4px rgba(255, 71, 87, 0.8));
}

/* Like button bounce */
@keyframes likeButtonBounce {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3) rotate(-10deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    75% {
        transform: scale(1.2) rotate(-5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* Confetti animation */
@keyframes confettiFloat {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(
            calc(cos(var(--angle)) * var(--distance)),
            calc(sin(var(--angle)) * var(--distance) + 300px)
        ) rotate(var(--rotation));
        opacity: 0;
    }
}

/* Success ripple */
@keyframes successRipple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Shake animation for errors */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

/* Pop-in animation for new posts */
@keyframes popIn {
    0% {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) translateY(0);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Slide in from top for new posts */
@keyframes slideInFromTop {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Glow pulse for new content */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(76, 175, 80, 0.4);
    }
}

/* Enhanced like button hover */
.action-btn.like-btn {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.action-btn.like-btn:hover {
    transform: scale(1.1);
}

.action-btn.like-btn:active {
    transform: scale(0.95);
}

.action-btn.like-btn.liked {
    color: #ff4757;
}

.action-btn.like-btn.liked i {
    animation: heartBeat 0.3s ease-in-out;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(1.2);
    }
}

/* Post creation success animation */
.post-created-success {
    animation: glowPulse 1s ease-in-out;
}

/* Smooth transitions for all interactive elements */
.action-btn,
.post-btn-submit,
.create-post-close-btn {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.action-btn:hover,
.post-btn-submit:hover {
    transform: translateY(-2px);
}

.action-btn:active,
.post-btn-submit:active {
    transform: translateY(0);
}

/* Loading spinner with bounce */
@keyframes spinnerBounce {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
}

.loading-spinner {
    animation: spinnerBounce 1s ease-in-out infinite;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* New post highlight */
.post.new-post {
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), glowPulse 2s ease-in-out;
    animation-delay: 0s, 0.5s;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Button press effect */
.btn-press-effect {
    position: relative;
    overflow: hidden;
}

.btn-press-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-press-effect:active::after {
    width: 300px;
    height: 300px;
}
