/**
 * PDF Page Reorder Styles
 * Styles for the Simplified Chinese PDF Page Reorder tool
 *
 * @package Zipper
 */

.ppr-hidden {
    display: none !important;
}

.ppr-workbench {
    display: grid;
    gap: 14px;
}

/* JS hook class */
.ppr-control {}

.ppr-stage-section,
.ppr-order-section,
.ppr-control-section,
.ppr-table-section,
.ppr-summary-section,
.ppr-disclaimer {
    min-width: 0;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
    box-sizing: border-box;
}

.ppr-stage-section,
.ppr-order-section,
.ppr-control-section,
.ppr-table-section,
.ppr-summary-section {
    padding: 16px;
}

.ppr-stage-section {
    display: grid;
    gap: 14px;
    background: linear-gradient(180deg, #fffdf9 0%, #ffffff 100%);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.ppr-stage-section.is-file-dragover {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12), 0 6px 18px rgba(212, 175, 55, 0.12);
}

.ppr-tool-intro,
.ppr-stage-head,
.ppr-section-head,
.ppr-preview-meta,
.ppr-waiting,
.ppr-empty-note-grid,
.ppr-preview-toolbar,
.ppr-slot-input-row,
.ppr-target-row,
.ppr-action-grid,
.ppr-download-row,
.ppr-summary-grid,
.ppr-thumb-grid,
.ppr-thumb-card,
.ppr-thumb-card-top,
.ppr-thumb-footer,
.ppr-thumb-mini-actions,
.ppr-disclaimer {
    min-width: 0;
}

.ppr-tool-intro {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.ppr-tool-lead {
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
    color: #5f5a56;
}

.ppr-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 700;
    color: #1a1816;
}

.ppr-section-title i,
.ppr-meta-item i,
.ppr-empty-note i,
.ppr-disclaimer i,
.ppr-waiting-icon i,
.ppr-thumb-handle i {
    color: #d4af37;
}

.ppr-section-lead,
.ppr-target-hint,
.ppr-table-summary {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: #6b655f;
}

.ppr-stage-head,
.ppr-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.ppr-stage-body,
.ppr-empty-state,
.ppr-preview-pane,
.ppr-control-section,
.ppr-summary-section,
.ppr-target-box,
.ppr-preview-slot-field,
.ppr-waiting-copy,
.ppr-thumb-text-group,
.ppr-summary-card {
    display: grid;
    gap: 12px;
}

.ppr-control-section {
    gap: 10px;
}

.ppr-upload-area {
    border: 2px dashed #e8e4dc;
    border-radius: 12px;
    padding: 26px 18px;
    background: #faf9f7;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ppr-upload-area:hover,
.ppr-stage-section.is-file-dragover .ppr-upload-area {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.08);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.ppr-upload-icon {
    font-size: 34px;
    color: #d4af37;
    margin-bottom: 8px;
}

.ppr-upload-text {
    font-size: 15px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 6px;
}

.ppr-upload-hint {
    font-size: 12px;
    line-height: 1.6;
    color: #7c756d;
}

.ppr-upload-input {
    display: none;
}

.ppr-empty-note-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.ppr-empty-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #ece7df;
    border-radius: 10px;
    background: #fff;
    font-size: 12px;
    line-height: 1.55;
    color: #5f5a56;
}

.ppr-waiting {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.22);
}

.ppr-waiting.is-error {
    background: rgba(220, 50, 50, 0.08);
    border-color: rgba(220, 50, 50, 0.18);
}

.ppr-waiting.is-error .ppr-waiting-icon i {
    color: #dc3232;
}

.ppr-waiting-title {
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
}

.ppr-waiting-desc {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: #5f5a56;
}

.ppr-preview-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.ppr-preview-slot-field {
    gap: 6px;
}

.ppr-preview-slot-field label,
.ppr-label {
    font-size: 11px;
    font-weight: 600;
    color: #5f5a56;
}

.ppr-slot-input-row,
.ppr-target-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.ppr-slot-input,
.ppr-target-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: #2d2a26;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ppr-slot-input:focus,
.ppr-target-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.ppr-slot-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    background: #faf9f7;
    border: 1px solid #ece7df;
    white-space: nowrap;
    font-size: 12px;
    color: #5f5a56;
}

