/* Animations */

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.5;
    }
    25% {
        transform: translateY(-100px) translateX(50px);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-200px) translateX(-30px);
        opacity: 0.3;
    }
    75% {
        transform: translateY(-100px) translateX(-80px);
        opacity: 0.7;
    }
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

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

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 240, 255, 0.6);
    }
}

@keyframes priceFlash {
    0% {
        background: transparent;
    }
    50% {
        background: rgba(0, 240, 255, 0.2);
    }
    100% {
        background: transparent;
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

/* Gradient Border Animation */
.gradient-border {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 20px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary), var(--accent-primary));
    border-radius: 20px;
    z-index: -1;
    background-size: 400% 400%;
    animation: gradientRotate 3s ease infinite;
}

@keyframes gradientRotate {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Shimmer Effect for Cards */
.token-card,
.stat-card {
    position: relative;
    overflow: hidden;
}

.token-card::after,
.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.5s;
}

.token-card:hover::after,
.stat-card:hover::after {
    left: 100%;
}

/* Price Flash Animation */
.price-flash {
    animation: priceFlash 0.5s ease;
}

/* Neon Glow Effect */
.neon-glow {
    text-shadow: 
        0 0 10px var(--accent-primary),
        0 0 20px var(--accent-primary),
        0 0 30px var(--accent-primary),
        0 0 40px var(--accent-primary);
    animation: glow 2s ease-in-out infinite;
}

/* Button Press Animation */
.btn-press {
    animation: bounce 0.3s ease;
}

/* Slide In Animations for Cards */
.token-card,
.stat-card {
    animation: slideInUp 0.6s ease forwards;
    opacity: 0;
}

.token-card:nth-child(1) { animation-delay: 0.1s; }
.token-card:nth-child(2) { animation-delay: 0.2s; }
.token-card:nth-child(3) { animation-delay: 0.3s; }
.token-card:nth-child(4) { animation-delay: 0.4s; }
.token-card:nth-child(5) { animation-delay: 0.5s; }
.token-card:nth-child(6) { animation-delay: 0.6s; }
.token-card:nth-child(7) { animation-delay: 0.7s; }
.token-card:nth-child(8) { animation-delay: 0.8s; }
.token-card:nth-child(9) { animation-delay: 0.9s; }
.token-card:nth-child(10) { animation-delay: 1.0s; }
.token-card:nth-child(11) { animation-delay: 1.1s; }
.token-card:nth-child(12) { animation-delay: 1.2s; }

/* Stat Cards Fade In */
.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

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

/* Tab Transition */
.chart-frame {
    animation: fadeIn 0.5s ease;
}

/* Ticker Continuous Scroll */
.ticker-content {
    animation: scroll 30s linear infinite;
}

.ticker-content:hover {
    animation-play-state: paused;
}

/* Hover Effects */
.interactive:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Particle Effects */
.particle {
    animation: float var(--duration, 20s) infinite ease-in-out;
    animation-delay: var(--delay, 0s);
}

/* Modal Animations */
.modal {
    animation: fadeIn 0.3s ease;
}

.modal-content {
    animation: slideInUp 0.3s ease;
}

/* Success Animation */
@keyframes successPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-animation {
    animation: successPulse 0.5s ease;
}

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

.count-animation {
    animation: countUp 0.5s ease;
}

/* Flip Animation for Swap */
.flip-animation {
    animation: rotate 0.5s ease;
}

/* Background Pulse */
@keyframes backgroundPulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

.background-grid {
    animation: backgroundPulse 4s ease-in-out infinite;
}

/* Chain Badge Glow */
.token-chain {
    position: relative;
    transition: all 0.3s;
}

.token-chain:hover {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
}

/* Responsive Animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}