/* DEZIPP - Animations and Keyframes */

/* Keyframe Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-10px);
    }
    70% {
        transform: translateY(-5px);
    }
    90% {
        transform: translateY(-2px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes scale {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.8);
        opacity: 0;
    }
}

@keyframes wiggle {
    0%, 7% {
        transform: rotateZ(0);
    }
    15% {
        transform: rotateZ(-15deg);
    }
    20% {
        transform: rotateZ(10deg);
    }
    25% {
        transform: rotateZ(-10deg);
    }
    30% {
        transform: rotateZ(6deg);
    }
    35% {
        transform: rotateZ(-4deg);
    }
    40%, 100% {
        transform: rotateZ(0);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 30px rgba(59, 130, 246, 0.6);
    }
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* Animation Classes */
.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

.animate-fadeOut {
    animation: fadeOut 0.3s ease-out;
}

.animate-slideIn {
    animation: slideIn 0.3s ease-out;
}

.animate-slideOut {
    animation: slideOut 0.3s ease-out;
}

.animate-slideUp {
    animation: slideUp 0.4s ease-out;
}

.animate-slideDown {
    animation: slideDown 0.4s ease-out;
}

.animate-bounce {
    animation: bounce 1s ease;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-scale {
    animation: scale 0.3s ease-out;
}

.animate-scaleOut {
    animation: scaleOut 0.3s ease-out;
}

.animate-wiggle {
    animation: wiggle 1s ease-in-out;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-typing {
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

/* Transition Classes */
.transition-all {
    transition: all 0.2s ease;
}

.transition-colors {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.transition-transform {
    transition: transform 0.2s ease;
}

.transition-opacity {
    transition: opacity 0.2s ease;
}

.transition-slow {
    transition-duration: 0.5s;
}

.transition-fast {
    transition-duration: 0.1s;
}

/* Hover Animations */
.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
}

/* Loading States */
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% {
        color: transparent;
        text-shadow:
            0.25em 0 0 transparent,
            0.5em 0 0 transparent;
    }
    40% {
        color: currentColor;
        text-shadow:
            0.25em 0 0 transparent,
            0.5em 0 0 transparent;
    }
    60% {
        text-shadow:
            0.25em 0 0 currentColor,
            0.5em 0 0 transparent;
    }
    80%, 100% {
        text-shadow:
            0.25em 0 0 currentColor,
            0.5em 0 0 currentColor;
    }
}

/* Notification Animations */
.notification-enter {
    animation: slideIn 0.3s ease-out, fadeIn 0.3s ease-out;
}

.notification-exit {
    animation: slideOut 0.3s ease-out, fadeOut 0.3s ease-out;
}

/* Modal Animations */
.modal-enter {
    animation: scale 0.3s ease-out, fadeIn 0.3s ease-out;
}

.modal-exit {
    animation: scaleOut 0.3s ease-out, fadeOut 0.3s ease-out;
}

/* Page Transition */
.page-transition-enter {
    animation: fadeIn 0.4s ease-out;
}

.page-transition-exit {
    animation: fadeOut 0.4s ease-out;
}

/* Mood Button Animations */
.mood-button {
    transition: all 0.2s ease;
}

.mood-button:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mood-button.selected {
    animation: bounce 0.6s ease;
}

/* Chat Message Animations */
.chat-message-enter {
    animation: slideUp 0.3s ease-out;
}

.chat-typing {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Post Interactions */
.like-button.liked {
    animation: heartBeat 0.8s ease;
    color: #ef4444;
}

.share-button:active {
    animation: wiggle 0.5s ease;
}

/* Enhanced Like Animation */
@keyframes heartBeat {
    0% {
        transform: scale(1);
        color: #6b7280;
    }
    25% {
        transform: scale(1.3);
        color: #f87171;
    }
    50% {
        transform: scale(1.1);
        color: #ef4444;
    }
    75% {
        transform: scale(1.25);
        color: #dc2626;
    }
    100% {
        transform: scale(1);
        color: #ef4444;
    }
}

/* Comment Button Animation */
.comment-button:active {
    animation: commentPop 0.4s ease;
}

.comment-button.comment-clicked {
    animation: commentPop 0.4s ease;
}

@keyframes commentPop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2) rotateZ(-5deg);
    }
    100% {
        transform: scale(1);
    }
}

/* Post Action Buttons General Enhancement */
.post-actions button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 209, 204, 0.2);
}

.post-actions button:active {
    transform: translateY(0px) scale(0.95);
}

/* Heart floating animation for likes */
.like-heart-float {
    animation: floatHeart 1s ease-out forwards;
    pointer-events: none;
    position: absolute;
    color: #ef4444;
    font-size: 14px;
    z-index: 10;
}

@keyframes floatHeart {
    0% {
        opacity: 1;
        transform: translateY(0px) scale(0.8);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-20px) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0.6);
    }
}

/* Sidebar Menu Item Animations */
.sidebar-menu-item {
    animation: slideInLeft 0.3s ease-out;
}

.sidebar-menu-item:nth-child(1) { animation-delay: 0.1s; }
.sidebar-menu-item:nth-child(2) { animation-delay: 0.15s; }
.sidebar-menu-item:nth-child(3) { animation-delay: 0.2s; }
.sidebar-menu-item:nth-child(4) { animation-delay: 0.25s; }
.sidebar-menu-item:nth-child(5) { animation-delay: 0.3s; }
.sidebar-menu-item:nth-child(6) { animation-delay: 0.35s; }
.sidebar-menu-item:nth-child(7) { animation-delay: 0.4s; }
.sidebar-menu-item:nth-child(8) { animation-delay: 0.45s; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Sidebar Icon Pulse on Hover */
.sidebar-menu-item:hover i {
    animation: iconPulse 0.4s ease;
}

@keyframes iconPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1.1);
    }
}

/* Profile Picture Animations */
#sidebar-profile-pic {
    transition: all 0.3s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    aspect-ratio: 1 / 1;
}

#sidebar-profile-pic:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* Button Press Animation */
.btn:active {
    transform: translateY(1px) scale(0.98);
}

/* Stagger Animation for Lists */
.stagger-item {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }

/* Infinite Animations */
.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Success/Error State Animations */
.success-flash {
    animation: successPulse 0.6s ease;
}

.error-flash {
    animation: errorShake 0.6s ease;
}

@keyframes successPulse {
    0% {
        background-color: var(--success);
        transform: scale(1);
    }
    50% {
        background-color: #34d399;
        transform: scale(1.05);
    }
    100% {
        background-color: var(--success);
        transform: scale(1);
    }
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
        background-color: var(--error);
    }
    25% {
        transform: translateX(-5px);
        background-color: #f87171;
    }
    75% {
        transform: translateX(5px);
        background-color: #f87171;
    }
}

/* Post Create: Mood Zoom Transition */
@keyframes moodZoomFlash {
    0% { transform: scale(0); opacity: 0.9; }
    70% { transform: scale(1.2); opacity: 0.6; }
    100% { transform: scale(1.6); opacity: 0; }
}

#post-modal-content.modal-has-flash {
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.modal-color-flash {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 16px;
    background: var(--mood-color, transparent);
    animation: moodZoomFlash 600ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.mood-btn-zoom {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    transition: transform 350ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 350ms ease;
}

/* Step panel transitions */
@keyframes stepOutUp {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-16px) scale(0.98); }
}

@keyframes stepInUp {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.animate-step-out {
    animation: stepOutUp 300ms ease forwards;
}

.animate-step-in {
    animation: stepInUp 350ms ease forwards;
}

