/**
 * PDF Splitter Styles
 * PDF 분할 전용 스타일
 *
 * @package Zipper
 */

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

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

/* JS hook classes */
.pdfsp-mode-btn {}
.pdfsp-setting-input {}
.pdfsp-table-preview-btn {}
.pdfsp-table-download-btn {}

.pdfsp-stage-section,
.pdfsp-panel-card,
.pdfsp-plan-section,
.pdfsp-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;
}

.pdfsp-stage-section,
.pdfsp-panel-card,
.pdfsp-plan-section {
    padding: 16px;
}

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

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

.pdfsp-tool-intro,
.pdfsp-stage-head,
.pdfsp-preview-toolbar,
.pdfsp-preview-meta,
.pdfsp-waiting,
.pdfsp-download-row,
.pdfsp-summary-grid,
.pdfsp-choice-row,
.pdfsp-chip-row,
.pdfsp-inline-notes,
.pdfsp-plan-warning,
.pdfsp-action-cell,
.pdfsp-page-input-row,
.pdfsp-side-column,
.pdfsp-workbench,
.pdfsp-upload-card,
.pdfsp-empty-state,
.pdfsp-preview-pane,
.pdfsp-plan-section,
.pdfsp-panel-card {
    min-width: 0;
}

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

.pdfsp-tool-lead,
.pdfsp-section-lead,
.pdfsp-field-help,
.pdfsp-download-help,
.pdfsp-plan-summary,
.pdfsp-summary-note,
.pdfsp-waiting-desc,
.pdfsp-upload-hint,
.pdfsp-inline-note,
.pdfsp-empty-copy p {
    margin: 0;
    color: #5f5a56;
    font-size: 13px;
    line-height: 1.65;
}

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

.pdfsp-section-title i,
.pdfsp-meta-item i,
.pdfsp-inline-note i,
.pdfsp-waiting-icon i,
.pdfsp-disclaimer i,
.pdfsp-plan-warning i,
.pdfsp-empty-icon i,
.pdfsp-upload-icon i {
    color: #d4af37;
}

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

.pdfsp-empty-state,
.pdfsp-upload-card,
.pdfsp-preview-pane,
.pdfsp-side-column,
.pdfsp-panel-card,
.pdfsp-control-block,
.pdfsp-summary-card,
.pdfsp-action-card {
    display: grid;
    gap: 12px;
}

.pdfsp-upload-card {
    padding: 18px;
    border-radius: 14px;
    border: 1px solid #efe7d5;
    background: linear-gradient(135deg, #fffdf8 0%, #faf5e8 100%);
}

.pdfsp-empty-copy {
    display: grid;
    gap: 6px;
}

.pdfsp-empty-copy strong {
    font-size: 16px;
    color: #2d2a26;
}

.pdfsp-empty-icon {
    font-size: 30px;
}

.pdfsp-upload-area {
    border: 2px dashed #e3d8bb;
    border-radius: 14px;
    padding: 26px 18px;
    background: rgba(255, 255, 255, 0.82);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.pdfsp-upload-area:hover,
.pdfsp-stage-section.is-dragover .pdfsp-upload-area,
.pdfsp-upload-area:focus-visible {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.08);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
    outline: none;
}

.pdfsp-upload-icon {
    font-size: 34px;
    margin-bottom: 8px;
}

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

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

.pdfsp-inline-notes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pdfsp-inline-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #efe7d5;
}

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

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

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

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

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

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

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

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

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

.pdfsp-page-input,
.pdfsp-number-input,
.pdfsp-textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    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;
}

.pdfsp-page-input,
.pdfsp-number-input {
    height: 38px;
    padding: 0 10px;
}

.pdfsp-textarea {
    min-height: 126px;
    padding: 10px 12px;
    resize: vertical;
}

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

.pdfsp-page-total,
.pdfsp-range-value {
    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;
}

.pdfsp-range-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pdfsp-choice-row,
.pdfsp-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pdfsp-choice-btn,
.pdfsp-chip-btn {
    appearance: none;
    border: 1px solid #e3dccf;
    background: #fff;
    color: #2d2a26;
    border-radius: 999px;
    padding: 9px 13px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.pdfsp-choice-btn:hover,
.pdfsp-chip-btn:hover,
.pdfsp-choice-btn:focus-visible,
.pdfsp-chip-btn:focus-visible {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    outline: none;
}

.pdfsp-choice-btn.is-active,
.pdfsp-chip-btn.is-active {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.12);
    color: #8a6500;
    font-weight: 700;
}

.pdfsp-preview-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;
}

.pdfsp-preview-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(212, 175, 55, 0.22);
    font-size: 11px;
    font-weight: 700;
    color: #6f5200;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.08);
}

.pdfsp-preview-canvas {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 74vh;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(45, 42, 38, 0.12);
    background: #fff;
}

.pdfsp-preview-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

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

.pdfsp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid #e3dccf;
    background: #fff;
    color: #2d2a26;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.pdfsp-btn:hover,
