/* =========================================
   PREMIUM STOCK MARKET ANIMATIONS
   ========================================= */

/* 1. Page Loader - Stock Market Theme */
.loader-wrapper {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: var(--primary);
    display: flex;
    flex-direction: column;
    justify-content: center; align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.loader-brand {
    font-size: 2rem; color: var(--white); font-weight: 800;
    margin-bottom: 20px;
    animation: pulse 1.5s infinite;
}

/* Red & Green Progress Bar */
.loader-progress {
    width: 200px; height: 3px;
    background: rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.loader-progress::after {
    content: ''; position: absolute; top: 0; left: 0; height: 100%;
    width: 0; 
    background: linear-gradient(90deg, #ef4444, #22c55e); /* Red to Green */
    animation: loadProgress 2s cubic-bezier(0.8, 0, 0.2, 1) forwards;
}

@keyframes loadProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px rgba(212, 175, 55, 0.5); }
    50% { opacity: 0.5; text-shadow: none; }
}

/* 2. Scroll Reveal Utility Classes */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.reveal-left {
    opacity: 0; transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-right {
    opacity: 0; transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-up.active, .reveal-left.active, .reveal-right.active {
    opacity: 1; transform: translate(0);
}

/* 3. Stock Market Glow Effects for Cards */
.bullish-glow:hover {
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.15) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
}

.bearish-glow:hover {
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

/* 4. Candlestick Float Animation (For HTML elements if used) */
@keyframes floatCandleUp {
    0% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0); }
}

@keyframes floatCandleDown {
    0% { transform: translateY(0); }
    50% { transform: translateY(15px); }
    100% { transform: translateY(0); }
}

/* 5. Scroll Indicator */
.scroll-indicator {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    color: var(--white); opacity: 0.6; z-index: 10;
}

.mouse {
    width: 26px; height: 40px; border: 2px solid var(--white); border-radius: 15px; position: relative;
}
.mouse::before {
    content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 4px; height: 8px; background: var(--white); border-radius: 2px;
    animation: scrollMouse 1.5s infinite;
}

@keyframes scrollMouse {
    0% { top: 8px; opacity: 1; }
    100% { top: 20px; opacity: 0; }
}

/* Stock Canvas Container */
#stockCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.4; /* Subtle background effect */
    pointer-events: none; /* So it doesn't block clicks */
}