
/* =========================================================
   COEURS BLOG — ANIMATIONS
   static/css/animations.css
   ========================================================= */


/* =========================================================
   1. ANIMATIONS DE BASE
   ========================================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-25px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(25px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.7);
    }

    70% {
        transform: scale(1.05);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}


/* =========================================================
   2. ANIMATIONS ROUGES / LUMIÈRE
   ========================================================= */

@keyframes redGlow {
    0% {
        box-shadow: 0 0 0 rgba(220, 38, 38, 0);
    }

    50% {
        box-shadow: 0 0 25px rgba(220, 38, 38, 0.35);
    }

    100% {
        box-shadow: 0 0 0 rgba(220, 38, 38, 0);
    }
}

@keyframes redPulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.04);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes glowText {
    0% {
        text-shadow: 0 0 0 rgba(239, 68, 68, 0);
    }

    50% {
        text-shadow: 0 0 15px rgba(239, 68, 68, 0.45);
    }

    100% {
        text-shadow: 0 0 0 rgba(239, 68, 68, 0);
    }
}


/* =========================================================
   3. APPARITION DES ÉLÉMENTS
   ========================================================= */

.animate-fade-in {
    animation: fadeIn 0.5s ease both;
}

.animate-fade-up {
    animation: fadeInUp 0.6s ease both;
}

.animate-fade-down {
    animation: fadeInDown 0.6s ease both;
}

.animate-fade-left {
    animation: fadeInLeft 0.6s ease both;
}

.animate-fade-right {
    animation: fadeInRight 0.6s ease both;
}

.animate-scale {
    animation: scaleIn 0.5s ease both;
}

.animate-pop {
    animation: popIn 0.5s ease both;
}


/* =========================================================
   4. APPARITION PROGRESSIVE DES CARTES
   ========================================================= */

.post-card,
.article-card,
.event-card,
.challenge-card,
.question-card,
.discussion-card,
.photo-card,
.badge-card,
.ranking-item {
    animation: fadeInUp 0.55s ease both;
}


/* Décalage progressif */

.post-card:nth-child(2),
.article-card:nth-child(2),
.event-card:nth-child(2),
.challenge-card:nth-child(2),
.question-card:nth-child(2),
.discussion-card:nth-child(2),
.photo-card:nth-child(2),
.badge-card:nth-child(2),
.ranking-item:nth-child(2) {
    animation-delay: 0.08s;
}

.post-card:nth-child(3),
.article-card:nth-child(3),
.event-card:nth-child(3),
.challenge-card:nth-child(3),
.question-card:nth-child(3),
.discussion-card:nth-child(3),
.photo-card:nth-child(3),
.badge-card:nth-child(3),
.ranking-item:nth-child(3) {
    animation-delay: 0.16s;
}

.post-card:nth-child(4),
.article-card:nth-child(4),
.event-card:nth-child(4),
.challenge-card:nth-child(4),
.question-card:nth-child(4),
.discussion-card:nth-child(4),
.photo-card:nth-child(4),
.badge-card:nth-child(4),
.ranking-item:nth-child(4) {
    animation-delay: 0.24s;
}

.post-card:nth-child(5),
.article-card:nth-child(5),
.event-card:nth-child(5),
.challenge-card:nth-child(5),
.question-card:nth-child(5),
.discussion-card:nth-child(5),
.photo-card:nth-child(5),
.badge-card:nth-child(5),
.ranking-item:nth-child(5) {
    animation-delay: 0.32s;
}

.post-card:nth-child(6),
.article-card:nth-child(6),
.event-card:nth-child(6),
.challenge-card:nth-child(6),
.question-card:nth-child(6),
.discussion-card:nth-child(6),
.photo-card:nth-child(6),
.badge-card:nth-child(6),
.ranking-item:nth-child(6) {
    animation-delay: 0.40s;
}


/* =========================================================
   5. HOVER DES CARTES
   ========================================================= */

