﻿
/* Styles qui décrivent un changement sur une durée définie (fondu, glissement, pulse, zoom au chargement). */

/* 
   *** ANIMATION GLISSEMENT GENERIQUE ***
   APPLIQUEE A TOUTE LES SOUS-DIV DES BLOCS AVEC MENTION CLASS DRAG
   Avec gestion de la vitesse d'apparition : slow vs. speed
   Avec gestion de la direction : depuis la gauche ou la droite
   Avec possibilité de définir si l'animation est déclenché lors du chargement vs. viewport
*/

/* Exemple utilisation : 
    drag dragSpeed-left animation-is-visible (déclenchement immédiat - glissement depuis la gauche - vitesse rapide)
    drag dragSpeed-left viewport-condition (déclenchement après rendu viewport - glissement depuis la gauche - vitesse rapide)
    [...]
A noter : L'important est que l'élément parent ait toujours :
Soit : drag + [vitesse/direction] + animation-is-visible
Soit : drag + [vitesse/direction] + viewport-condition 

*/

/* ======================================================= */

/* Partie commune de l'animation */

/* État initial (hors viewport) : l'opacité est à 0 et l'élément est décalé */
.drag div {
    display: block;
    position: relative;
    opacity: 0;

    /* On utilise will-change sur l'état initial, pour ne pas ré-évaluer le layout */
    will-change: transform, opacity;

    /* Le transform initial est défini par les classes de direction/vitesse */

    overflow-x: hidden; /* C'est crucial pour masquer le contenu translateX() */
}

    /* GESTION DU DÉCALAGE (STAGGERING) */
    .drag div:nth-child(1) {
        --i: 0;
    }

    .drag div:nth-child(2) {
        --i: 1;
    }

    .drag div:nth-child(3) {
        --i: 2;
    }

    .drag div:nth-child(4) {
        --i: 3;
    }

    .drag div:nth-child(5) {
        --i: 4;
    }

    .drag div:nth-child(6) {
        --i: 5;
    }


/* ======================================================= */

/* Effet glissement LEFT
[ÉTAT ACTIVÉ (DANS VIEWPORT) - GÉRÉ PAR JS initié dans MainLayout] */

/* A. LEFT Vitesse RAPIDE++ */
.dragSpeed2-left.animation-is-visible div {
    animation: slideInLeft 0.5s cubic-bezier(0.68, -0.6, 0.32, 0.3) forwards;
    animation-delay: calc(0.1s + (var(--i, 0) * 0.1s));
}

/* B. LEFT Vitesse RAPIDE */
.dragSpeed-left.animation-is-visible div {
    animation: slideInLeft 1s cubic-bezier(0.68, -0.6, 0.32, 1.6) forwards;
    animation-delay: calc(0.1s + (var(--i, 0) * 0.5s));
}

/* C. LEFT Vitesse LENTE */
.dragSlow-left.animation-is-visible div {
    animation: slideInLeft 1s cubic-bezier(0.68, -0.6, 0.32, 0.6) forwards;
    animation-delay: calc(0s + (var(--i, 0) * 0.15s));
}

/* C. LEFT Cascade */
.dragCascadingleft.animation-is-visible div {
    /* Utilisation de la keyframe définie ci-dessus.
    Durée : 1s (comme votre transition JS)
    Timing Function : cubic-bezier(0.68, -0.55, 0.27, 1.55) (similaire à votre transition JS)
    */
    animation: slideInLeft 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;

    /* Gestion du délai en cascade :
    Votre JS utilisait 0s, 0.1s, 0.2s, 0.3s...
    Ici on utilise var(--i, 0) * 0.1s pour un pas de 0.1s
    */
    animation-delay: calc(0s + (var(--i, 0) * 0.1s));
}



/* KEYFRAMES : Effet LEFT */
@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-250px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}


/* ======================================================= */

/* Effet glissement RIGHT
[ÉTAT ACTIVÉ (DANS VIEWPORT) - GÉRÉ PAR JS initié dans MainLayout] */

/* A. RIGHT Vitesse RAPIDE */
.dragSpeed-right.animation-is-visible div {
    animation: slideInRight 1s cubic-bezier(0.68, -0.6, 0.32, 1.6) forwards;
    animation-delay: calc(0.1s + (var(--i, 0) * 0.5s));
}

/* B. RIGHT Vitesse LENTE */
.dragSlow-right.animation-is-visible div {
    animation: slideInRight 1s cubic-bezier(0.68, -0.6, 0.32, 0.6) forwards;
    animation-delay: calc(0s + (var(--i, 0) * 0.15s));
}

