/* File: assets/css/tools/merge-pdf.css */

/* --- Step 2: Arrange Files & Merge --- */

/* Order Context Label (above list) */
.order-context-label {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--primary-medium);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
    padding-left: 2px;
}

/* File Order List Container */
.file-order-list {
    margin-top: 0;
    margin-bottom: 15px;
    border: 2px dashed var(--primary-medium);
    border-radius: 12px;
    min-height: 200px;
    padding: 16px;
    background: linear-gradient(to bottom, rgba(var(--primary-rgb), 0.02), rgba(var(--primary-rgb), 0.05));
    overflow: visible;
}

/* Order Confirmation Text (below list) */
.order-confirmation-text {
    font-size: 0.88em;
    color: var(--text-color);
    text-align: center;
    font-style: italic;
    opacity: 0.8;
    margin-bottom: 20px;
}

/* Instruction Text Above File List */
.arrange-instruction {
    color: var(--text-color);
    font-size: 1em;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: center;
    opacity: 0.9;
}

/* Individual File Item - Sortable Row Design */
.file-order-item {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    margin: 10px 0;
    background-color: var(--popular-card-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: move;
    cursor: grab;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    gap: 16px;
    position: relative;
}

.file-order-item:hover {

    border-color: var(--primary-medium);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    cursor: grab;
}

.file-order-item:active {
    cursor: grabbing;
}

/* File Order Number Badge - DOMINANT */
.file-order-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-medium) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 900;
    font-size: 1.5em;
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    line-height: 1;
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

/* Visual emphasis during physical movement */
.file-order-number.number-moving {
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transform-origin: center;
    scale: 1.15;
}

/* Drag Handle Icon - VISIBLE */
.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6em;
    color: var(--primary-medium);
    cursor: move;
    cursor: grab;
    opacity: 0.6;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0 6px;
}

.file-order-item:hover .drag-handle {
    opacity: 1;
    color: var(--primary-dark);
    transform: scale(1.1);
}

.file-order-item:active .drag-handle {
    cursor: grabbing;
}

/* File Content Container */
.file-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

/* File Name */
.file-content .file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    word-break: break-word;
    /* Fallback for very long words */
}

/* File Metadata (pages and size) */
.file-content .file-metadata {
    font-size: 0.92em;
    color: #6c757d;
    opacity: 0.85;
    line-height: 1.3;
}

/* Style for item being dragged */
.file-order-item.dragging {
    opacity: 0.6;
    transform: scale(1.03) rotate(2deg);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    cursor: grabbing !important;
    border-color: var(--primary-dark);
    background-color: #fff8e1;
    z-index: 1000;
}

.file-order-item.dragging * {
    cursor: grabbing !important;
}

.file-order-item.dragging .drag-handle {
    opacity: 1;
    color: var(--primary-dark);
}

.file-order-item.dragging .file-order-number {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    transform: scale(1.05);
}

/* --- Step 3: Download Your Merged PDF --- */

/* Note: Download step uses shared template with global styles from pdf-tool.css */
/* Classes used: .download-container, .download-options, .files-list, .success-message, etc. */

/* Responsive Adjustments */
@media (max-width: 768px) {
    .file-order-item {
        padding: 14px;
        gap: 12px;
    }

    .file-order-number {
        min-width: 40px;
        height: 40px;
        font-size: 1.3em;
    }

    .drag-handle {
        font-size: 1.4em;
    }

    .file-content .file-name {
        font-size: 1em;
    }

    .file-content .file-metadata {
        font-size: 0.88em;
    }

    .order-context-label {
        font-size: 0.85em;
    }

    .order-confirmation-text {
        font-size: 0.85em;
    }
}