.ppr-stage-canvas-shell {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 460px;
    padding: 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    border: 1px solid #eadfb8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 10px 24px rgba(212, 175, 55, 0.14);
    overflow: hidden;
}

.ppr-preview-canvas {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 72vh;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(45, 42, 38, 0.18);
    background: #fff;
}

.ppr-status-badge,
.ppr-order-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.ppr-status-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(212, 175, 55, 0.14);
    color: #8a6500;
    border: 1px solid rgba(212, 175, 55, 0.24);
}

.ppr-preview-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.ppr-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid #ece7df;
    border-radius: 10px;
    background: #faf9f7;
    font-size: 12px;
    color: #5f5a56;
}

.ppr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.ppr-btn:hover:not(:disabled),
.ppr-action-chip:hover:not(:disabled),
.ppr-thumb-move-btn:hover:not(:disabled),
.ppr-table-preview-btn:hover:not(:disabled),
.ppr-table-move-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.ppr-btn:focus-visible,
.ppr-action-chip:focus-visible,
.ppr-thumb-preview-btn:focus-visible,
.ppr-thumb-move-btn:focus-visible,
.ppr-table-preview-btn:focus-visible,
.ppr-table-move-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.ppr-btn:disabled,
.ppr-action-chip:disabled,
.ppr-thumb-preview-btn:disabled,
.ppr-thumb-move-btn:disabled,
.ppr-table-preview-btn:disabled,
.ppr-table-move-btn:disabled {
    cursor: not-allowed;
    opacity: 0.56;
    transform: none;
}

.ppr-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    box-shadow: 0 3px 10px rgba(212, 175, 55, 0.28);
}

.ppr-btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.34);
}

.ppr-btn-secondary {
    color: #8a6500;
    background: rgba(212, 175, 55, 0.12);
    border-color: #eadfb8;
}

.ppr-btn-ghost {
    color: #5f5a56;
    background: #f5f3f0;
    border-color: #e8e4dc;
}

.ppr-target-box {
    gap: 8px;
    padding: 12px;
    border: 1px solid #ece7df;
    border-radius: 10px;
    background: #fcfbf9;
}

.ppr-action-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ppr-action-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #e4dfd7;
    background: #fff;
    color: #5f5a56;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.ppr-download-row {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.ppr-thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.ppr-thumb-grid.is-drop-end {
    border-radius: 12px;
    box-shadow: inset 0 0 0 2px rgba(212, 175, 55, 0.18);
}

.ppr-thumb-empty {
    padding: 20px;
    border: 1px dashed #ddd7cb;
    border-radius: 12px;
    background: #faf9f7;
    text-align: center;
    font-size: 13px;
    color: #7a746c;
}

.ppr-thumb-progress {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #faf9f7;
    border: 1px solid #ece7df;
    font-size: 12px;
    color: #5f5a56;
    white-space: nowrap;
}

.ppr-thumb-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #ece7df;
    background: #fff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.ppr-thumb-card.is-active {
    border-color: #d4af37;
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.18);
}

.ppr-thumb-card.is-dragging {
    opacity: 0.55;
}

.ppr-thumb-card.is-drop-target {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14);
}

.ppr-thumb-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ppr-order-badge {
    background: rgba(212, 175, 55, 0.14);
    color: #8a6500;
    border: 1px solid rgba(212, 175, 55, 0.24);
}

.ppr-thumb-handle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #7a746c;
    white-space: nowrap;
}

.ppr-thumb-preview-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.ppr-thumb-canvas-wrap {
    display: grid;
    place-items: center;
    min-height: 220px;
    padding: 10px;
    border-radius: 10px;
    background: linear-gradient(180deg, #faf9f7 0%, #f3efe8 100%);
    border: 1px solid #ece7df;
    overflow: hidden;
}

.ppr-thumb-canvas {
    display: block;
    width: 100%;
    height: auto;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(45, 42, 38, 0.12);
}

.ppr-thumb-render-fallback {
    padding: 18px 12px;
    border: 1px dashed #d8d2c7;
    border-radius: 8px;
    background: #fff;
    text-align: center;
    font-size: 12px;
    line-height: 1.6;
    color: #7a746c;
}

.ppr-thumb-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ppr-thumb-text-group {
    gap: 4px;
}

.ppr-thumb-order-text {
    font-size: 12px;
    font-weight: 700;
    color: #2d2a26;
}

.ppr-thumb-origin {
    font-size: 11px;
    color: #7a746c;
}

.ppr-thumb-mini-actions,
.ppr-table-action-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ppr-thumb-move-btn,
.ppr-table-preview-btn,
.ppr-table-move-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    min-width: 28px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid #e4dfd7;
    background: #fff;
    color: #5f5a56;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.ppr-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.ppr-page-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
}

