/* ===== KEYFRAME ANIMATIONS ===== */

/* Floating animation for particles and elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Drift animation for gradient orbs */
@keyframes drift {
    0%, 100% {
        transform: translate(0px, 0px) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

/* Pulse animation for icons */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Spin animation for loading and icons */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Gradient shift animation */
@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Slide up animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide down animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide in from left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade out animation */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scale out animation */
@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Bounce animation */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -10px, 0);
    }
    70% {
        transform: translate3d(0, -5px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* Shake animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-3px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(3px);
    }
}

/* Glow animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
    }
}

/* Typing animation */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Blink animation for cursor */
@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Zoom in animation */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
    }
    to {
        transform: scale(1);
    }
}

/* Zoom out animation */
@keyframes zoomOut {
    from {
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(0.3);
    }
    to {
        opacity: 0;
        transform: scale(0.3);
    }
}

/* Flip animation */
@keyframes flip {
    from {
        transform: perspective(400px) rotateY(-90deg);
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotateY(-10deg);
    }
    70% {
        transform: perspective(400px) rotateY(10deg);
    }
    to {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
    }
}

/* Progress bar animation */
@keyframes progressBar {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

/* Ripple effect animation */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Loading dots animation */
@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== UTILITY ANIMATION CLASSES ===== */

/* Fade animations */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.fade-out {
    animation: fadeOut 0.5s ease-out;
}

/* Slide animations */
.slide-up {
    animation: slideUp 0.5s ease-out;
}

.slide-down {
    animation: slideDown 0.5s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

/* Scale animations */
.scale-in {
    animation: scaleIn 0.3s ease-out;
}

.scale-out {
    animation: scaleOut 0.3s ease-out;
}

/* Bounce animation */
.bounce {
    animation: bounce 1s ease-out;
}

/* Shake animation */
.shake {
    animation: shake 0.5s ease-out;
}

/* Glow animation */
.glow {
    animation: glow 2s ease-in-out infinite;
}

/* Spin animation */
.spin {
    animation: spin 1s linear infinite;
}

/* Pulse animation */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Float animation */
.float {
    animation: float 3s ease-in-out infinite;
}

/* Zoom animations */
.zoom-in {
    animation: zoomIn 0.5s ease-out;
}

.zoom-out {
    animation: zoomOut 0.5s ease-out;
}

/* Flip animation */
.flip {
    animation: flip 0.6s ease-out;
}

/* ===== HOVER EFFECTS ===== */

/* Hover lift effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Hover scale effect */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Hover glow effect */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

/* Hover rotate effect */
.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* ===== ENTRANCE ANIMATIONS ===== */

/* Stagger animation for multiple elements */
.stagger-fade-in > * {
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
}

.stagger-fade-in > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-fade-in > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-fade-in > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-fade-in > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-fade-in > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-fade-in > *:nth-child(6) { animation-delay: 0.6s; }

/* ===== LOADING ANIMATIONS ===== */

/* Loading dots */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots > span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: loadingDots 1.4s ease-in-out infinite both;
}

.loading-dots > span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots > span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots > span:nth-child(3) { animation-delay: 0s; }

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    animation: progressBar 2s ease-out;
}

/* ===== SCROLL ANIMATIONS ===== */

/* Scroll reveal effect */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===== BUTTON RIPPLE EFFECT ===== */

.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::before {
    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%);
    transition: width 0.6s, height 0.6s;
}

.ripple-effect:active::before {
    width: 300px;
    height: 300px;
}

/* ===== TEXT ANIMATIONS ===== */

/* Typewriter effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid rgba(255, 255, 255, 0.75);
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.1em;
    animation: 
        typing 3.5s steps(40, end),
        blink 0.75s step-end infinite;
}

/* Gradient text animation */
.animated-gradient-text {
    background: linear-gradient(-45deg, #6366f1, #8b5cf6, #06b6d4, #10b981);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease infinite;
}

/* ===== PARTICLE EFFECTS ===== */

/* Floating particles animation */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(99, 102, 241, 0.6);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) { left: 20%; animation-delay: 0s; }
.particle:nth-child(2) { left: 40%; animation-delay: -2s; }
.particle:nth-child(3) { left: 60%; animation-delay: -4s; }
.particle:nth-child(4) { left: 80%; animation-delay: -6s; }

/* ===== SPECIAL EFFECTS ===== */

/* Glass morphism hover effect */
.glass-morph {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.glass-morph:hover {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(30px);
    transform: translateY(-2px);
}

/* Neon glow effect */
.neon-glow {
    text-shadow: 
        0 0 5px rgba(99, 102, 241, 0.5),
        0 0 10px rgba(99, 102, 241, 0.5),
        0 0 15px rgba(99, 102, 241, 0.5),
        0 0 20px rgba(99, 102, 241, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

/* Parallax scroll effect */
.parallax {
    transform: translateZ(0);
    transition: transform 0.1s ease-out;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* GPU acceleration for smooth animations */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .no-motion {
        animation: none !important;
        transition: none !important;
    }
}