/* KEYFRAMES : Effet RIGHT */
@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(120%);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}


/* Variantes "viewport-condition" (déclenchement après rendu dans le viewport) :
   mêmes règles que ci-dessus, déclarées séparément pour respecter l'ordre de
   spécificité croissante (sélecteur à 3 classes après celui à 2 classes). */

.viewport-condition.dragSpeed2-left.animation-is-visible div {
    animation: slideInLeft 0.5s cubic-bezier(0.68, -0.6, 0.32, 0.3) forwards;
    animation-delay: calc(0.1s + (var(--i, 0) * 0.1s));
}

.viewport-condition.dragSpeed-left.animation-is-visible div {
    animation: slideInLeft 1s cubic-bezier(0.68, -0.6, 0.32, 1.6) forwards;
    animation-delay: calc(0.1s + (var(--i, 0) * 0.5s));
}

.viewport-condition.dragSlow-left.animation-is-visible div {
    animation: slideInLeft 1s cubic-bezier(0.68, -0.6, 0.32, 0.6) forwards;
    animation-delay: calc(0s + (var(--i, 0) * 0.15s));
}

.viewport-condition.dragCascadingleft.animation-is-visible div {
    animation: slideInLeft 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
    animation-delay: calc(0s + (var(--i, 0) * 0.1s));
}

.viewport-condition.dragSpeed-right.animation-is-visible div {
    animation: slideInRight 1s cubic-bezier(0.68, -0.6, 0.32, 1.6) forwards;
    animation-delay: calc(0.1s + (var(--i, 0) * 0.5s));
}

.viewport-condition.dragSlow-right.animation-is-visible div {
    animation: slideInRight 1s cubic-bezier(0.68, -0.6, 0.32, 0.6) forwards;
    animation-delay: calc(0s + (var(--i, 0) * 0.15s));
}


/* -------------------------------------- */

/* -------------------------------------- */

/* -------------------------------------- */



/* Définition de l'animation de Fondu-Zoom */

/* Application de l'animation au chargement */
.zoom-in {
    animation-name: fade-zoom-in;
    animation-duration: 0.6s; /* Durée plus lente pour l'effet de zoom */
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Courbe de vitesse très élégante (Smooth Easing) */
    animation-fill-mode: forwards;
}

@keyframes fade-zoom-in {
    0% {
        opacity: 0; /* Commence invisible */
        transform: scale(1.5); /* Commence avec un zoom de 50% */
    }

    100% {
        opacity: 1; /* Finit complètement visible */
        transform: scale(1); /* Finit à la taille normale */
    }
}


/* -------------------------------------- */

/* -------------------------------------- */

/* -------------------------------------- */


/* pulse */
.pulse-element {
    position: relative; /* Très important pour positionner l'overlay */
    overflow: hidden; /* Assure que rien ne dépasse */
}

/* Définition de l'animation */
@keyframes subtle-pulse {
    0%, 100% {
        opacity: 0; /* Commence invisible et finit invisible */
        visibility: hidden;
    }

    1% {
        visibility: visible; /* Devient visible juste avant de commencer */
    }

    10%, 90% {
        opacity: 0.4; /* Le point culminant de la pulsation */
    }

    50% {
        opacity: 0.1; /* Le point bas de la pulsation */
    }
}



/* Création du calque (overlay) */

/* Création du calque (overlay) */
.pulse-element::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #34495e;

    /* ⚠️ État Initial : Cacher le calque */
    opacity: 0;
    visibility: hidden;

    /* Application de l'animation */

    /* La propriété `none` fonctionne, mais l'effet est géré par les keyframes */
    animation: subtle-pulse 0.5s 1 ease-in-out forwards;

    /* 1s pour le cycle complet, jouée 2 fois */

    /* ⚠️ REMPLACEMENT :
     * 0.5s: durée
     * 2: nombre de répétitions
     * forwards: GARDE l'état final (100% du keyframe)
    */
}


/* -------------------------------------- */

/* -------------------------------------- */

/* -------------------------------------- */



/* ================================================= */

