/* Animations et styles avancés pour JURISMODERNA */

/* Animations de base */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

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

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

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

@keyframes glow {
    from {
        filter: drop-shadow(0 0 20px rgba(74, 144, 226, 0.5));
    }
    to {
        filter: drop-shadow(0 0 30px rgba(74, 144, 226, 0.8));
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Classes d'animation */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.fade-in-down {
    animation: fadeInDown 0.8s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

.scale-in {
    animation: scaleIn 0.6s ease-out;
}

.bounce-in {
    animation: bounce 1s ease-out;
}

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

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

/* Animations pour les éléments interactifs */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.4);
}

.hover-scale {
    transition: transform 0.3s ease;
}

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

/* Effets de shimmer pour les boutons */
.shimmer-effect {
    position: relative;
    overflow: hidden;
}

.shimmer-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 2s infinite;
}

/* Animations pour la navigation */
.navbar-slide-down {
    animation: slideInDown 0.5s ease-out;
}

/* Effets de particules pour le background */
.particles-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.particles-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(74, 144, 226, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(100, 181, 246, 0.1) 0%, transparent 50%);
    animation: float 20s infinite linear;
}

@keyframes float {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Animations pour les cartes de service */
.service-card-entrance {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease;
}

.service-card-entrance.animate {
    opacity: 1;
    transform: translateY(0);
}

.service-card-entrance:nth-child(1) { transition-delay: 0.1s; }
.service-card-entrance:nth-child(2) { transition-delay: 0.2s; }
.service-card-entrance:nth-child(3) { transition-delay: 0.3s; }
.service-card-entrance:nth-child(4) { transition-delay: 0.4s; }
.service-card-entrance:nth-child(5) { transition-delay: 0.5s; }
.service-card-entrance:nth-child(6) { transition-delay: 0.6s; }

/* Animation de typing pour les titres */
.typing-effect {
    overflow: hidden;
    border-right: 3px solid rgba(74, 144, 226, 0.8);
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: rgba(74, 144, 226, 0.8);
    }
}

/* Effets pour les popups */
.popup-entrance {
    animation: scaleIn 0.4s ease-out;
}

.popup-exit {
    animation: scaleIn 0.4s ease-out reverse;
}

/* Animations pour les indicateurs de slider */
.indicator-pulse {
    animation: pulse 2s infinite ease-in-out;
}

/* Effet de parallaxe simple */
.parallax-element {
    transform: translateZ(0);
    transition: transform 0.1s ease-out;
}

/* Animations pour les éléments de formulaire */
.form-focus-effect {
    position: relative;
}

.form-focus-effect::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #4a90e2, #64b5f6);
    transition: width 0.3s ease;
}

.form-focus-effect:focus-within::after {
    width: 100%;
}

/* Animations au scroll */
.scroll-fade {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.scroll-fade.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Effets de texte lumineux */
.neon-text {
    text-shadow: 
        0 0 5px rgba(74, 144, 226, 0.8),
        0 0 10px rgba(74, 144, 226, 0.6),
        0 0 15px rgba(74, 144, 226, 0.4);
    animation: neonFlicker 2s infinite alternate ease-in-out;
}

@keyframes neonFlicker {
    0%, 100% {
        text-shadow: 
            0 0 5px rgba(74, 144, 226, 0.8),
            0 0 10px rgba(74, 144, 226, 0.6),
            0 0 15px rgba(74, 144, 226, 0.4);
    }
    50% {
        text-shadow: 
            0 0 10px rgba(74, 144, 226, 1),
            0 0 20px rgba(74, 144, 226, 0.8),
            0 0 30px rgba(74, 144, 226, 0.6);
    }
}

/* Animations responsives */
@media (max-width: 768px) {
    .fade-in-up,
    .slide-in-left,
    .slide-in-right {
        animation-duration: 0.5s;
    }
    
    .typing-effect {
        animation-duration: 2s;
    }
    
    .service-card-entrance {
        transition-duration: 0.4s;
    }
}

/* Mode réduit pour les animations (accessibilité) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .particles-bg::before {
        animation: none;
    }
    
    .typing-effect {
        animation: none;
        border-right: none;
        white-space: normal;
    }
}