/* Custom CSS for Image to PDF Page */

/* File Upload Area */
.drop-area {
    border: 3px dashed var(--primary-color);
    background-color: var(--light-color);
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.drop-area.highlight {
    background-color: #e9f7ff; /* Lighter blue on drag over */
    border-color: #0056b3; /* Darker blue border */
}

.drop-area p.lead {
    font-weight: bold;
    color: var(--dark-color);
}

.drop-area .material-symbols-rounded {
    font-size: 5rem; /* Large icon for emphasis */
    color: var(--primary-color);
}

/* Uploaded Images Preview */
.uploaded-images-preview {
    min-height: 100px; /* 至少保证显示一个区域 */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background-color: #fcfcfc;
    display: flex; /* Ensure flexbox for rows */
    flex-wrap: wrap; /* Allow items to wrap */
    align-items: flex-start; /* Align items to the top */
    gap: 0.75rem; /* Gap between image items */
}

/* Individual Image Item */
.image-item {
    position: relative;
    width: 120px; /* Fixed width for consistent sizing */
    height: 120px; /* Fixed height for consistent sizing */
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    cursor: grab; /* Indicate draggable */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.image-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensure image fits without cropping */
    background-color: #fff; /* White background for transparent PNGs */
}

.image-item .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(220, 53, 69, 0.8); /* Danger color with transparency */
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.2s ease;
    z-index: 10;
}

.image-item:hover .delete-btn {
    opacity: 1; /* Show on hover */
}

.image-item .order-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    text-align: center;
    font-size: 0.7rem;
    padding: 2px 0;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.2s ease;
}

.image-item:hover .order-handle {
    opacity: 1; /* Show on hover */
}

/* PDF Settings Area */
.pdf-settings {
    background-color: #f8f9fa; /* Light grey background */
    border: 1px solid var(--border-color);
}
.pdf-settings .form-label {
    font-weight: 600;
    color: var(--dark-color);
}

/* Conversion Result Area */
.conversion-result {
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #e9f7ff; /* Light blue background for success/info */
}
.conversion-result .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

/* Related Tools Section - Reuse styling from style.css */
.related-tools {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

/* Sortable.js specific styles */
.sortable-ghost {
    opacity: 0.4;
    background-color: #f0f8ff; /* Light background for ghost item */
    border: 2px dashed var(--primary-color);
}

/* Hide Bootstrap default spinner for buttons if custom spinner is used */
.btn .spinner-border {
    margin-right: 0.5rem;
}

/* Responsive adjustments for image items */
@media (max-width: 576px) {
    .image-item {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 768px) {
    .drop-area {
        padding: 3rem;
    }
    .drop-area .material-symbols-rounded {
        font-size: 4rem;
    }
    .drop-area p.lead {
        font-size: 1.1rem;
    }
}
