/* src/styles/organize-pdf.css */

.tool-header {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto 40px auto;
}


.tool-layout.single-col {
    display: flex;
    justify-content: center;
    margin: 0 auto !important;
    max-width: 1200px;
    width: 100%;
}

.tool-layout.single-col .tool-left {
    width: 100%;
}

.tool-layout.single-col>div {
    width: 100%;
}


/* Reusing standard dropzone styles from protect/unlock if needed */
.p2w-panel {
    max-width: 100%;
    width: 100%;
}

.p2w-dropzone {
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 60px 20px;
    text-align: center;
    background: var(--bg-card);
    transition: all 0.3s ease;
    cursor: pointer;
}

.p2w-dropzone:hover,
.p2w-dropzone.drag-over {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--red);
    transform: translateY(-2px);
}


.p2w-dropzone .drop-icon {
    font-size: 64px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(79, 70, 229, 0.2));
}

.p2w-dropzone .drop-content {
    pointer-events: none;
}

.p2w-dropzone h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: 'Outfit', sans-serif;
}

.p2w-dropzone p {
    color: var(--text-2);
    margin-bottom: 24px;
}

.privacy-badge {
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-3);
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: inline-block;
}

/* Grid Layout for Thumbnails */
.page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 160px);
    justify-content: center;
    gap: 24px;
    padding: 10px;
    min-height: 200px;
    /* In case it's empty */
}

/* Individual Page Card */
.page-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    user-select: none;
}

.page-card:active {
    cursor: grabbing;
}

.page-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Canvas Wrapper for fixed A4 ratio simulation */
.page-canvas-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.02);
}

.page-canvas-wrapper canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Smooth rotation */
}

/* Page Number indicator */
.page-number-badge {
    background: var(--bg-body);
    color: var(--text-1);
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
    font-weight: 600;
    pointer-events: none;
    box-shadow: var(--shadow-sm);
}

/* Hover Action Overlay */
.page-actions-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 44px;
    /* Stop above the page number */
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.page-card:hover .page-actions-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Action Buttons (Rotate / Delete) */
.page-action-btn {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #111827;
    /* Force dark icon for contrast on white btn */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease, color 0.2s ease;
}

.page-action-btn:hover {
    transform: scale(1.15);
}

.page-action-btn.delete-btn:hover {
    background: var(--red);
    color: #fff;
}

.page-action-btn.rotate-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* SortableJS drag states */
.sortable-ghost {
    opacity: 0.3;
    background: var(--primary-soft);
    border-style: dashed;
}

.sortable-drag {
    cursor: grabbing !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15) !important;
    transform: scale(1.05);
    z-index: 1000;
}

/* Editor Bottom Action Bar sticky styling */
.editor-action-bar {
    position: sticky;
    bottom: 20px;
    z-index: 100;
    padding: 16px 24px;
    margin-top: 32px;
    border-radius: 16px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--primary-soft);
    background: var(--bg-card);
}

/* Dark mode overrides */
[data-theme="dark"] .page-canvas-wrapper {
    background: #e5e7eb;
    /* Keep paper visually distinct */
    border-color: transparent;
}

[data-theme="dark"] .editor-action-bar {
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
}

/* Success View Stats */
#success-stats {
    display: flex;
    gap: 16px;
    margin: 24px 0;
    justify-content: center;
}

#load-progress {
    background: linear-gradient(90deg, var(--red), #ff6060) !important;
    position: relative;
    overflow: hidden;
    border-radius: 100px;
}

#load-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer-swipe 1.5s infinite linear;
    z-index: 1;
}

@keyframes shimmer-swipe {
    0% { transform: translateX(-150%); }
    100% { transform: translateX(50%); }
}

.stat-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    padding: 12px 24px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-val {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-1);
}

.stat-lbl {
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 1px;
}