/* css/image-to-pdf.css */

/* Upload Area Styling */
#upload-area.drag-over {
    border-color: #2ecc71;
    /* secondary color from your theme */
    background-color: rgba(46, 204, 113, 0.05);
}

/* Image Preview Styling */
.preview-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    /* Prevents scrolling while dragging on touch devices */
}

.preview-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    /* Important: prevents the image from being the drag target */
}

.preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(231, 76, 60, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.preview-item:hover .remove-btn {
    opacity: 1;
}

.preview-item .image-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 10px;
    padding: 3px 5px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* --- NEW STYLES FOR DRAG & DROP --- */
.preview-item.dragging {
    opacity: 0.5;
    border: 2px dashed #3498db;
    /* primary color */
}

/* This class gives a subtle "lift" effect for touch devices */
.preview-item.held {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    z-index: 100;
}