/* Grid layout for desktop */
#image-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

/* Each image */
.thumbnail-item {
    list-style-type: none;
    position: relative;
    cursor: move;
    transition: box-shadow 0.3s ease;
}

/* Visual feedback when dragging */
.thumbnail-item:hover, .thumbnail-item:active {
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
}

.thumbnail-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
}

/* Drag handle */
.drag-handle {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 3px 5px;
    font-size: 12px;
    border-radius: 4px;
    cursor: grab;
}

/* Highlight the image being dragged */
.dragging {
    opacity: 0.5;
    transform: scale(1.1);
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.3);
}

/* Add a placeholder where the image will be dropped */
.placeholder {
    width: 100px;
    height: 100px;
    border: 2px dashed #ccc;
    background-color: rgba(255, 255, 255, 0.7);
}

/* Responsive for mobile */
@media (max-width: 768px) {
    #image-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 10px;
    }

    .thumbnail-item {
        width: 100px;
        flex: 0 0 auto;
    }

    .drag-handle {
        font-size: 16px;
        padding: 5px;
    }
}