/* =====================================================
   KRIPTO COPY TRADE - Animations Stylesheet
   Smooth, GPU-friendly animations for modern fintech UI
   ===================================================== */

/* =====================================================
   KEYFRAME ANIMATIONS
   ===================================================== */

/* Float Animation - Used for gradient orbs */
@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(20px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-10px, 20px) scale(0.95);
    }
    75% {
        transform: translate(-30px, -10px) scale(1.02);
    }
}

/* Float Icon Animation - Used for floating crypto icons */
@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(5deg);
    }
    50% {
        transform: translateY(-10px) rotate(-3deg);
    }
    75% {
        transform: translateY(-25px) rotate(2deg);
    }
}

/* Pulse Animation - Used for orbs */
@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.5;
    }
}

/* Pulse Dot Animation - Used for live indicator */
@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
}

/* Bounce Animation - Used for scroll indicator */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Slide In Animation - Used for trade flow items */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide Up Animation - Used for reveal effects */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Glow Pulse Animation */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 163, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 255, 163, 0.5);
    }
}

/* Chart Line Animation */
@keyframes chartDraw {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* Signal Path Animation */
@keyframes signalFlow {
    from {
        stroke-dashoffset: 20;
    }
    to {
        stroke-dashoffset: 0;
    }
}

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

/* Shimmer Animation - For loading states */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* =====================================================
   ANIMATION CLASSES
   ===================================================== */

/* Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

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

/* =====================================================
   HOVER ANIMATIONS
   ===================================================== */

/* Card Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Glow Effect on Hover */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(0, 255, 163, 0.4);
}

/* Scale Effect on Hover */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Button Ripple Effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.btn-ripple:hover::after {
    transform: scale(2);
    opacity: 1;
}

/* =====================================================
   CHART ANIMATIONS
   ===================================================== */

/* Chart Line Drawing */
.chart-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: chartDraw 2s ease forwards;
}

.chart-area {
    opacity: 0;
    animation: fadeIn 1s ease 1s forwards;
}

/* Signal Path Animation */
.signal-path {
    stroke-dasharray: 10;
    animation: signalFlow 1s linear infinite;
}

/* =====================================================
   LOADING ANIMATIONS
   ===================================================== */

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-green);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

/* =====================================================
   PARALLAX EFFECTS
   ===================================================== */

.parallax-slow {
    will-change: transform;
    transition: transform 0.1s linear;
}

.parallax-medium {
    will-change: transform;
    transition: transform 0.15s linear;
}

.parallax-fast {
    will-change: transform;
    transition: transform 0.2s linear;
}

/* =====================================================
   MICRO INTERACTIONS
   ===================================================== */

/* Button Press Effect */
.btn:active {
    transform: scale(0.98);
}

/* Input Focus Effect */
input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px var(--accent-green-dim);
}

/* Link Underline Effect */
.link-underline {
    position: relative;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

.link-underline:hover::after {
    width: 100%;
}

/* Card Border Glow */
.card-border-glow {
    position: relative;
}

.card-border-glow::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: var(--accent-gradient);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.card-border-glow:hover::before {
    opacity: 1;
}

/* =====================================================
   TEXT ANIMATIONS
   ===================================================== */

/* Gradient Text Animation */
.gradient-text-animated {
    background: linear-gradient(
        90deg,
        var(--accent-green),
        var(--accent-cyan),
        var(--accent-green)
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
    from {
        background-position: 0% center;
    }
    to {
        background-position: 200% center;
    }
}

/* Typing Effect */
.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--accent-green);
    animation: typing 3s steps(40) 1s forwards, blink 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* =====================================================
   PERFORMANCE OPTIMIZATIONS
   ===================================================== */

/* GPU Acceleration for heavy animations */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Reduce motion for accessibility */
@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;
    }

    .floating-icon,
    .gradient-orb,
    .chart-line,
    .signal-path {
        animation: none !important;
    }
}

/* =====================================================
   3D TRANSFORM EFFECTS
   ===================================================== */

/* 3D Card Tilt */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg);
}

/* 3D Float Effect */
.float-3d {
    animation: float3d 6s ease-in-out infinite;
}

@keyframes float3d {
    0%, 100% {
        transform: translateY(0) rotateX(0deg) rotateY(0deg);
    }
    25% {
        transform: translateY(-10px) rotateX(2deg) rotateY(-2deg);
    }
    50% {
        transform: translateY(-5px) rotateX(-1deg) rotateY(1deg);
    }
    75% {
        transform: translateY(-15px) rotateX(1deg) rotateY(-1deg);
    }
}

/* =====================================================
   NOTIFICATION ANIMATIONS
   ===================================================== */

/* Toast Slide In */
.toast-enter {
    animation: toastSlideIn 0.3s ease forwards;
}

.toast-exit {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Badge Pulse */
.badge-pulse {
    position: relative;
}

.badge-pulse::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 0 rgba(0, 255, 163, 0.7);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 163, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 255, 163, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 163, 0);
    }
}