.pdfsp-btn:focus-visible {
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.18);
    outline: none;
    transform: translateY(-1px);
}

.pdfsp-btn:disabled,
.pdfsp-choice-btn:disabled,
.pdfsp-chip-btn:disabled,
.pdfsp-page-input:disabled,
.pdfsp-number-input:disabled,
.pdfsp-textarea:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.pdfsp-btn-primary {
    background: linear-gradient(135deg, #f8f1d7 0%, #f4e4a3 100%);
    border-color: #d9be66;
    color: #6f5200;
}

.pdfsp-btn-secondary {
    background: #faf7f2;
}

.pdfsp-btn-ghost {
    background: #fff;
}

.pdfsp-download-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

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

.pdfsp-summary-item {
    display: grid;
    gap: 4px;
    padding: 12px 12px 13px;
    border-radius: 10px;
    border: 1px solid #ece7df;
    background: #fff;
}

.pdfsp-summary-item-accent {
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    border-color: #eadfb8;
}

.pdfsp-summary-item-accent.is-warning {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.24);
}

.pdfsp-summary-label {
    font-size: 11px;
    font-weight: 600;
    color: #7a746d;
}

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

.pdfsp-summary-value-small {
    font-size: 14px;
    line-height: 1.45;
}

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

.pdfsp-plan-warning.is-error {
    border-color: rgba(220, 50, 50, 0.18);
    background: rgba(220, 50, 50, 0.08);
}

.pdfsp-plan-warning.is-error i {
    color: #dc3232;
}

.pdfsp-plan-warning-copy {
    display: grid;
    gap: 4px;
}

.pdfsp-plan-warning-copy strong {
    font-size: 13px;
    color: #2d2a26;
}

.pdfsp-plan-warning-copy p {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: #5f5a56;
}

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

.pdfsp-plan-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 13px;
}

.pdfsp-plan-table th,
.pdfsp-plan-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee7db;
    text-align: left;
    vertical-align: top;
}

.pdfsp-plan-table th {
    font-size: 12px;
    font-weight: 700;
    color: #6b655f;
    background: #faf9f7;
}

.pdfsp-plan-table tbody tr.is-current {
    background: rgba(212, 175, 55, 0.08);
}

.pdfsp-plan-table tbody tr.is-processing {
    background: rgba(212, 175, 55, 0.12);
}

.pdfsp-file-cell {
    display: grid;
    gap: 4px;
}

.pdfsp-file-title {
    font-weight: 700;
    color: #2d2a26;
}

.pdfsp-file-name {
    font-size: 12px;
    line-height: 1.55;
    color: #6b655f;
    word-break: break-word;
}

.pdfsp-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #ece7df;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    color: #5f5a56;
}

.pdfsp-status-chip.is-current {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.12);
    color: #8a6500;
}

.pdfsp-action-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pdfsp-table-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #e3dccf;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    color: #2d2a26;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.pdfsp-table-btn:hover,
.pdfsp-table-btn:focus-visible {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    outline: none;
}

.pdfsp-table-btn.is-save {
    background: #faf7f2;
}

.pdfsp-table-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.pdfsp-empty-row {
    text-align: center !important;
    color: #7a746d;
}

.pdfsp-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: #faf9f7;
}

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

@media (min-width: 1024px) {
    .pdfsp-workbench {
        grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
        align-items: start;
    }

    .pdfsp-plan-section,
    .pdfsp-disclaimer {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1023px) {
    .pdfsp-workbench {
        grid-template-columns: 1fr;
    }
}

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

    .pdfsp-download-row {
        grid-template-columns: 1fr;
    }

    .pdfsp-page-input:not([type="radio"]):not([type="checkbox"]),
    .pdfsp-number-input,
    .pdfsp-textarea {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .pdfsp-stage-section,
    .pdfsp-panel-card,
    .pdfsp-plan-section {
        padding: 14px;
    }

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

    .pdfsp-preview-shell {
        min-height: 320px;
        padding: 18px 14px;
    }

    .pdfsp-inline-notes {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .tool-section,
    .pdfsp-workbench,
    .pdfsp-stage-section,
    .pdfsp-side-column,
    .pdfsp-plan-section {
        max-width: 100%;
        overflow-x: hidden;
    }

    .pdfsp-upload-card {
        padding: 16px;
    }

    .pdfsp-choice-row,
    .pdfsp-chip-row,
    .pdfsp-action-cell {
        flex-direction: column;
    }

    .pdfsp-choice-btn,
    .pdfsp-chip-btn,
    .pdfsp-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pdfsp-stage-section,
    .pdfsp-upload-area,
    .pdfsp-btn,
    .pdfsp-choice-btn,
    .pdfsp-chip-btn,
    .pdfsp-table-btn,
    .pdfsp-page-input,
    .pdfsp-number-input,
    .pdfsp-textarea {
        transition: none !important;
    }

    .pdfsp-btn:hover,
    .pdfsp-upload-area:hover {
        transform: none !important;
    }
}
