/**
 * Real-time Voting Visualization Styles
 * Animations and effects for live vote updates
 */

/* Vote update animations */
.vote-updated {
    animation: voteFlash 1s ease-in-out;
    font-weight: bold;
}

@keyframes voteFlash {
    0%, 100% { background-color: transparent; }
    50% { background-color: #4CAF50; color: white; border-radius: 4px; }
}

/* Position change animations */
.position-up {
    animation: positionUp 2s ease-in-out;
    color: #4CAF50;
    font-weight: bold;
}

.position-down {
    animation: positionDown 2s ease-in-out;
    color: #f44336;
    font-weight: bold;
}

@keyframes positionUp {
    0% { transform: translateY(0); }
    20% { transform: translateY(-5px); color: #4CAF50; }
    100% { transform: translateY(0); }
}

@keyframes positionDown {
    0% { transform: translateY(0); }
    20% { transform: translateY(5px); color: #f44336; }
    100% { transform: translateY(0); }
}

/* Change indicators */
.change-indicator {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    opacity: 0;
    transform: scale(0.8) translateY(5px);
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.change-indicator.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.change-indicator.increase {
    background-color: #4CAF50;
    color: white;
}

.change-indicator.up {
    background-color: #2196F3;
    color: white;
}

.change-indicator.down {
    background-color: #FF9800;
    color: white;
}

/* Real-time indicator */
.realtime-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.realtime-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

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

/* Track item positioning */
.track-item, .chart-track {
    position: relative;
    transition: transform 0.3s ease;
}

.track-item.moving, .chart-track.moving {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Vote count styling */
.vote-count, .track-votes {
    position: relative;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

/* Position styling */
.track-position, .position {
    position: relative;
    transition: all 0.3s ease;
    font-weight: bold;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .realtime-status {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .change-indicator {
        font-size: 10px;
        padding: 1px 4px;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .vote-updated {
        animation: voteFlashDark 1s ease-in-out;
    }
    
    @keyframes voteFlashDark {
        0%, 100% { background-color: transparent; }
        50% { background-color: #2E7D32; color: white; border-radius: 4px; }
    }
}
