/* 
 * AdSync Enterprise - State-of-the-Art Animation Library
 * Next-generation animations for cutting-edge user experience
 */

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

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

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

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

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

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

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

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

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

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

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom cursor */
body {
    cursor: none;
}

.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, var(--color-primary), var(--color-secondary));
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease;
    mix-blend-mode: difference;
}

.custom-cursor.hover {
    transform: scale(2);
}

/* Animation Classes */
.animate-slide-up {
    opacity: 0;
    transform: translateY(60px);
    animation: slideInUp 0.8s ease-out both;
}

.animate-slide-left {
    opacity: 0;
    transform: translateX(-60px);
    animation: slideInLeft 0.8s ease-out both;
}

.animate-slide-right {
    opacity: 0;
    transform: translateX(60px);
    animation: slideInRight 0.8s ease-out both;
}

.animate-slide-down {
    opacity: 0;
    transform: translateY(-60px);
    animation: slideInDown 0.8s ease-out both;
}

.animate-fade-scale {
    opacity: 0;
    transform: scale(0.8);
    animation: fadeInScale 0.8s ease-out both;
}

.animate-rotate-in {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
    animation: rotateIn 0.8s ease-out both;
}

.animate-bounce-in {
    opacity: 0;
    transform: scale(0.3);
    animation: bounceIn 0.8s ease-out both;
}

/* Staggered delays */
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }
.animate-delay-6 { animation-delay: 0.6s; }
.animate-delay-7 { animation-delay: 0.7s; }
.animate-delay-8 { animation-delay: 0.8s; }

/* Enhanced Card Animations */
.card-animated {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

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

.card-animated:hover {
    transform: translateY(-12px) rotateX(5deg) rotateY(5deg);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.3), 0 0 0 1px rgba(59, 130, 246, 0.1);
}

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

/* Enhanced Button Effects */
.btn-enhanced {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-enhanced::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.6s, height 0.6s;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.btn-enhanced:active::before {
    width: 300px;
    height: 300px;
}

.btn-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.2);
}

.btn-enhanced span {
    position: relative;
    z-index: 1;
}

/* Animated Backgrounds */
.bg-animated-gradient {
    background: linear-gradient(-45deg, var(--color-primary), var(--color-secondary), #667eea, #764ba2);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.bg-floating-dots::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    animation: float 6s ease-in-out infinite;
}

/* Icon Animations */
.icon-animated {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.icon-animated:hover {
    transform: scale(1.1) rotateY(360deg);
    animation: glow 2s ease-in-out infinite;
}

/* Loading States */
.loading-fade {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.loading-fade.loaded {
    opacity: 1;
}

/* Shimmer Effect */
.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Responsive Animations */
@media (max-width: 768px) {
    .animate-slide-up,
    .animate-slide-left,
    .animate-slide-right,
    .animate-slide-down {
        animation-duration: 0.6s;
    }
    
    .card-animated:hover {
        transform: translateY(-8px);
    }
    
    .custom-cursor {
        display: none;
    }
    
    body {
        cursor: auto;
    }
}

/* 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;
        scroll-behavior: auto !important;
    }
    
    .custom-cursor {
        display: none;
    }
    
    body {
        cursor: auto;
    }
}
