/* Animated Statistics Background - Profit & Loss Dashboard Style */

/* Main animated background container */
.animated-stats-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #0f1419 0%, #1a2332 50%, #0f1419 100%);
    overflow: hidden;
}

/* Grid pattern overlay */
.stats-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 127, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 127, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Floating data points */
.data-point {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00ff7f;
    border-radius: 50%;
    animation: dataFloat 8s ease-in-out infinite;
}

.data-point:nth-child(1) { top: 10%; left: 15%; animation-delay: 0s; }
.data-point:nth-child(2) { top: 25%; left: 35%; animation-delay: 1s; }
.data-point:nth-child(3) { top: 45%; left: 20%; animation-delay: 2s; }
.data-point:nth-child(4) { top: 60%; left: 45%; animation-delay: 3s; }
.data-point:nth-child(5) { top: 30%; left: 70%; animation-delay: 4s; }
.data-point:nth-child(6) { top: 70%; left: 80%; animation-delay: 5s; }
.data-point:nth-child(7) { top: 15%; left: 85%; animation-delay: 6s; }
.data-point:nth-child(8) { top: 80%; left: 25%; animation-delay: 7s; }

@keyframes dataFloat {
    0%, 100% { 
        transform: translateY(0px) scale(1);
        opacity: 0.3;
    }
    50% { 
        transform: translateY(-20px) scale(1.5);
        opacity: 1;
    }
}

