/**
 * PDF Page Deleter Styles
 * PDF 페이지 삭제기 전용 스타일
 *
 * @package Zipper
 */

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

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

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

.ppd-stage-section,
.ppd-control-section,
.ppd-summary-section,
.ppd-thumb-section,
.ppd-table-section,
.ppd-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;
}

.ppd-stage-section,
.ppd-control-section,
.ppd-summary-section,
.ppd-thumb-section,
.ppd-table-section {
    padding: 16px;
}

.ppd-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;
}

.ppd-stage-section.is-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);
}

.ppd-tool-intro,
.ppd-stage-head,
.ppd-section-head,
.ppd-preview-meta,
.ppd-waiting,
.ppd-empty-note-grid,
.ppd-action-grid,
.ppd-download-row,
.ppd-summary-grid,
.ppd-thumb-grid,
.ppd-disclaimer,
.ppd-preview-toolbar,
.ppd-page-input-row,
.ppd-range-row,
.ppd-preview-page-field,
.ppd-stage-body,
.ppd-control-section,
.ppd-summary-section {
    min-width: 0;
}

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

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

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

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

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

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

.ppd-stage-body,
.ppd-preview-pane,
.ppd-control-section,
.ppd-summary-section {
    display: grid;
    gap: 12px;
}

.ppd-control-section {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
}

.ppd-empty-state {
    display: grid;
    gap: 12px;
}

.ppd-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;
}

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

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

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

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

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

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

.ppd-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;
}

.ppd-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);
}

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

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

.ppd-waiting-copy {
    display: grid;
    gap: 4px;
}

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

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

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

.ppd-preview-page-field {
    display: grid;
    gap: 6px;
}

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

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

.ppd-page-input,
.ppd-range-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;
}

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

.ppd-page-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;
}

.ppd-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;
}

.ppd-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;
}

.ppd-status-badge,
.ppd-thumb-status-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;
}

.ppd-status-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(70, 180, 80, 0.12);
    color: #2f7a35;
    border: 1px solid rgba(70, 180, 80, 0.2);
}

.ppd-status-badge.is-deleted,
.ppd-thumb-status-badge.is-deleted {
    background: rgba(220, 50, 50, 0.12);
    color: #b42318;
    border: 1px solid rgba(220, 50, 50, 0.18);
}

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

.ppd-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;
}

.ppd-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;
}

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

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

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

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

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

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

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

.ppd-range-box,
.ppd-danger-note {
    display: grid;
    gap: 8px;
}

.ppd-range-box {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border: 1px solid #ece7df;
    border-radius: 8px;
    background: #fcfbf9;
}

.ppd-control-section .ppd-section-title {
    order: 1;
    flex: 0 0 100%;
    font-size: 14px;
}

.ppd-control-section .ppd-section-lead {
    display: none;
}

.ppd-control-section .ppd-label {
    font-size: 10.5px;
    white-space: nowrap;
}

.ppd-action-grid {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: center;
    order: 4;
}

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

.ppd-danger-note {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 7px;
    border-radius: 999px;
    border: 1px solid #ece7df;
    background: #faf9f7;
    font-size: 10.5px;
    line-height: 1.2;
    color: #5f5a56;
    white-space: nowrap;
}

.ppd-danger-note i {
    margin-right: 0;
}

.ppd-control-section .ppd-range-row {
    display: inline-flex;
    grid-template-columns: none;
    gap: 4px;
    align-items: center;
}

.ppd-control-section .ppd-range-box {
    order: 3;
}

.ppd-control-section .ppd-range-input {
    width: 130px;
    height: 28px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 11px;
}

.ppd-control-section .ppd-btn-secondary {
    min-height: 28px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 10.5px;
    white-space: nowrap;
}

.ppd-control-section .ppd-range-hint {
    font-size: 10.5px;
    line-height: 1.2;
    white-space: nowrap;
}

