/* organize-pdf.css */
#organize-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* Exactly 4 columns */
    gap: 1rem;
    padding: 1.5rem;
    background: #f9fafb;
    /* Lighter background matching split tool */
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    max-height: 600px;
    overflow-y: auto;
    margin-top: 1rem;
}

/* Responsive grid for mobile/tablet */
@media (max-width: 992px) {
    #organize-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    #organize-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    #organize-container {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar styling */
#organize-container::-webkit-scrollbar {
    width: 6px;
}

#organize-container::-webkit-scrollbar-track {
    background: #f1f5f9;
}

#organize-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

.image-wrapper {
    position: relative;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: all 0.2s;
    cursor: grab;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-wrapper:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.image-wrapper.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.page-preview-box {
    width: 100%;
    height: 140px;
    /* slightly taller preview */
    margin-bottom: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
    overflow: hidden;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.page-preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.page-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

/* Hover Actions - Top Right */
.hover-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.image-wrapper:hover .hover-actions {
    opacity: 1;
}

.action-btn {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 11px;
    color: white;
}

.btn-rotate {
    background: #fbbf24;
}

.btn-delete {
    background: #ef4444;
}

/* Cleanup */
.selection-indicator,
.buttons-container {
    display: none !important;
}