/* Animations CSS */

/* Animation de fondu à l'entrée */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Animation d'entrée par le haut */
@keyframes slideInTop {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animation d'entrée par le bas */
@keyframes slideInBottom {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animation d'entrée par la gauche */
@keyframes slideInLeft {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Animation d'entrée par la droite */
@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Animation de zoom */
@keyframes zoom {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animation de pulse */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Animation de rotation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Animation de shake */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

/* Animation de bounce */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-30px);
    }
    60% {
        transform: translateY(-15px);
    }
}

/* Classes d'animation pour les éléments */

/* Animation du titre principal */
.animate-title {
    opacity: 0;
    animation: slideInLeft var(--transition-medium) var(--easing) forwards;
    animation-delay: 0.2s;
}

/* Animation du sous-titre */
.animate-subtitle {
    opacity: 0;
    animation: slideInTop var(--transition-medium) var(--easing) forwards;
    animation-delay: 0.5s;
}

/* Animation du bouton */
.animate-button {
    opacity: 0;
    animation: fadeIn var(--transition-medium) var(--easing) forwards;
    animation-delay: 0.8s;
}

@keyframes buttonGlow {
    0% {
        box-shadow: 0 6px 15px rgba(124, 137, 255, 0.3);
    }
    50% {
        box-shadow: 0 8px 25px rgba(124, 137, 255, 0.5), 0 0 15px rgba(124, 137, 255, 0.3);
    }
    100% {
        box-shadow: 0 6px 15px rgba(124, 137, 255, 0.3);
    }
}

@keyframes buttonRipple {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

.btn {
    position: relative;
}

.btn:hover {
    animation: none;
}

.btn:active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: buttonRipple 0.8s ease-out;
    z-index: 0;
}

/* Animation des caractéristiques */
.animate-from-left {
    opacity: 0;
    transform: translateX(-100px);
}

.animate-from-right {
    opacity: 0;
    transform: translateX(100px);
}

.animate-from-bottom {
    opacity: 0;
    transform: translateY(50px);
}

/* Animation du formulaire */
.animate-form {
    opacity: 0;
    transform: translateY(30px);
}

/* Classe pour les animations déclenchées par le scroll */
.animated {
    transition: transform var(--transition-medium) var(--easing),
                opacity var(--transition-medium) var(--easing);
    opacity: 1;
    transform: translateX(0) translateY(0);
}

/* Animation de hover pour les images */
.img-hover {
    transition: transform var(--transition-medium) var(--easing);
}

.img-hover:hover {
    transform: scale(1.05);
}

/* Animation pour le loader */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--primary-color);
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: rotate 1s linear infinite;
}

/* Animation pour les notifications */
.notification {
    animation: slideInRight var(--transition-medium) var(--easing) forwards,
               fadeIn var(--transition-medium) var(--easing) forwards;
}

/* Animation pour le background du hero */
.hero::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    z-index: -1;
    background: linear-gradient(0deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    animation: rotate 15s linear infinite;
}

/* Animation pour la navigation mobile */
.mobile-nav-toggle {
    transition: transform var(--transition-fast) var(--easing);
}

.mobile-nav-toggle.active {
    transform: rotate(90deg);
}

/* Animation pour les éléments au scroll */
.reveal {
    position: relative;
    opacity: 0;
}

.reveal.active {
    opacity: 1;
}

.active.fade-bottom {
    animation: slideInBottom var(--transition-medium) var(--easing);
}

.active.fade-left {
    animation: slideInLeft var(--transition-medium) var(--easing);
}

.active.fade-right {
    animation: slideInRight var(--transition-medium) var(--easing);
}

/* Animations pour les éléments flottants du hero */
@keyframes float1 {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(2deg);
    }
    100% {
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes float2 {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(15px) rotate(-2deg);
    }
    100% {
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes float3 {
    0% {
        transform: translateX(0) translateY(0);
    }
    50% {
        transform: translateX(-10px) translateY(10px);
    }
    100% {
        transform: translateX(0) translateY(0);
    }
}

@keyframes glow {
    0% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(0.9);
    }
    50% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* Appliquer les animations aux éléments flottants */
.dashboard {
    animation: float1 6s ease-in-out infinite;
}

.chart {
    animation: float2 8s ease-in-out infinite;
}

.notification {
    animation: float3 5s ease-in-out infinite;
}

.circle-1 {
    animation: rotate 15s linear infinite;
}

.circle-2 {
    animation: rotate 20s linear reverse infinite;
}

.dots-1 {
    animation: float2 9s ease-in-out infinite;
}

.dots-2 {
    animation: float1 7s ease-in-out infinite;
}

.glow-effect {
    animation: glow 8s ease-in-out infinite;
}