.post-card,
.article-card,
.event-card,
.challenge-card,
.question-card,
.discussion-card,
.photo-card,
.badge-card {
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.post-card:hover,
.article-card:hover,
.event-card:hover,
.challenge-card:hover,
.question-card:hover,
.discussion-card:hover,
.photo-card:hover,
.badge-card:hover {
    transform: translateY(-5px);
}


/* =========================================================
   6. BOUTONS
   ========================================================= */

button,
.btn,
.nav-button,
.action-button {
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease;
}

button:hover,
.btn:hover,
.nav-button:hover,
.action-button:hover {
    transform: translateY(-2px);
}

button:active,
.btn:active,
.nav-button:active,
.action-button:active {
    transform: translateY(0) scale(0.98);
}


/* =========================================================
   7. EFFET CLICK
   ========================================================= */

.click-effect {
    animation: popIn 0.3s ease;
}


/* =========================================================
   8. LIKE
   ========================================================= */

.like-button,
.like-question,
.answer-like,
.post-like,
.article-like,
.photo-like {
    transition:
        transform 0.2s ease,
        color 0.2s ease;
}

.like-button:hover,
.like-question:hover,
.answer-like:hover,
.post-like:hover,
.article-like:hover,
.photo-like:hover {
    transform: scale(1.08);
}

.like-button:active,
.like-question:active,
.answer-like:active,
.post-like:active,
.article-like:active,
.photo-like:active {
    transform: scale(0.9);
}

.like-button.liked,
.like-question.liked,
.answer-like.liked,
.post-like.liked,
.article-like.liked,
.photo-like.liked {
    animation: popIn 0.35s ease;
}


/* =========================================================
   9. LOGO
   ========================================================= */

.logo {
    transition:
        transform 0.25s ease,
        filter 0.25s ease;
}

.logo:hover {
    transform: scale(1.04);
    filter: drop-shadow(
        0 0 10px rgba(239, 68, 68, 0.35)
    );
}


/* =========================================================
   10. AVATARS
   ========================================================= */

.avatar,
.user-avatar,
.profile-avatar {
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.avatar:hover,
.user-avatar:hover,
.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow:
        0 0 18px rgba(239, 68, 68, 0.3);
}


/* =========================================================
   11. BADGES
   ========================================================= */

.badge-card:hover .badge-icon,
.badge-item:hover .badge-icon {
    animation: redPulse 0.8s ease;
}


/* =========================================================
   12. NOTIFICATIONS
   ========================================================= */

.notification-card {
    animation: fadeInRight 0.45s ease both;
}

.notification-card.unread {
    animation:
        fadeInRight 0.45s ease both,
        redGlow 2s ease-in-out infinite;
}


/* =========================================================
   13. FLASH MESSAGES
   ========================================================= */

.flash-message {
    animation: fadeInDown 0.45s ease both;
}

.flash-message.hide {
    animation: fadeInUp 0.3s ease both;
}


/* =========================================================
   14. TOASTS
   ========================================================= */

.toast,
.share-toast,
.success-toast {
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.toast.show,
.share-toast.show,
.success-toast.show {
    animation: fadeInUp 0.35s ease both;
}


/* =========================================================
   15. MODALES
   ========================================================= */

.modal-overlay,
.modal-backdrop {
    animation: fadeIn 0.25s ease both;
}

.modal,
.modal-content {
    animation: scaleIn 0.3s ease both;
}


/* =========================================================
   16. MENU MOBILE
   ========================================================= */

.mobile-menu {
    transition:
        transform 0.3s ease,
        opacity 0.3s ease;
}

.mobile-menu.active {
    animation: fadeInRight 0.3s ease both;
}


/* =========================================================
   17. BARRES DE PROGRESSION
   ========================================================= */

.progress-fill {
    transition:
        width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}


/* =========================================================
   18. COMPTEURS / XP
   ========================================================= */

.stat-number,
.xp-value,
.level-number {
    transition:
        transform 0.25s ease,
        color 0.25s ease;
}

.stat-number:hover,
.xp-value:hover,
.level-number:hover {
    transform: scale(1.04);
}


/* =========================================================
   19. LIENS
   ========================================================= */

a {
    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}


/* =========================================================
   20. IMAGES
   ========================================================= */

img {
    transition:
        transform 0.35s ease,
        filter 0.35s ease;
}

.article-card img,
.photo-card img,
.event-card img {
    overflow: hidden;
}

.article-card:hover img,
.photo-card:hover img,
.event-card:hover img {
    transform: scale(1.03);
}


/* =========================================================
   21. LOADING
   ========================================================= */

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    animation: spin 0.8s linear infinite;
}


/* =========================================================
   22. PULSE
   ========================================================= */

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.75;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.pulse {
    animation: pulse 1.8s ease-in-out infinite;
}


/* =========================================================
   23. CURSEUR / ÉLÉMENTS INTERACTIFS
   ========================================================= */

button,
a,
[role="button"],
.clickable {
    -webkit-tap-highlight-color: transparent;
}


/* =========================================================
   24. PROPRIÉTAIRE — IDENTITÉ CORRAZ0N
   ========================================================= */

/*
   IMPORTANT :

   Ces classes sont réservées au contenu identifié côté serveur
   comme appartenant au compte propriétaire "Corraz0n".

   Elles ne donnent aucun droit supplémentaire à un utilisateur.
   Elles servent uniquement à l'affichage.
*/


/* ---------------------------------------------------------
   Nom du propriétaire
   --------------------------------------------------------- */

.owner-profile-name,
.owner-user .profile-name {
    color: #ff1744 !important;
    font-weight: 900;

    text-shadow:
        0 0 7px rgba(255, 23, 68, 0.45),
        0 0 16px rgba(255, 23, 68, 0.25);

    animation:
        ownerNameGlow 2.2s ease-in-out infinite;
}


/* ---------------------------------------------------------
   Couronne
   --------------------------------------------------------- */

.owner-crown {
    display: inline-block;
    margin-left: 3px;

    filter:
        drop-shadow(0 0 5px rgba(255, 210, 60, 0.65));

    animation:
        ownerCrownFloat 1.8s ease-in-out infinite;
}


/* ---------------------------------------------------------
   Badge PROPRIÉTAIRE
   --------------------------------------------------------- */

.owner-profile-badge,
.owner-badge-text {
    display: inline-block;

    color: #ff304f;

    font-size: 8px;
    font-weight: 900;
    letter-spacing: 1.2px;
    line-height: 1;

    text-transform: uppercase;

    text-shadow:
        0 0 6px rgba(255, 48, 79, 0.55);

    animation:
        ownerBadgeGlow 1.7s ease-in-out infinite;
}


/* =========================================================
   25. ANIMATIONS DU PROFIL PROPRIÉTAIRE
   ========================================================= */

@keyframes ownerNameGlow {
    0%,
    100% {
        color: #ff1744;
        transform: translateY(0);

        text-shadow:
            0 0 7px rgba(255, 23, 68, 0.4),
            0 0 15px rgba(255, 23, 68, 0.2);
    }

    50% {
        color: #ff365c;
        transform: translateY(-1px);

        text-shadow:
            0 0 10px rgba(255, 23, 68, 0.75),
            0 0 24px rgba(255, 23, 68, 0.4);
    }
}

@keyframes ownerCrownFloat {
    0%,
    100% {
        transform: translateY(0) rotate(-3deg) scale(1);
    }

    50% {
        transform: translateY(-2px) rotate(3deg) scale(1.08);
    }
}

@keyframes ownerBadgeGlow {
    0%,
    100% {
        opacity: 0.72;

        text-shadow:
            0 0 5px rgba(255, 48, 79, 0.35);
    }

    50% {
        opacity: 1;

        text-shadow:
            0 0 8px rgba(255, 48, 79, 0.75),
            0 0 16px rgba(255, 48, 79, 0.35);
    }
}


/* =========================================================
   26. TEXTE DU PROPRIÉTAIRE
   ========================================================= */

/*
   Cette classe sera ajoutée par le système lorsque le contenu
   appartient réellement au compte Corraz0n.

   animations.js s'occupera ensuite de transformer les lettres
   pour leur donner l'animation continue.
*/

.owner-content,
.owner-rainbow-text {
    position: relative;

    font-weight: 700;

    color: #ff1744;

    text-shadow:
        0 0 5px rgba(255, 23, 68, 0.35);

    animation:
        ownerContentGlow 3s ease-in-out infinite;
}


/* Chaque lettre animée par animations.js */

.owner-rainbow-letter {
    display: inline-block;

    will-change:
        transform,
        color,
        text-shadow;

    animation:
        ownerLetterWave 2.8s ease-in-out infinite;
}


/* ---------------------------------------------------------
   Légère pulsation globale du texte propriétaire
   --------------------------------------------------------- */

@keyframes ownerContentGlow {
    0%,
    100% {
        text-shadow:
            0 0 4px rgba(255, 23, 68, 0.25);
    }

    50% {
        text-shadow:
            0 0 8px rgba(255, 23, 68, 0.55),
            0 0 16px rgba(255, 23, 68, 0.2);
    }
}


/* ---------------------------------------------------------
   Mouvement des lettres
   --------------------------------------------------------- */

@keyframes ownerLetterWave {
    0%,
    100% {
        transform:
            translateY(0)
            rotate(0deg)
            scale(1);
    }

    25% {
        transform:
            translateY(-1px)
            rotate(-1deg)
            scale(1.01);
    }

    50% {
        transform:
            translateY(1px)
            rotate(1deg)
            scale(1.02);
    }

    75% {
        transform:
            translateY(-1px)
            rotate(-1deg)
            scale(1.01);
    }
}


/* =========================================================
   27. EFFET ARC-EN-CIEL DES LETTRES
   ========================================================= */

/*
   Le dégradé est appliqué aux lettres propriétaires.
   animations.js donnera un délai différent à chaque lettre,
   ce qui créera une vague continue.
*/

.owner-rainbow-letter {
    background:
        linear-gradient(
            90deg,
            #ff1744,
            #ff7a00,
            #ffe600,
            #39ff14,
            #00e5ff,
            #2979ff,
            #d500f9,
            #ff1744
        );

    background-size: 300% 100%;

    -webkit-background-clip: text;
    background-clip: text;

    -webkit-text-fill-color: transparent;

    animation:
        ownerRainbowMove 3.2s linear infinite,
        ownerLetterWave 2.8s ease-in-out infinite;
}

@keyframes ownerRainbowMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}


