/* ========================================
   Malware Mentor - Animation Stylesheet
   Version: 1.0
   Animation-specific CSS
   ======================================== */

/* 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;
    }
}

/* Will-Change Optimization */
.animate-on-scroll,
.card-3d,
.nav-link-magnetic,
.btn-premium {
    will-change: transform, opacity;
}

/* Fade In Animations */
@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);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.fade-in-down {
    animation: fadeInDown 0.6s ease forwards;
}

.fade-in-left {
    animation: fadeInLeft 0.6s ease forwards;
}

.fade-in-right {
    animation: fadeInRight 0.6s ease forwards;
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.6s ease forwards;
}

/* Rotate Animations */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

.rotate-in {
    animation: rotateIn 0.6s ease forwards;
}

/* Glow Pulse */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 156, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 156, 255, 0.6);
    }
}

.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Typewriter Effect Container */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--mm-primary);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--mm-primary);
    }
}

/* Loading Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 156, 255, 0.2);
    border-top-color: var(--mm-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Ripple Effect */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* Slide In Animations */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-up {
    animation: slideInUp 0.6s ease forwards;
}

/* Stagger 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; }

/* Initial Hidden State */
.animate-on-scroll {
    opacity: 0;
}

.animate-on-scroll.animated {
    opacity: 1;
}

/* Parallax Layers */
.parallax-layer {
    will-change: transform;
}

.parallax-slow {
    transform: translateZ(0);
}

.parallax-medium {
    transform: translateZ(0);
}

.parallax-fast {
    transform: translateZ(0);
}

/* 3D Card Effect */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.card-3d:hover {
    transform: rotateY(5deg) rotateX(-5deg);
}

/* Magnetic Effect */
.magnetic-element {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Progress Bar Animation */
@keyframes progressFill {
    from {
        width: 0%;
    }
}

.progress-bar {
    height: 4px;
    background: var(--mm-gradient-primary);
    border-radius: 2px;
    animation: progressFill 2s ease forwards;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.bounce-animation {
    animation: bounce 1s ease infinite;
}

/* Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake-animation {
    animation: shake 0.5s ease;
}

/* Hero Logo Animation */
@keyframes logoMorph {
    0%, 100% {
        border-radius: 50%;
        transform: scale(1) rotate(0deg);
    }
    25% {
        border-radius: 30%;
        transform: scale(1.1) rotate(90deg);
    }
    50% {
        border-radius: 50%;
        transform: scale(1) rotate(180deg);
    }
    75% {
        border-radius: 30%;
        transform: scale(1.1) rotate(270deg);
    }
}

.logo-morph {
    animation: logoMorph 4s ease-in-out infinite;
}

/* Text Reveal */
@keyframes textReveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.text-reveal {
    animation: textReveal 1s ease forwards;
}

/* Gradient Shift */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animated {
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
}