.ppr-page-table th,
.ppr-page-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee8df;
    text-align: left;
    vertical-align: middle;
    font-size: 12px;
    color: #2d2a26;
    white-space: nowrap;
}

.ppr-page-table th {
    background: #faf9f7;
    font-size: 11px;
    color: #7a746c;
}

.ppr-page-table tr.is-active td {
    background: rgba(212, 175, 55, 0.06);
}

.ppr-empty-row {
    text-align: center !important;
    color: #8b847c !important;
}

.ppr-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.ppr-summary-card {
    gap: 4px;
    min-height: 84px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #ece7df;
    background: #fff;
}

.ppr-summary-card-accent {
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    border-color: #eadfb8;
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.12);
}

.ppr-summary-label {
    font-size: 12px;
    color: #7a746c;
}

.ppr-summary-value {
    font-size: 24px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 800;
    color: #2d2a26;
}

.ppr-summary-value-file {
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: 0;
    word-break: break-word;
}

.ppr-summary-note {
    padding: 12px 14px;
    border-radius: 10px;
    background: #faf9f7;
    border: 1px solid #ece7df;
    font-size: 12px;
    line-height: 1.6;
    color: #5f5a56;
}

.ppr-disclaimer {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    background: #faf9f7;
}

.ppr-disclaimer-text {
    font-size: 12px;
    line-height: 1.7;
    color: #5f5a56;
}

@media (max-width: 900px) {
    .ppr-empty-note-grid,
    .ppr-preview-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ppr-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .ppr-stage-section,
    .ppr-order-section,
    .ppr-control-section,
    .ppr-table-section,
    .ppr-summary-section {
        padding: 14px;
    }

    .ppr-stage-head,
    .ppr-section-head,
    .ppr-thumb-footer,
    .ppr-download-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ppr-preview-toolbar,
    .ppr-target-row {
        grid-template-columns: 1fr;
    }

    .ppr-stage-canvas-shell {
        min-height: 320px;
        padding: 16px 12px;
    }

    .ppr-thumb-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ppr-thumb-canvas-wrap {
        min-height: 180px;
    }

    .ppr-preview-meta,
    .ppr-empty-note-grid,
    .ppr-summary-grid {
        grid-template-columns: 1fr;
    }

    .ppr-action-grid {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .ppr-action-chip {
        flex: 0 0 auto;
    }
}

@media (max-width: 480px) {
    .ppr-workbench,
    .ppr-stage-section,
    .ppr-stage-body,
    .ppr-thumb-grid,
    .ppr-table-wrap {
        max-width: 100%;
        overflow-x: hidden;
    }

    .ppr-thumb-grid,
    .ppr-summary-grid {
        grid-template-columns: 1fr;
    }

    .ppr-thumb-canvas-wrap {
        min-height: 200px;
    }

    .ppr-stage-canvas-shell {
        min-height: 260px;
    }

    .ppr-thumb-mini-actions,
    .ppr-table-action-cell {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ppr-stage-section,
    .ppr-upload-area,
    .ppr-btn,
    .ppr-action-chip,
    .ppr-thumb-card,
    .ppr-thumb-move-btn,
    .ppr-table-preview-btn,
    .ppr-table-move-btn {
        transition: none !important;
    }

    .ppr-btn:hover:not(:disabled),
    .ppr-action-chip:hover:not(:disabled),
    .ppr-thumb-move-btn:hover:not(:disabled),
    .ppr-table-preview-btn:hover:not(:disabled),
    .ppr-table-move-btn:hover:not(:disabled) {
        transform: none !important;
    }
}