/* =========================================================
   28. PROPRIÉTAIRE — CONTENEURS
   ========================================================= */

.owner-content {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.owner-content .owner-rainbow-letter {
    position: relative;
}


/* =========================================================
   29. AVATAR DU PROPRIÉTAIRE
   ========================================================= */

.owner-user .profile-avatar,
.owner-avatar {
    border-color: #ff1744 !important;

    box-shadow:
        0 0 8px rgba(255, 23, 68, 0.4),
        0 0 20px rgba(255, 23, 68, 0.2);

    animation:
        ownerAvatarGlow 2.4s ease-in-out infinite;
}

@keyframes ownerAvatarGlow {
    0%,
    100% {
        box-shadow:
            0 0 8px rgba(255, 23, 68, 0.35),
            0 0 18px rgba(255, 23, 68, 0.15);
    }

    50% {
        box-shadow:
            0 0 12px rgba(255, 23, 68, 0.65),
            0 0 28px rgba(255, 23, 68, 0.3);
    }
}


/* =========================================================
   30. IDENTITÉ PROPRIÉTAIRE SUR LES CARTES
   ========================================================= */

.owner-card {
    position: relative;

    border-color:
        rgba(255, 23, 68, 0.45);

    box-shadow:
        0 0 15px rgba(255, 23, 68, 0.08);

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.owner-card:hover {
    border-color:
        rgba(255, 23, 68, 0.75);

    box-shadow:
        0 0 25px rgba(255, 23, 68, 0.16);
}


/* =========================================================
   31. ACCESSIBILITÉ
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

