/* ==========================================================================
   ANIMATIONS CSS - SYCAD Formations IA
   Keyframes et animations
   ========================================================================== */

/* === KEYFRAMES === */

/* Shine Effect (Gradient Text) */
@keyframes shine {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Float Effect */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Pulse Effect */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Glow Pulse */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px var(--primary-cyan),
                    0 0 40px var(--primary-cyan);
    }
    50% {
        box-shadow: 0 0 30px var(--primary-cyan),
                    0 0 60px var(--primary-cyan),
                    0 0 80px var(--primary-cyan);
    }
}

/* Rotate Gradient */
@keyframes rotate-gradient {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bounce In */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* Slide Down */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* === CLASSES D'ANIMATION === */

/* Fade Animations */
.fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in-down {
    animation: fadeInDown 0.6s ease-out forwards;
}

.fade-in-left {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.fade-in-right {
    animation: fadeInRight 0.6s ease-out forwards;
}

/* Scale Animation */
.scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

/* Bounce Animation */
.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* === STAGGER ANIMATIONS === */
.formation-card:nth-child(1) {
    animation-delay: 0s;
}

.formation-card:nth-child(2) {
    animation-delay: 0.1s;
}

.formation-card:nth-child(3) {
    animation-delay: 0.2s;
}

.formation-card:nth-child(4) {
    animation-delay: 0.3s;
}

.formation-card:nth-child(5) {
    animation-delay: 0.4s;
}

.formation-card:nth-child(6) {
    animation-delay: 0.5s;
}

.formation-card:nth-child(7) {
    animation-delay: 0.6s;
}

.formation-card:nth-child(8) {
    animation-delay: 0.7s;
}

.formation-card:nth-child(9) {
    animation-delay: 0.8s;
}

/* === HOVER EFFECTS === */

/* Ripple Effect on Click */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
}

/* Glow on Hover */
.glow-on-hover:hover {
    animation: glow-pulse 2s ease-in-out infinite;
}

/* === LOADING ANIMATIONS === */

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-card {
    padding: var(--spacing-xl);
    background: var(--card-glass);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
}

.skeleton-img {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
    border-radius: var(--radius-md);
}

.skeleton-title {
    height: 24px;
    margin-bottom: var(--spacing-sm);
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 16px;
    margin-bottom: var(--spacing-sm);
    border-radius: var(--radius-sm);
}

.skeleton-btn {
    height: 44px;
    margin-top: var(--spacing-lg);
    border-radius: var(--radius-xl);
}

/* === SCROLL ANIMATIONS === */

/* Parallax Effect */
.parallax {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* === TRANSITION CLASSES === */

/* Smooth Transitions */
.transition-all {
    transition: all var(--transition-smooth);
}

.transition-transform {
    transition: transform var(--transition-smooth);
}

.transition-opacity {
    transition: opacity var(--transition-base);
}

.transition-colors {
    transition: color var(--transition-base),
                background-color var(--transition-base),
                border-color var(--transition-base);
}

/* === UTILITY ANIMATIONS === */

/* Spin (pour les loaders) */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Ping Effect */
@keyframes ping {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

.ping {
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* === ENTRANCE ANIMATIONS === */

/* Header Slide Down */
.header {
    animation: slideDown 0.6s ease-out;
}

/* Hero Content Fade In */
.hero-content > * {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero-content > *:nth-child(1) {
    animation-delay: 0.2s;
}

.hero-content > *:nth-child(2) {
    animation-delay: 0.4s;
}

.hero-content > *:nth-child(3) {
    animation-delay: 0.6s;
}

.hero-content > *:nth-child(4) {
    animation-delay: 0.8s;
}

.hero-content > *:nth-child(5) {
    animation-delay: 1s;
}

/* === INTERACTIONS === */

/* Button Hover Effects */
button,
.btn-primary,
.btn-secondary,
.btn-interest {
    will-change: transform;
}

/* Card Hover Effects */
.formation-card,
.feature-item {
    will-change: transform, box-shadow;
}

/* === PERFORMANCE OPTIMIZATIONS === */

/* GPU Acceleration */
.transform-gpu {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .parallax {
        transform: none !important;
    }

    .gradient-text {
        animation: none;
        background: var(--primary-cyan);
        background-clip: text;
        -webkit-background-clip: text;
    }
}

/* === SPECIAL EFFECTS === */

/* Glitch Effect (optionnel) */
@keyframes glitch {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0);
    }
}

/* Tilt Effect on Hover */
.tilt:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
    transition: transform 0.3s ease;
}

/* === NUMBER COUNTER ANIMATION === */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-number {
    animation: countUp 0.8s ease-out;
}

/* === MODAL ANIMATIONS === */
.modal-overlay.active .modal-container {
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === CAROUSEL 3D GLOW === */
@keyframes carousel-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 217, 225, 0.3),
                    0 8px 32px rgba(0, 0, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 217, 225, 0.5),
                    0 8px 32px rgba(0, 0, 0, 0.4);
    }
}

.carousel-3d-item.active img {
    animation: carousel-glow 3s ease-in-out infinite;
}

/* === FAQ ACCORDION ANIMATION === */
.faq-answer {
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
}

.faq-item:not(.active) .faq-answer {
    opacity: 0;
}

.faq-item.active .faq-answer {
    opacity: 1;
}
