/* Animations et effets avancés pour AkheaneMessage */

/* Animation d'apparition des cartes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-card {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

/* Effet de pulse pour les étoiles */
@keyframes starPulse {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Animation de scintillement */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.6;
    }
    25% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    75% {
        opacity: 0.9;
    }
}

/* Effet de dégradé animé pour le titre */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.header h1 {
    background: linear-gradient(-45deg, #ffffff, #e0e0e0, #ffffff, #f0f0f0);
    background-size: 400% 400%;
    animation: gradientShift 4s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Effet de typing pour le texte de recherche */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Animation fluide pour la modal */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.message-detail.visible .message-content {
    animation: modalSlideIn 0.3s ease-out;
}

/* Effet de particules flottantes */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Hover effects améliorés */
.message-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.message-card:hover::after {
    transform: translateX(100%);
}

/* Animation des tags */
.tag {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.message-card:hover .tag::before {
    left: 100%;
}

/* Effet de glow pour les éléments interactifs */
.search-container input:focus,
.message-card:hover,
.close-btn:hover {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* Animation de loading avancée */
.loading-spinner {
    position: relative;
}

.loading-spinner::before,
.loading-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.loading-spinner::before {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    top: -5px;
    left: -5px;
}

.loading-spinner::after {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid rgba(255, 255, 255, 0.6);
    top: 5px;
    left: 5px;
    animation-direction: reverse;
}

/* Transitions fluides pour tous les éléments */
* {
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}

/* Media queries pour les animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Animation d'apparition retardée pour les éléments */
.message-card:nth-child(1) { animation-delay: 0.1s; }
.message-card:nth-child(2) { animation-delay: 0.2s; }
.message-card:nth-child(3) { animation-delay: 0.3s; }
.message-card:nth-child(4) { animation-delay: 0.4s; }
.message-card:nth-child(5) { animation-delay: 0.5s; }
.message-card:nth-child(6) { animation-delay: 0.6s; }

/* Effet de particules pour le fond */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(odd) {
    animation-delay: -3s;
}

.particle:nth-child(even) {
    animation-direction: reverse;
}