/* ===========================================
   SOLVESPHERE - ANIMATIONS STYLESHEET
   All animation keyframes and classes
=========================================== */

/* ===== KEYFRAME ANIMATIONS ===== */

/* Slide In Animations */
@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Fade Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale Animations */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.5);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
    }
}

/* Rotate Animations */
@keyframes rotateCube {
    from {
        transform: rotateX(0) rotateY(0) rotateZ(0);
    }
    to {
        transform: rotateX(360deg) rotateY(360deg) rotateZ(180deg);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes spinGradient {
    0% {
        transform: rotate(0deg);
        border-top-color: var(--primary-color);
        border-right-color: var(--secondary-color);
        border-bottom-color: var(--accent-color);
    }
    33% {
        border-top-color: var(--secondary-color);
        border-right-color: var(--accent-color);
        border-bottom-color: var(--primary-color);
    }
    66% {
        border-top-color: var(--accent-color);
        border-right-color: var(--primary-color);
        border-bottom-color: var(--secondary-color);
    }
    100% {
        transform: rotate(360deg);
        border-top-color: var(--primary-color);
        border-right-color: var(--secondary-color);
        border-bottom-color: var(--accent-color);
    }
}

/* Float Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes cosmicFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.5;
    }
    25% {
        transform: translate(20px, -20px) rotate(90deg);
        opacity: 0.8;
    }
    50% {
        transform: translate(-20px, 20px) rotate(180deg);
        opacity: 0.6;
    }
    75% {
        transform: translate(-20px, -20px) rotate(270deg);
        opacity: 0.7;
    }
}

/* Bounce Animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@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);
    }
}

/* Special Effects */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes coloredRipple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes waveExpand {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes moveGlow {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(100px, 100px);
    }
    50% {
        transform: translate(-100px, 200px);
    }
    75% {
        transform: translate(200px, -100px);
    }
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes textFlow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 300% 50%;
    }
}

@keyframes fallAndSpin {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }
    100% {
        transform: perspective(400px) rotateY(180deg);
    }
}

/* ===== ANIMATION CLASSES ===== */

/* Slide Classes */
.slide-in-down {
    animation: slideInDown 0.5s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.5s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

/* Fade Classes */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

.fade-in-down {
    animation: fadeInDown 0.5s ease-out;
}

.fade-in-left {
    animation: fadeInLeft 0.5s ease-out;
}

.fade-in-right {
    animation: fadeInRight 0.5s ease-out;
}

.fade-out {
    animation: fadeOut 0.5s ease-out;
}

/* Scale Classes */
.zoom-in {
    animation: zoomIn 0.5s ease-out;
}

.zoom-out {
    animation: zoomOut 0.5s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

.pulse-glow {
    animation: pulseGlow 2s infinite;
}

/* Rotate Classes */
.rotate-cube {
    animation: rotateCube 20s infinite linear;
}

.spin {
    animation: spin 1s linear infinite;
}

.spin-slow {
    animation: spin 3s linear infinite;
}

.spin-reverse {
    animation: spin 1s linear infinite reverse;
}

/* Float Classes */
.float {
    animation: float 6s ease-in-out infinite;
}

.float-slow {
    animation: floatSlow 8s ease-in-out infinite;
}

.cosmic-float {
    animation: cosmicFloat 20s ease-in-out infinite;
}

/* Bounce Classes */
.bounce {
    animation: bounce 2s infinite;
}

.bounce-in {
    animation: bounceIn 0.8s ease-out;
}

/* Special Effect Classes */
.ripple-animation {
    animation: ripple 0.6s linear;
}

.wave-animation {
    animation: waveExpand 1s ease-out;
}

.gradient-flow {
    background-size: 400% 400%;
    animation: gradientFlow 15s ease infinite;
}

.text-flow {
    background-size: 300% 100%;
    animation: textFlow 2s linear infinite;
}

.blink {
    animation: blink 1s infinite;
}

.shake {
    animation: shake 0.5s ease-in-out;
}

.flip {
    animation: flip 0.6s ease-out;
}

/* Stagger Animation */
.stagger-item {
    opacity: 0;
}

.stagger-item.animated {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Page Transition */
.page-transition {
    animation: fadeIn 0.3s ease-out;
}

/* Loading Animation */
.loading-spin {
    animation: spin 1s linear infinite;
}

/* Typewriter Cursor */
.typewriter-cursor {
    animation: blink 0.7s infinite;
}

/* ===== ANIMATION UTILITIES ===== */

/* Animation Delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

/* Animation Durations */
.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.5s; }
.duration-slow { animation-duration: 1s; }
.duration-slower { animation-duration: 2s; }

/* Animation Fill Modes */
.fill-forwards { animation-fill-mode: forwards; }
.fill-backwards { animation-fill-mode: backwards; }
.fill-both { animation-fill-mode: both; }

/* Animation Timing Functions */
.ease-linear { animation-timing-function: linear; }
.ease-ease { animation-timing-function: ease; }
.ease-ease-in { animation-timing-function: ease-in; }
.ease-ease-out { animation-timing-function: ease-out; }
.ease-ease-in-out { animation-timing-function: ease-in-out; }
.ease-bounce { animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); }

/* ===== HOVER EFFECT CLASSES ===== */
.hover-lift:hover {
    transform: translateY(-10px);
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
    transition: transform 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
    transition: box-shadow 0.3s ease;
}

.hover-color:hover {
    background-color: rgba(99, 102, 241, 0.1);
    transition: background-color 0.3s ease;
}

.hover-shake:hover {
    animation: shake 0.5s ease-in-out;
}

.hover-pulse:hover {
    animation: pulse 2s infinite;
}

/* ===== SCROLL ANIMATION TRIGGERS ===== */
[data-scroll-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-scroll-animate].animated {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 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;
    }
    
    .floating-cube {
        animation: none !important;
    }
    
    .cosmic-particle {
        animation: none !important;
    }
    
    .glass-circle {
        animation: none !important;
    }
}