/* Animations de like */
.extra-post-like-btn.liked {
    animation: like-pulse 0.6s ease;
}

@keyframes like-pulse {
    0% { 
        transform: scale(1); 
        color: #65676b;
    }
    50% { 
        transform: scale(1.3); 
        color: #8a2be2;
    }
    100% { 
        transform: scale(1); 
        color: #8a2be2;
    }
}

/* Animation de chargement */
.extra-post-loading {
    animation: loading-pulse 1.5s ease-in-out infinite;
}

@keyframes loading-pulse {
    0% { 
        opacity: 0.6; 
    }
    50% { 
        opacity: 1; 
    }
    100% { 
        opacity: 0.6; 
    }
}

/* Animation d'apparition des posts */
.extra-post-item {
    animation: slide-up 0.4s ease-out;
}

.extra-post-user-item {
    animation: slide-up 0.4s ease-out;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation de la barre de progression */
.extra-post-progress-fill {
    transition: width 0.3s ease;
    background: linear-gradient(90deg, #8a2be2, #9b4de0);
    position: relative;
    overflow: hidden;
}

.extra-post-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Animation du modal */
.extra-post-modal-content {
    animation: modal-appear 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Animation des boutons d'interaction */
.extra-post-like-btn:hover,
.extra-post-message-btn:hover,
.extra-post-profile-btn:hover {
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

.extra-post-like-btn:active,
.extra-post-message-btn:active,
.extra-post-profile-btn:active {
    transform: translateY(0);
}

/* Animation du bouton de publication */
.extra-post-publish-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.extra-post-publish-btn:disabled {
    transform: none !important;
}

.extra-post-publish-btn:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.extra-post-publish-btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(20, 20);
        opacity: 0.3;
    }
    100% {
        transform: scale(50, 50);
        opacity: 0;
    }
}

/* Animation des onglets */
.extra-post-tab {
    position: relative;
    overflow: hidden;
}

.extra-post-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #8a2be2;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.extra-post-tab.active::after {
    width: 100%;
}

/* Animation du dropdown */
.extra-post-actions-menu {
    animation: dropdown-appear 0.2s ease;
    transform-origin: top right;
}

@keyframes dropdown-appear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation des cartes de statistiques */
.extra-post-stat-card {
    animation: stat-card-appear 0.5s ease-out;
}

@keyframes stat-card-appear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animation de succès */
.extra-post-success-message {
    animation: success-slide 0.5s ease-out;
}

@keyframes success-slide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation de suppression */
.extra-post-item.deleting {
    animation: slide-out 0.3s ease-in forwards;
}

.extra-post-user-item.deleting {
    animation: slide-out 0.3s ease-in forwards;
}

@keyframes slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
        max-height: 500px;
        margin-bottom: 15px;
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
        border: none;
    }
}

/* Animation de pulse pour nouveaux messages */
@keyframes highlight-pulse {
    0% { background-color: transparent; }
    50% { background-color: rgba(138, 43, 226, 0.1); }
    100% { background-color: transparent; }
}

.extra-post-item.new-post {
    animation: highlight-pulse 2s ease-in-out 3;
}

/* Animation de rotation pour icônes de chargement */
.extra-post-loading-spinner {
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animation de fade pour les transitions d'onglets */
.extra-post-tab-content {
    animation: fade-in 0.3s ease;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Animation de bounce pour les interactions */
@keyframes bounce-gentle {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0,-5px,0);
    }
    70% {
        transform: translate3d(0,-3px,0);
    }
    90% {
        transform: translate3d(0,-1px,0);
    }
}

.extra-post-like-btn.liked {
    animation: bounce-gentle 0.6s ease;
}

/* Animation de shake pour les erreurs */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.extra-post-error {
    animation: shake 0.5s ease-in-out;
}

/* Animation de zoom pour les médias */
.extra-post-media img,
.extra-post-media video {
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.extra-post-media img:hover,
.extra-post-media video:hover {
    transform: scale(1.02);
}

/* Animation de skeleton loading */
.extra-post-skeleton {
    background: linear-gradient(90deg, #f0f2f5 25%, #e4e6e9 50%, #f0f2f5 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 15px;
}

.extra-post-skeleton-header {
    display: flex;
    gap: 10px;
    padding: 15px;
}

.extra-post-skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f2f5 25%, #e4e6e9 50%, #f0f2f5 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.extra-post-skeleton-content {
    flex: 1;
}

.extra-post-skeleton-line {
    height: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #f0f2f5 25%, #e4e6e9 50%, #f0f2f5 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.extra-post-skeleton-line.short {
    width: 60%;
}

.extra-post-skeleton-line.medium {
    width: 80%;
}

.extra-post-skeleton-line.long {
    width: 100%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Animation pour les notifications */
.extra-post-notification {
    animation: notification-slide 0.3s ease-out;
}

@keyframes notification-slide {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation de pulse pour les nouveaux likes */
@keyframes like-burst {
    0% {
        box-shadow: 0 0 0 0 rgba(138, 43, 226, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(138, 43, 226, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(138, 43, 226, 0);
    }
}

.extra-post-like-btn.liked::before {
    content: '';
    position: absolute;
    border-radius: 50%;
    animation: like-burst 0.75s ease-out;
}

/* Animation de scale pour les boutons */
.extra-post-media-btn:active,
.extra-post-actions-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Animation de progression de chargement */
@keyframes loading-bar {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(100%);
    }
}

.extra-post-loading-bar {
    height: 3px;
    background: linear-gradient(90deg, transparent, #8a2be2, transparent);
    animation: loading-bar 1.5s infinite;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

/* Responsive animations */
@media (max-width: 768px) {
    .extra-post-item {
        animation: mobile-slide-up 0.4s ease-out;
    }
    
    @keyframes mobile-slide-up {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .extra-post-modal-content {
        animation: mobile-modal-appear 0.3s ease;
    }
    
    @keyframes mobile-modal-appear {
        from {
            opacity: 0;
            transform: translateY(50px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Animation de vibration pour les erreurs de formulaire */
@keyframes vibrate {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.extra-post-inputs textarea.error {
    animation: vibrate 0.5s ease;
    border-color: #dc3545 !important;
}

/* Animation de confirmation */
@keyframes checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.extra-post-checkmark {
    animation: checkmark 0.5s ease-out;
}

/* Animation de pulse pour les nouveaux éléments */
.extra-post-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(138, 43, 226, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(138, 43, 226, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(138, 43, 226, 0);
    }
}