/* EFFET "DISTRIBUTION DE CARTES" — glissement décalé depuis la gauche entre les enfants directs
   de .stagger-reveal (ex: cartes de forfait, cartes de configuration...). Généralisé depuis
   l'effet posé initialement sur l'étape "revue finale" de l'onboarding entreprise
   (IdentityConfigPanel.razor/.razor.css, .onboarding-final-cards-reveal .config-card — même
   keyframe/easing/cadence) pour être réutilisable sur n'importe quel conteneur plutôt que
   dupliqué/scopé à une seule page à chaque nouvel usage. Purement CSS, joue immédiatement au
   montage — ne pas confondre avec .drag/.dragSpeed-.animation-is-visible ci-dessus, qui
   attendent elles un déclenchement viewport côté JS (MainLayout). */
.stagger-reveal > * {
    opacity: 0;
    animation: staggerSlideInLeft 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stagger-reveal > *:nth-child(1) {
    animation-delay: 0s;
}

.stagger-reveal > *:nth-child(2) {
    animation-delay: 0.15s;
}

.stagger-reveal > *:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-reveal > *:nth-child(4) {
    animation-delay: 0.45s;
}

.stagger-reveal > *:nth-child(5) {
    animation-delay: 0.6s;
}

.stagger-reveal > *:nth-child(6) {
    animation-delay: 0.75s;
}

@keyframes staggerSlideInLeft {
    from {
        opacity: 0;
        transform: translateX(-32px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/*************************************************  */

/* Barre de progression indéterminée (structure) */

/*************************************************  */

.progress-bar {
    position: relative;

    /* La largeur sera définie par le composant appelant (.loading-container) ou une autre classe de layout */
    height: 6px;
    background: var(--color-background-light); /* Couleur de fond grise (utilise la variable de Settings) */
    border-radius: var(--radius); /* Utilise la variable de Settings */
    overflow: hidden;
}

    /* Barre animée à l'intérieur de .progress-bar */
    .progress-bar .indeterminate {
        position: absolute;
        top: 0;
        left: -40%;
        width: 40%;
        height: 100%;

        /* Gradient spécifique pour ce style de progression */
        background: linear-gradient(90deg, #4facfe, #00f2fe);
        border-radius: var(--radius);
        animation: indeterminate 2s infinite ease-in-out, pulse 1.8s infinite ease-in-out;
    }

/* Animation de défilement */
@keyframes indeterminate {
    0% {
        left: -40%;
    }

    50% {
        left: 60%;
    }

    100% {
        left: 100%;
    }
}

/* Effet pulse doux */
@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}


/* -------------------------------------- */

/* -------------------------------------- */

/* -------------------------------------- */


/* Classes pour les flèches d'expansion (absorbe .arrow-icon) */
.arrow-icon-transition {
    width: 20px;
    height: 20px;
    margin-left: auto;
    transition: transform 0.3s ease;
}

    .arrow-icon-transition.rotated {
        transform: rotate(180deg);
    }



/*************************************  */
.testfilter {
    /* 1. Inverser (Noir devient Blanc) */

    /* 2. Appliquer une ombre portée (drop-shadow) pour le relief et le contraste */
    filter: invert(1) drop-shadow(3px 3px 6px rgb(0 0 0 / 60%)) drop-shadow(-1px -1px 2px rgb(0 0 0 / 40%));
    width: 80%; /* Pour garantir que le logo soit bien visible et responsive */
    max-width: 450px; /* Limiter la taille sur grand écran */
    height: auto;
    margin-bottom: 2rem;
}




/************************************  */

/* ANIMATION DU SCORE EspaceClient */

/* L'animation de pulsation et agrandissement */
@keyframes pulse-scale {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.2);
        filter: brightness(1.3);
        text-shadow: 0 0 10px rgb(255 255 255 / 80%);
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

.score-highlight {
    /* border: 2px solid red !important; */
    display: inline-block !important; /* CRUCIAL pour le transform scale */
    animation: pulse-scale 1.2s ease-in-out infinite;
    color: #22546f; /* Optionnel : une couleur dorée pendant l'animation */
}


/* Définition de l'animation */
@keyframes score-pulse {
    0% {
        opacity: 0; /* Commence invisible */
        visibility: hidden;
    }

    1% {
        visibility: visible; /* Devient visible juste avant de commencer */
    }

    10%, 90% {
        opacity: 0.4; /* Le point culminant de la pulsation */
    }

    50% {
        opacity: 0.1; /* Le point bas de la pulsation */
    }

    100% {
        opacity:0.8;
        visibility: visible;
    }
}

.score-highlight-load {
    display: inline-block !important; /* CRUCIAL pour le transform scale */

    /* animation: subtle-pulse 1.2s ease-in-out 2; */
    animation: score-pulse 1s 1 ease-in-out forwards;
    color: #22546f;
}

/***********************************************  */

/* @keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
} */