/* 
 * ZENSTEPS UX Animations
 * CSS supplémentaire pour les améliorations UX
 * Version: 2.0
 */

/* Variables CSS pour les animations */
:root {
    --animation-duration: 0.6s;
    --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-color: rgba(59, 130, 246, 0.3);
    --glow-color: rgba(59, 130, 246, 0.4);
}

/* Animations de base */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px var(--glow-color);
    }
    50% {
        box-shadow: 0 0 40px var(--glow-color);
    }
}

/* Classes d'animation */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--animation-duration) var(--animation-easing);
}

.animate-on-scroll.animated-in {
    opacity: 1;
    transform: translateY(0);
}

.floating {
    animation: float 3s ease-in-out infinite;
}

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

/* Améliorations des cartes */
.card-enhanced {
    transition: all 0.3s var(--animation-easing);
    will-change: transform, box-shadow;
}

.card-enhanced:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px var(--shadow-color);
}

/* Boutons améliorés */
.btn-enhanced {
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--animation-easing);
    will-change: transform, box-shadow;
}

.btn-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.btn-enhanced:active {
    transform: translateY(0);
}

/* Inputs améliorés */
.input-enhanced {
    transition: all 0.3s var(--animation-easing);
    will-change: transform, box-shadow;
}

.input-enhanced:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Animations pour mobile */
@media (max-width: 768px) {
    .animate-on-scroll {
        transform: translateY(20px);
    }
    
    .card-enhanced:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    :root {
        --animation-duration: 0.4s;
    }
}

/* Mode réduit pour les animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}

/* Dark mode optimizations */
@media (prefers-color-scheme: dark) {
    :root {
        --shadow-color: rgba(59, 130, 246, 0.2);
        --glow-color: rgba(59, 130, 246, 0.3);
    }
}

/* Optimisations pour les performances */
.gpu-optimized {
    transform: translateZ(0);
    will-change: transform;
}

.performance-mode * {
    animation-duration: 0.3s !important;
    transition-duration: 0.3s !important;
}

/* Styles pour le mode hors ligne */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10001;
    transform: translateY(-100%);
    transition: transform 0.3s var(--animation-easing);
}

.offline-indicator.show {
    transform: translateY(0);
}

/* Loader personnalisé */
.zen-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: currentColor;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Focus amélioré pour l'accessibilité */
.focus-enhanced:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: translateX(400px);
    transition: all 0.3s var(--animation-easing);
    pointer-events: auto;
    cursor: pointer;
    max-width: 400px;
    font-family: 'Inter', sans-serif;
    color: white;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}
