/* ===== FEE INCREMENT ANIMATIONS ===== */

/* Container for floating animations */
#animation-container {
    position: relative;
    pointer-events: none;
    z-index: 1000;
}

/* Base style for fee increment animation */
.fee-increment-animation {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    font-weight: 600;
    color: #10B981;
    background: rgba(16, 185, 129, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #10B981;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
    animation: fee-drop 1.5s ease-out forwards;
    z-index: 1001;
    white-space: nowrap;
}

/* Sequential animation style - starts near title */
.fee-increment-sequential {
    top: -200px; /* Start much higher, near the dashboard title */
    animation: fee-drop-sequential 3s ease-out forwards;
}

/* Large increment style (≥ 10 TLOS) */
.fee-increment-large {
    font-size: 1.5rem;
    color: #FFD700;
    background: rgba(255, 215, 0, 0.15);
    border-color: #FFD700;
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.4);
    animation: fee-drop-large 1.8s ease-out forwards;
}

/* Animation for normal increments */
@keyframes fee-drop {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px) scale(0.8);
    }
    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(0px) scale(1);
    }
    85% {
        opacity: 1;
        transform: translateX(-50%) translateY(120px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(140px) scale(0.9);
    }
}

/* Animation for large increments */
@keyframes fee-drop-large {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px) scale(0.7);
    }
    10% {
        opacity: 1;
        transform: translateX(-50%) translateY(-10px) scale(1.1);
    }
    20% {
        transform: translateX(-50%) translateY(0px) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(120px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(140px) scale(0.8);
    }
}

/* Sequential animation - appears near title, then falls to balance */
@keyframes fee-drop-sequential {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px) scale(0.8);
    }
    5% {
        opacity: 1;
        transform: translateX(-50%) translateY(0px) scale(1);
    }
    75% {
        opacity: 1;
        transform: translateX(-50%) translateY(0px) scale(1);
    }
    95% {
        opacity: 1;
        transform: translateX(-50%) translateY(270px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(290px) scale(0.9);
    }
}

/* Sequential animation for large increments */
.fee-increment-sequential.fee-increment-large {
    animation: fee-drop-sequential-large 3.5s ease-out forwards;
}

@keyframes fee-drop-sequential-large {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px) scale(0.7);
    }
    4% {
        opacity: 1;
        transform: translateX(-50%) translateY(-10px) scale(1.1);
    }
    8% {
        transform: translateX(-50%) translateY(0px) scale(1);
    }
    75% {
        opacity: 1;
        transform: translateX(-50%) translateY(0px) scale(1);
    }
    95% {
        opacity: 1;
        transform: translateX(-50%) translateY(270px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(290px) scale(0.8);
    }
}

/* ===== BALANCE GLOW EFFECT ===== */

/* Glow effect for large increments */
.balance-glow {
    animation: golden-glow 2s ease-in-out;
}

@keyframes golden-glow {
    0% {
        box-shadow: none;
        text-shadow: none;
    }
    25% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
        text-shadow: 0 0 15px rgba(255, 215, 0, 1);
    }
    75% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    }
    100% {
        box-shadow: none;
        text-shadow: none;
    }
}

/* ===== SMOOTH BALANCE UPDATES ===== */

/* Smooth transition for balance updates */
.balance-amount {
    transition: all 0.5s ease-in-out;
}

/* Subtle pulse when balance updates */
.balance-updated {
    animation: subtle-pulse 0.6s ease-in-out;
}

@keyframes subtle-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* ===== RESPONSIVE ANIMATIONS ===== */

/* Adjust animation for smaller screens */
@media (max-width: 768px) {
    .fee-increment-animation {
        font-size: 1rem;
        padding: 6px 12px;
    }
    
    .fee-increment-large {
        font-size: 1.3rem;
    }
    
    @keyframes fee-drop {
        85% {
            transform: translateX(-50%) translateY(80px) scale(1);
        }
        100% {
            transform: translateX(-50%) translateY(100px) scale(0.9);
        }
    }
    
    @keyframes fee-drop-large {
        80% {
            transform: translateX(-50%) translateY(80px) scale(1);
        }
        100% {
            transform: translateX(-50%) translateY(100px) scale(0.8);
        }
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .fee-increment-animation,
    .fee-increment-large {
        animation-duration: 0.5s;
    }
    
    .balance-glow {
        animation: none;
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }
    
    .balance-updated {
        animation: none;
    }
}