/* Profit/Loss bars */
.profit-bar {
    position: absolute;
    bottom: 0;
    background: linear-gradient(to top, #00ff7f, #00cc66);
    border-radius: 2px 2px 0 0;
    animation: profitGrow 6s ease-in-out infinite;
}

.loss-bar {
    position: absolute;
    bottom: 0;
    background: linear-gradient(to top, #ff4757, #ff3742);
    border-radius: 2px 2px 0 0;
    animation: lossGrow 6s ease-in-out infinite;
}

/* Profit bars */
.profit-bar:nth-child(1) { left: 5%; width: 8px; height: 60%; animation-delay: 0s; }
.profit-bar:nth-child(2) { left: 15%; width: 8px; height: 80%; animation-delay: 0.5s; }
.profit-bar:nth-child(3) { left: 25%; width: 8px; height: 45%; animation-delay: 1s; }
.profit-bar:nth-child(4) { left: 35%; width: 8px; height: 90%; animation-delay: 1.5s; }
.profit-bar:nth-child(5) { left: 45%; width: 8px; height: 70%; animation-delay: 2s; }
.profit-bar:nth-child(6) { left: 55%; width: 8px; height: 85%; animation-delay: 2.5s; }
.profit-bar:nth-child(7) { left: 65%; width: 8px; height: 55%; animation-delay: 3s; }
.profit-bar:nth-child(8) { left: 75%; width: 8px; height: 75%; animation-delay: 3.5s; }
.profit-bar:nth-child(9) { left: 85%; width: 8px; height: 65%; animation-delay: 4s; }
.profit-bar:nth-child(10) { left: 95%; width: 8px; height: 50%; animation-delay: 4.5s; }

/* Loss bars */
.loss-bar:nth-child(1) { left: 10%; width: 6px; height: 30%; animation-delay: 0.2s; }
.loss-bar:nth-child(2) { left: 20%; width: 6px; height: 20%; animation-delay: 0.7s; }
.loss-bar:nth-child(3) { left: 30%; width: 6px; height: 40%; animation-delay: 1.2s; }
.loss-bar:nth-child(4) { left: 40%; width: 6px; height: 15%; animation-delay: 1.7s; }
.loss-bar:nth-child(5) { left: 50%; width: 6px; height: 35%; animation-delay: 2.2s; }
.loss-bar:nth-child(6) { left: 60%; width: 6px; height: 25%; animation-delay: 2.7s; }
.loss-bar:nth-child(7) { left: 70%; width: 6px; height: 45%; animation-delay: 3.2s; }
.loss-bar:nth-child(8) { left: 80%; width: 6px; height: 30%; animation-delay: 3.7s; }
.loss-bar:nth-child(9) { left: 90%; width: 6px; height: 20%; animation-delay: 4.2s; }

@keyframes profitGrow {
    0%, 100% { 
        transform: scaleY(1);
        opacity: 0.7;
    }
    50% { 
        transform: scaleY(1.2);
        opacity: 1;
    }
}

@keyframes lossGrow {
    0%, 100% { 
        transform: scaleY(1);
        opacity: 0.6;
    }
    50% { 
        transform: scaleY(1.1);
        opacity: 0.9;
    }
}

/* Floating numbers */
.floating-number {
    position: absolute;
    color: #00ff7f;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    animation: numberFloat 10s linear infinite;
    opacity: 0.8;
}

.floating-number.negative {
    color: #ff4757;
}

.floating-number:nth-child(1) { top: 5%; left: 8%; animation-delay: 0s; }
.floating-number:nth-child(2) { top: 20%; left: 18%; animation-delay: 1s; }
.floating-number:nth-child(3) { top: 40%; left: 28%; animation-delay: 2s; }
.floating-number:nth-child(4) { top: 15%; left: 38%; animation-delay: 3s; }
.floating-number:nth-child(5) { top: 35%; left: 48%; animation-delay: 4s; }
.floating-number:nth-child(6) { top: 25%; left: 58%; animation-delay: 5s; }
.floating-number:nth-child(7) { top: 45%; left: 68%; animation-delay: 6s; }
.floating-number:nth-child(8) { top: 10%; left: 78%; animation-delay: 7s; }
.floating-number:nth-child(9) { top: 30%; left: 88%; animation-delay: 8s; }
.floating-number:nth-child(10) { top: 50%; left: 12%; animation-delay: 9s; }

@keyframes numberFloat {
    0% { 
        transform: translateY(0px) rotate(0deg);
        opacity: 0;
    }
    10% { 
        opacity: 0.8;
    }
    90% { 
        opacity: 0.8;
    }
    100% { 
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Trend lines */
.trend-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ff7f, transparent);
    animation: trendMove 12s linear infinite;
}

.trend-line:nth-child(1) { top: 20%; left: 0%; width: 30%; animation-delay: 0s; }
.trend-line:nth-child(2) { top: 40%; left: 20%; width: 25%; animation-delay: 2s; }
.trend-line:nth-child(3) { top: 60%; left: 10%; width: 35%; animation-delay: 4s; }
.trend-line:nth-child(4) { top: 30%; left: 50%; width: 30%; animation-delay: 6s; }
.trend-line:nth-child(5) { top: 70%; left: 40%; width: 25%; animation-delay: 8s; }
.trend-line:nth-child(6) { top: 15%; left: 70%; width: 30%; animation-delay: 10s; }

@keyframes trendMove {
    0% { 
        transform: translateX(-100%);
        opacity: 0;
    }
    10% { 
        opacity: 1;
    }
    90% { 
        opacity: 1;
    }
    100% { 
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Profit/Loss indicators */
.profit-indicator {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 12px solid #00ff7f;
    animation: indicatorPulse 4s ease-in-out infinite;
}

.loss-indicator {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 12px solid #ff4757;
    animation: indicatorPulse 4s ease-in-out infinite;
}

.profit-indicator:nth-child(1) { top: 25%; left: 12%; animation-delay: 0s; }
.profit-indicator:nth-child(2) { top: 45%; left: 32%; animation-delay: 1s; }
.profit-indicator:nth-child(3) { top: 65%; left: 52%; animation-delay: 2s; }
.profit-indicator:nth-child(4) { top: 35%; left: 72%; animation-delay: 3s; }

.loss-indicator:nth-child(1) { top: 55%; left: 22%; animation-delay: 0.5s; }
.loss-indicator:nth-child(2) { top: 75%; left: 42%; animation-delay: 1.5s; }
.loss-indicator:nth-child(3) { top: 15%; left: 62%; animation-delay: 2.5s; }
.loss-indicator:nth-child(4) { top: 85%; left: 82%; animation-delay: 3.5s; }

@keyframes indicatorPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.6;
    }
    50% { 
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Currency symbols */
.currency-symbol {
    position: absolute;
    color: #00ff7f;
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    font-weight: bold;
    animation: currencyFloat 8s ease-in-out infinite;
    opacity: 0.7;
}

.currency-symbol:nth-child(1) { top: 12%; left: 5%; animation-delay: 0s; }
.currency-symbol:nth-child(2) { top: 32%; left: 25%; animation-delay: 1s; }
.currency-symbol:nth-child(3) { top: 52%; left: 45%; animation-delay: 2s; }
.currency-symbol:nth-child(4) { top: 22%; left: 65%; animation-delay: 3s; }
.currency-symbol:nth-child(5) { top: 42%; left: 85%; animation-delay: 4s; }

@keyframes currencyFloat {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }
    50% { 
        transform: translateY(-15px) rotate(180deg);
        opacity: 1;
    }
}

/* Performance metrics */
.metric-box {
    position: absolute;
    background: rgba(0, 255, 127, 0.1);
    border: 1px solid rgba(0, 255, 127, 0.3);
    border-radius: 4px;
    padding: 8px;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #00ff7f;
    animation: metricFade 6s ease-in-out infinite;
}

.metric-box:nth-child(1) { top: 8%; right: 5%; animation-delay: 0s; }
.metric-box:nth-child(2) { top: 28%; right: 15%; animation-delay: 1s; }
.metric-box:nth-child(3) { top: 48%; right: 8%; animation-delay: 2s; }
.metric-box:nth-child(4) { top: 68%; right: 18%; animation-delay: 3s; }

@keyframes metricFade {
    0%, 100% { 
        opacity: 0.3;
        transform: scale(0.9);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .data-point, .floating-number, .currency-symbol {
        font-size: 10px;
    }
    
    .profit-bar, .loss-bar {
        width: 6px;
    }
    
    .metric-box {
        font-size: 8px;
        padding: 4px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        background-size: 30px 30px;
    }
    
    .data-point {
        width: 3px;
        height: 3px;
    }
    
    .profit-bar, .loss-bar {
        width: 4px;
    }
}