.ppd-download-row {
    display: inline-flex;
    grid-template-columns: none;
    gap: 8px;
    align-items: center;
    order: 6;
    margin-left: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.ppd-control-section .ppd-btn-ghost,
.ppd-control-section .ppd-btn-primary {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 11px;
    white-space: nowrap;
}

.ppd-control-section .ppd-btn-ghost {
    min-width: 76px;
    padding: 0 12px;
    color: #7a746c;
    background: #f7f4ef;
}

.ppd-control-section .ppd-btn-primary {
    min-width: 118px;
    padding: 0 18px;
    box-shadow: 0 5px 16px rgba(212, 175, 55, 0.3);
}

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

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

.ppd-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);
}

.ppd-summary-card-danger.is-active {
    border-color: rgba(220, 50, 50, 0.2);
    background: rgba(220, 50, 50, 0.06);
}

.ppd-summary-card-accent.is-warning {
    border-color: rgba(220, 50, 50, 0.2);
    background: rgba(220, 50, 50, 0.06);
    box-shadow: none;
}

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

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

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

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

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

.ppd-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;
}

.ppd-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;
}

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

.ppd-thumb-card.is-deleted {
    border-color: rgba(220, 50, 50, 0.18);
    background: linear-gradient(180deg, rgba(220, 50, 50, 0.04) 0%, #fff 100%);
}

.ppd-thumb-card.is-render-error {
    border-style: dashed;
}

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

.ppd-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;
}

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

.ppd-thumb-card.is-deleted .ppd-thumb-canvas {
    opacity: 0.72;
}

.ppd-thumb-status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(70, 180, 80, 0.12);
    color: #2f7a35;
    border: 1px solid rgba(70, 180, 80, 0.2);
}

.ppd-table-status-cell .ppd-thumb-status-badge {
    position: static;
    top: auto;
    right: auto;
}

.ppd-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;
}

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

.ppd-thumb-label {
    font-size: 12px;
    font-weight: 700;
    color: #2d2a26;
}

.ppd-thumb-toggle-btn,
.ppd-table-preview-btn,
.ppd-table-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 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;
}

.ppd-thumb-card.is-deleted .ppd-thumb-toggle-btn,
.ppd-table-toggle-btn.is-deleted {
    border-color: rgba(220, 50, 50, 0.18);
    background: rgba(220, 50, 50, 0.08);
    color: #b42318;
}

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

.ppd-page-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.ppd-page-table th,
.ppd-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;
}

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

.ppd-page-table td:last-child {
    min-width: 148px;
}

.ppd-page-table tr.is-deleted td {
    background: rgba(220, 50, 50, 0.03);
}

.ppd-table-status-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

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

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

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

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

    .ppd-preview-toolbar {
        grid-template-columns: 1fr;
    }

    .ppd-btn,
    .ppd-action-chip,
    .ppd-page-input,
    .ppd-range-input,
    .ppd-table-preview-btn,
    .ppd-table-toggle-btn {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .ppd-control-section {
        gap: 6px;
    }

    .ppd-control-section .ppd-section-lead {
        display: none;
    }

    .ppd-download-row {
        margin-left: 0;
    }

    .ppd-control-section .ppd-btn,
    .ppd-control-section .ppd-action-chip,
    .ppd-control-section .ppd-range-input {
        width: auto;
        max-width: none;
    }

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

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

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

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

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

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

    .ppd-control-section {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .ppd-control-section .ppd-range-input {
        width: 128px;
    }

    .ppd-control-section .ppd-section-title,
    .ppd-control-section .ppd-download-row,
    .ppd-control-section .ppd-range-box,
    .ppd-control-section .ppd-action-grid,
    .ppd-control-section .ppd-danger-note {
        flex: 0 0 auto;
    }

    .ppd-control-section .ppd-download-row {
        order: 2;
        flex-direction: row;
        align-items: center;
    }

    .ppd-control-section .ppd-range-box {
        order: 3;
    }

    .ppd-control-section .ppd-action-grid {
        order: 4;
    }

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

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

    .ppd-thumb-grid {
        grid-template-columns: 1fr;
    }

    .ppd-summary-grid {
        grid-template-columns: 1fr;
    }

    .ppd-control-section .ppd-range-input {
        width: 118px;
    }

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

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

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

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