/* Adaapt AI - Professional Animations & Color System */
/* Inspired by Glean.ai's sophisticated visual design */

/* Custom Properties for Consistent Animation System */
:root {
    /* Color Palette */
    --primary-blue: #3B82F6;
    --primary-purple: #8B5CF6;
    --accent-teal: #14B8A6;
    --accent-orange: #F59E0B;
    --gradient-primary: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    --gradient-secondary: linear-gradient(135deg, #14B8A6 0%, #3B82F6 100%);
    --gradient-accent: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
    
    /* Animation Timings */
    --animation-fast: 0.2s;
    --animation-normal: 0.3s;
    --animation-slow: 0.6s;
    --animation-extra-slow: 1.2s;
    
    /* Easing Functions */
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Global Animation Base */
* {
    transition: transform var(--animation-normal) var(--ease-in-out),
                opacity var(--animation-normal) var(--ease-in-out),
                box-shadow var(--animation-normal) var(--ease-in-out);
}

/* Sophisticated Gradient Animations */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.6), 0 0 40px rgba(139, 92, 246, 0.4);
    }
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@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 floatAnimation {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Animated Gradient Backgrounds */
.animated-gradient {
    background: linear-gradient(-45deg, #3B82F6, #8B5CF6, #14B8A6, #F59E0B);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

.animated-gradient-subtle {
    background: linear-gradient(-45deg, 
        rgba(59, 130, 246, 0.1), 
        rgba(139, 92, 246, 0.1), 
        rgba(20, 184, 166, 0.1), 
        rgba(245, 158, 11, 0.1));
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
}

/* Hero Section Animations */
.hero-title {
    animation: fadeInUp 0.8s var(--ease-bounce) 0.2s both;
}

.hero-subtitle {
    animation: fadeInUp 0.8s var(--ease-bounce) 0.4s both;
}

.hero-stats {
    animation: fadeInScale 0.6s var(--ease-bounce) 0.6s both;
}

.hero-stats > div {
    animation: fadeInUp 0.6s var(--ease-bounce) calc(0.8s + var(--delay, 0s)) both;
}

/* Card Animations */
.animated-card {
    transition: all var(--animation-normal) var(--ease-in-out);
    position: relative;
    overflow: hidden;
}

.animated-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
    z-index: 1;
}

.animated-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.2), 
                0 10px 20px rgba(139, 92, 246, 0.1);
}

.animated-card:hover::before {
    left: 100%;
}

/* Button Animations */
.animated-button {
    position: relative;
    overflow: hidden;
    transition: all var(--animation-normal) var(--ease-in-out);
    background: var(--gradient-primary);
    background-size: 200% 100%;
}

.animated-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.4s var(--ease-smooth);
    z-index: 1;
}

.animated-button:hover {
    background-position: 100% 0;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}

.animated-button:hover::before {
    left: 100%;
}

.animated-button:active {
    transform: translateY(0);
}

/* Icon Animations */
.animated-icon {
    transition: all var(--animation-normal) var(--ease-bounce);
}

.animated-icon:hover {
    transform: scale(1.1) rotate(5deg);
    color: var(--primary-purple);
}

/* Floating Elements */
.float-element {
    animation: floatAnimation 3s ease-in-out infinite;
}

.float-delayed {
    animation: floatAnimation 3s ease-in-out infinite;
    animation-delay: 1.5s;
}

/* Progress Bar Animation */
@keyframes progressFill {
    from {
        width: 0%;
    }
    to {
        width: var(--progress-width, 75%);
    }
}

.animated-progress {
    background: var(--gradient-primary);
    animation: progressFill 2s var(--ease-smooth) 0.5s both;
}

/* Text Highlight Animation */
@keyframes textHighlight {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 100% 0;
    }
}

.animated-text-highlight {
    background: linear-gradient(90deg, transparent 50%, rgba(59, 130, 246, 0.3) 50%);
    background-size: 200% 100%;
    animation: textHighlight 2s ease-in-out;
}

/* Loading Spinner */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-left: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Intersection Observer Animations */
.fade-in-observer {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s var(--ease-smooth);
}

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

.slide-in-left-observer {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s var(--ease-smooth);
}

.slide-in-left-observer.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right-observer {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s var(--ease-smooth);
}

.slide-in-right-observer.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in-observer {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s var(--ease-bounce);
}

.scale-in-observer.visible {
    opacity: 1;
    transform: scale(1);
}

/* Staggered Animation Delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Glow Effects */
.glow-blue {
    animation: pulseGlow 2s ease-in-out infinite;
}

.glow-on-hover:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

/* Gradient Text Animation */
@keyframes gradientText {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.animated-gradient-text {
    background: linear-gradient(-45deg, #3B82F6, #8B5CF6, #14B8A6, #F59E0B);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 4s ease infinite;
}

/* Morphing Shapes */
@keyframes morphShape {
    0%, 100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
    25% {
        border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
    }
    50% {
        border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
    }
    75% {
        border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
    }
}

.morphing-shape {
    background: var(--gradient-primary);
    animation: morphShape 8s ease-in-out infinite;
}

/* Number Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.counter-number {
    animation: countUp 0.8s var(--ease-bounce) both;
}

/* Particle Effect Background */
@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 1;
    }
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--gradient-primary);
    border-radius: 50%;
    animation: particleFloat 4s ease-in-out infinite;
}

.particle:nth-child(2n) {
    animation-delay: -2s;
    animation-duration: 6s;
}

.particle:nth-child(3n) {
    animation-delay: -1s;
    animation-duration: 5s;
}

/* Responsive Animation Adjustments */
@media (max-width: 768px) {
    .animated-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    .animated-button:hover {
        transform: translateY(-1px);
    }
    
    .float-element {
        animation-duration: 4s;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animated-gradient,
    .animated-gradient-subtle,
    .animated-gradient-text,
    .morphing-shape,
    .float-element,
    .particle {
        animation: none !important;
    }
}

/* Ripple Effect for Buttons */
@keyframes rippleAnimation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    animation: rippleAnimation 0.6s ease-out;
}

.ripple-effect {
    position: relative;
    overflow: hidden;
}

/* Magnetic Hover Effect */
.magnetic-hover {
    transition: transform 0.3s ease;
}

/* Tilt Hover Effect */
.tilt-hover {
    transition: transform 0.2s ease;
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}