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

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

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

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

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

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

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

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

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(212, 175, 55, 0);
    }
}

/* Dopamin Optimized Price Update Animation */
@keyframes price-update {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.08);
        text-shadow: 0 0 15px currentColor;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        text-shadow: none;
    }
}

/* Pozitif değişim için özel animasyon */
@keyframes positive-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 255, 106, 0.5);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 20px 5px rgba(0, 255, 106, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 255, 106, 0);
    }
}

/* Negatif değişim için dikkat çekici animasyon */
@keyframes negative-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 59, 92, 0.5);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 20px 5px rgba(255, 59, 92, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 59, 92, 0);
    }
}

/* Büyük kazanç için kutlama animasyonu */
@keyframes big-win {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    25% {
        transform: scale(1.1);
        filter: brightness(1.3);
    }
    50% {
        transform: scale(1.05);
        filter: brightness(1.2);
    }
}

@keyframes live-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Live indicator */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #00FF00;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #00FF00;
    border-radius: 50%;
    animation: live-dot 1s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(0, 255, 0, 0.6);
}

.pulse-update {
    animation: price-update 0.5s ease;
}

/* Dopamin optimized positive update */
.pulse-update.positive,
.positive.pulse-update {
    animation: positive-pulse 0.6s ease;
    color: var(--positive) !important;
}

/* Loss aversion optimized negative update */
.pulse-update.negative,
.negative.pulse-update {
    animation: negative-pulse 0.6s ease;
    color: var(--negative) !important;
}

/* Big win celebration (>10% profit) */
.big-win {
    animation: big-win 0.8s ease;
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.3s ease forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.3s ease forwards;
}

.animate-slide-in-up {
    animation: slideInUp 0.3s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease forwards;
}

/* Staggered animations for lists */
.stagger-animate > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-animate > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-animate > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-animate > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-animate > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-animate > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-animate > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-animate > *:nth-child(8) { animation-delay: 0.4s; }
.stagger-animate > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-animate > *:nth-child(10) { animation-delay: 0.5s; }

.stagger-animate > * {
    opacity: 0;
    animation: slideInUp 0.4s ease forwards;
}

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

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-title {
    height: 24px;
    width: 50%;
    margin-bottom: 12px;
}

.skeleton-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card {
    height: 120px;
    border-radius: var(--radius-lg);
}

/* Refresh spinner */
.refreshing .header-btn svg {
    animation: spin 1s linear infinite;
}

/* Number counter animation */
.counter-animate {
    transition: all 0.5s ease-out;
}

/* Ripple effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.ripple:active::after {
    width: 200%;
    height: 200%;
}

/* Hover lift effect */
.hover-lift {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Press effect */
.press-effect {
    transition: transform var(--transition-fast);
}

.press-effect:active {
    transform: scale(0.97);
}

/* Glow effects */
.gold-glow-hover:hover {
    box-shadow: var(--gold-glow);
}

.currency-glow-hover:hover {
    box-shadow: var(--currency-glow);
}

/* Pulse animation for important elements */
.pulse-attention {
    animation: pulse-glow 2s infinite;
}

/* Chart animations */
.chart-animate {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: chartDraw 1s ease forwards;
}

@keyframes chartDraw {
    to {
        stroke-dashoffset: 0;
    }
}

/* Value change highlight */
.value-updated {
    animation: valueFlash 0.5s ease;
}

@keyframes valueFlash {
    0%, 100% {
        background: transparent;
    }
    50% {
        background: rgba(212, 175, 55, 0.2);
    }
}

.value-increased {
    animation: increaseFlash 0.5s ease;
}

@keyframes increaseFlash {
    0%, 100% {
        color: inherit;
    }
    50% {
        color: var(--positive);
    }
}

.value-decreased {
    animation: decreaseFlash 0.5s ease;
}

@keyframes decreaseFlash {
    0%, 100% {
        color: inherit;
    }
    50% {
        color: var(--negative);
    }
}

/* Page transitions */
.page-enter {
    animation: slideInRight 0.3s ease forwards;
}

.page-exit {
    animation: slideInLeft 0.3s ease reverse forwards;
}

/* Modal backdrop animation */
.modal-overlay {
    animation: fadeIn 0.2s ease forwards;
}

/* Shake animation for errors */
.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Success checkmark animation */
.success-check {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: checkDraw 0.5s ease forwards 0.2s;
}

@keyframes checkDraw {
    to {
        stroke-dashoffset: 0;
    }
}

/* Ticker scroll animation */
.ticker-scroll {
    animation: tickerScroll 20s linear infinite;
}

@keyframes tickerScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Floating animation */
.floating {
    animation: floating 3s ease-in-out infinite;
}

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

/* Gradient text animation */
.gradient-text-animate {
    background: linear-gradient(
        90deg,
        var(--gold-primary),
        var(--gold-light),
        var(--gold-primary)
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 3s linear infinite;
}

@keyframes gradientFlow {
    to {
        background-position: 200% center;
    }
}
