/* Mobile-friendly voting styles */

/* Hide mobile instructions by default */
.mobile-instructions {
    display: none;
}

/* Drag handle for mobile */
.drag-handle {
    display: none; /* Hidden by default, shown on mobile */
    font-size: 1.5rem;
    margin-right: 0.5rem;
    color: var(--light-text);
    cursor: grab;
}

/* Mobile controls (up/down buttons) */
.mobile-controls {
    display: none; /* Hidden by default, shown on mobile */
    margin-left: auto;
    gap: 0.5rem;
}

.mobile-control-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    transition: background-color 0.2s, transform 0.2s;
}

.mobile-control-btn:hover,
.mobile-control-btn:active {
    background-color: var(--secondary-color);
    transform: scale(1.1);
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
    /* Show mobile instructions on mobile */
    .mobile-instructions {
        display: block;
        color: var(--primary-color);
        font-size: 0.9rem;
        margin-top: 0.5rem;
    }
    
    /* Show drag handle on mobile */
    .drag-handle {
        display: block;
    }
    
    /* Show mobile controls on mobile */
    .mobile-controls {
        display: flex;
    }
    
    /* Adjust ranking item layout for mobile */
    .ranking-item {
        position: relative; /* For absolute positioning of dragged items */
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    /* Make the ranking number smaller on mobile */
    .ranking-number {
        width: 25px;
        height: 25px;
        font-size: 0.9rem;
        margin-right: 0.75rem;
    }
    
    /* Make the image smaller on mobile */
    .ranking-image {
        width: 60px;
        height: 45px;
        margin-right: 0.75rem;
    }
    
    /* Adjust text size for mobile */
    .ranking-name {
        font-size: 0.9rem;
    }
    
    /* Style for the dragging state on mobile */
    .ranking-item.dragging {
        background-color: #f0f0f0;
        border: 2px solid var(--primary-color);
        z-index: 1000;
    }
    
    /* Style for highlighting when an item is moved */
    .ranking-item.highlight {
        animation: highlight-pulse 0.3s ease-in-out;
    }
    
    @keyframes highlight-pulse {
        0% { background-color: var(--background-color); }
        50% { background-color: rgba(32, 192, 0, 0.2); }
        100% { background-color: var(--background-color); }
    }
    
    /* Dark mode adjustments */
    body.dark-mode .mobile-control-btn {
        background-color: var(--secondary-color);
    }
    
    body.dark-mode .mobile-control-btn:hover,
    body.dark-mode .mobile-control-btn:active {
        background-color: var(--primary-color);
    }
    
    body.dark-mode .ranking-item.dragging {
        background-color: #444;
        border-color: var(--secondary-color);
    }
}
