/* 
 * Agent Showcase Animation Keyframes
 * Vigthoria Operator - JavaScript Animation Support
 * Date: June 5, 2025
 */

/* =================================================================
   LOADING STATE ANIMATIONS
   ================================================================= */

.loading-state {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.loaded-state {
    opacity: 1;
    transform: translateY(0);
}

.fully-loaded {
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

/* =================================================================
   INTERSECTION OBSERVER ANIMATIONS
   ================================================================= */

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Fade In Left Animation */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Fade In Right Animation */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Slide In Up Animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-slide-in-up {
    animation: slideInUp 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-3deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.animate-scale-in {
    animation: scaleIn 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* =================================================================
   ENHANCED VISIBILITY STATES
   ================================================================= */

.animation-visible {
    opacity: 1 !important;
    visibility: visible !important;
}

.animation-visible .agent-showcase-card {
    transform: none !important;
}

/* =================================================================
   PULSE GLOW ANIMATION
   ================================================================= */

@keyframes pulse-glow {
    0% {
        box-shadow: 
            0 0 20px rgba(0, 230, 118, 0.1),
            0 0 40px rgba(0, 230, 118, 0.05);
    }
    100% {
        box-shadow: 
            0 0 30px rgba(0, 230, 118, 0.2),
            0 0 60px rgba(0, 230, 118, 0.1);
    }
}

/* =================================================================
   PERFORMANCE OPTIMIZATION CLASSES
   ================================================================= */

.hardware-accelerated {
    transform: translateZ(0);
    will-change: transform, opacity;
    backface-visibility: hidden;
    perspective: 1000px;
}

.animation-optimized {
    contain: layout style paint;
    isolation: isolate;
}

/* =================================================================
   REDUCED MOTION SUPPORT
   ================================================================= */

.reduced-motion * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

.reduced-motion .rotating-circle {
    animation: none !important;
    transform: none !important;
}

.reduced-motion .animate-fade-in-up,
.reduced-motion .animate-fade-in-left,
.reduced-motion .animate-fade-in-right,
.reduced-motion .animate-slide-in-up,
.reduced-motion .animate-scale-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* =================================================================
   STAGGERED ANIMATION DELAYS
   ================================================================= */

.agent-showcase-card:nth-child(1) { animation-delay: 0ms; }
.agent-showcase-card:nth-child(2) { animation-delay: 100ms; }
.agent-showcase-card:nth-child(3) { animation-delay: 200ms; }
.agent-showcase-card:nth-child(4) { animation-delay: 300ms; }
.agent-showcase-card:nth-child(5) { animation-delay: 400ms; }
.agent-showcase-card:nth-child(6) { animation-delay: 500ms; }

/* =================================================================
   ENHANCED HOVER STATES WITH JS SUPPORT
   ================================================================= */

.agent-showcase-card.animation-visible:hover {
    transform: translateY(-12px) scale(1.03) translateZ(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 0 30px rgba(0, 230, 118, 0.2);
}

.agent-showcase-card.animation-visible:hover .rotating-circle {
    animation-duration: 1s;
    transform: scale(1.1);
}

/* =================================================================
   LOADING SPINNER FOR DYNAMIC CONTENT
   ================================================================= */

@keyframes agent-loading-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.agent-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 230, 118, 0.2);
    border-left-color: #00e676;
    border-radius: 50%;
    animation: agent-loading-spin 1s linear infinite;
}

/* =================================================================
   FOCUS STATES FOR ACCESSIBILITY
   ================================================================= */

.agent-showcase-card:focus-visible {
    outline: 3px solid #00e676;
    outline-offset: 2px;
    animation: focus-pulse 1.5s ease-in-out infinite;
}

@keyframes focus-pulse {
    0%, 100% { 
        outline-color: #00e676; 
        outline-width: 3px;
    }
    50% { 
        outline-color: rgba(0, 230, 118, 0.5); 
        outline-width: 5px;
    }
}

/* =================================================================
   HIGH CONTRAST MODE SUPPORT
   ================================================================= */

@media (prefers-contrast: high) {
    .agent-showcase-card {
        border: 2px solid currentColor;
        background: Canvas;
        color: CanvasText;
    }
    
    .animate-fade-in-up,
    .animate-fade-in-left,
    .animate-fade-in-right,
    .animate-slide-in-up,
    .animate-scale-in {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* =================================================================
   PRINT STYLES
   ================================================================= */

@media print {
    .agent-showcase-card {
        animation: none !important;
        transform: none !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .rotating-circle {
        animation: none !important;
        transform: none !important;
    }
}
