/* Visual improvements for voting buttons */

/* Smooth transitions for vote buttons */
.vote-btn {
    position: relative;
    transition: all 0.2s ease;
    overflow: hidden;
}

/* Remove any flicker by ensuring consistent styling */
.vote-btn:disabled {
    opacity: 0.6;
    cursor: wait !important;
}

/* Active state styling */
.vote-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.vote-btn.active:hover {
    background-color: var(--primary-color-dark, #0056b3);
    transform: translateY(0);
}

/* Non-active hover state */
.vote-btn:not(.active):not(:disabled):hover {
    background-color: rgba(var(--primary-color-rgb, 0, 123, 255), 0.1);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* Click animation */
.vote-btn:not(:disabled):active {
    transform: scale(0.95);
}

/* Loading animation during vote */
.vote-btn.voting::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: vote-loading 0.8s ease-in-out;
}

@keyframes vote-loading {
    to {
        left: 100%;
    }
}

/* Ensure icon spacing */
.vote-btn i {
    margin-right: 0.25rem;
}

/* Visual feedback for state changes */
.vote-btn {
    will-change: transform, background-color;
}

/* Dark mode adjustments */
.dark-modal .vote-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.dark-modal .vote-btn:not(.active):not(:disabled):hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Prevent layout shift during updates */
.vote-btn {
    min-width: 60px;
    text-align: center;
}

/* Mobile touch feedback */
@media (hover: none) {
    .vote-btn:active {
        background-color: rgba(var(--primary-color-rgb, 0, 123, 255), 0.2);
    }
}