/**
 * PDF Merger Styles
 * Styles for the French PDF merger tool
 *
 * @package Zipper
 */

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

.pdfmg-control {}

.pdfmg-tool-intro,
.pdfmg-heading-copy,
.pdfmg-side-stack,
.pdfmg-preview-meta,
.pdfmg-empty-note-grid,
.pdfmg-waiting,
.pdfmg-summary-grid,
.pdfmg-result-grid,
.pdfmg-action-stack,
.pdfmg-action-row,
.pdfmg-file-list,
.pdfmg-section-head,
.pdfmg-top-grid,
.pdfmg-preview-empty,
.pdfmg-note-box {
    min-width: 0;
}

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

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

.pdfmg-heading-copy {
    display: grid;
    gap: 6px;
}

.pdfmg-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
}

.pdfmg-side-stack {
    display: grid;
    gap: 12px;
}

.pdfmg-top-grid + .pdfmg-summary-section,
.pdfmg-summary-section + .pdfmg-table-section,
.pdfmg-table-section + .pdfmg-result-section,
.pdfmg-result-section + .pdfmg-disclaimer {
    margin-top: 12px;
}

.pdfmg-preview-section,
.pdfmg-order-section,
.pdfmg-action-section,
.pdfmg-summary-section,
.pdfmg-table-section,
.pdfmg-result-section,
.pdfmg-disclaimer {
    min-width: 0;
    background: #fff;
    border: 1px solid #e8e0d2;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(53, 44, 25, 0.045);
}

.pdfmg-preview-section,
.pdfmg-order-section,
.pdfmg-action-section,
.pdfmg-summary-section,
.pdfmg-table-section,
.pdfmg-result-section {
    padding: 14px;
}

.pdfmg-preview-section {
    background: linear-gradient(180deg, #fffdf8 0%, #ffffff 100%);
    display: grid;
    gap: 12px;
    scroll-margin-top: calc(var(--header-height, 56px) + 16px);
}

.pdfmg-order-section,
.pdfmg-action-section,
.pdfmg-summary-section,
.pdfmg-table-section,
.pdfmg-result-section {
    display: grid;
    gap: 12px;
}

.pdfmg-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.pdfmg-section-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 700;
    color: #2f2a24;
}

.pdfmg-section-title i,
.pdfmg-meta-item i,
.pdfmg-empty-note i,
.pdfmg-disclaimer i,
.pdfmg-waiting-icon i,
.pdfmg-upload-icon i,
.pdfmg-row-index {
    color: #b8860b;
}

.pdfmg-section-lead,
.pdfmg-summary-note,
.pdfmg-result-note,
.pdfmg-note-box p,
.pdfmg-upload-hint,
.pdfmg-empty-note,
.pdfmg-waiting-desc,
.pdfmg-list-meta,
.pdfmg-meta-item,
.pdfmg-table-status,
.pdfmg-list-empty {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #6a655f;
}

.pdfmg-preview-shell {
    min-height: 520px;
    border-radius: 16px;
    border: 1px solid #eadfb8;
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 10px 24px rgba(212, 175, 55, 0.12);
    overflow: hidden;
}

.pdfmg-preview-empty,
.pdfmg-preview-card {
    height: 100%;
}

.pdfmg-preview-empty {
    display: grid;
    align-content: center;
    gap: 14px;
    padding: 22px;
}

.pdfmg-upload-area {
    display: grid;
    gap: 8px;
    place-items: center;
    text-align: center;
    padding: 28px 18px;
    border: 2px dashed #e8ddc7;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.pdfmg-upload-icon {
    font-size: 34px;
}

.pdfmg-upload-text {
    font-size: 16px;
    font-weight: 700;
    color: #2f2a24;
}

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

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

.pdfmg-empty-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #ede4d7;
    background: rgba(255, 255, 255, 0.82);
}

.pdfmg-preview-card {
    position: relative;
    display: grid;
    gap: 12px;
    align-content: start;
    padding: 18px;
}

.pdfmg-preview-badge {
    position: absolute;
    top: 18px;
    left: 18px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(47, 42, 36, 0.9);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.pdfmg-preview-image-wrap {
    min-height: 484px;
    display: grid;
    gap: 0;
    place-items: center;
    padding-top: 28px;
}

.pdfmg-preview-image {
    display: block;
    max-width: 100%;
    max-height: 440px;
    width: auto;
    height: auto;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 36px rgba(37, 30, 20, 0.16);
}

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

.pdfmg-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fcf8ef;
    border: 1px solid #efe2c0;
}

.pdfmg-waiting {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fffaf0;
    border: 1px solid #f0dca1;
}

.pdfmg-waiting.is-error {
    background: #fff2f0;
    border-color: #efb8b1;
}

.pdfmg-waiting-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    gap: 0;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(184, 134, 11, 0.12);
    font-size: 16px;
}

.pdfmg-waiting.is-error .pdfmg-waiting-icon {
    background: rgba(199, 84, 71, 0.12);
}

.pdfmg-waiting.is-error .pdfmg-waiting-icon i {
    color: #c75447;
}

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

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

.pdfmg-file-list {
    display: grid;
    gap: 10px;
    max-height: 560px;
    overflow-y: auto;
    padding-right: 2px;
}

.pdfmg-list-empty {
    padding: 20px 16px;
    border-radius: 14px;
    border: 1px dashed #e4dbcb;
    background: #fcfaf6;
    text-align: center;
}

.pdfmg-file-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid #ede4d7;
    background: #fffdf9;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.pdfmg-file-card.is-selected {
    border-color: #d9bd70;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14);
    transform: translateY(-1px);
}

.pdfmg-file-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: inherit;
}

.pdfmg-file-thumb {
    width: 72px;
    height: 96px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #ece3d3;
    overflow: hidden;
    display: grid;
    gap: 0;
    place-items: center;
    box-shadow: 0 6px 12px rgba(45, 42, 38, 0.08);
}

.pdfmg-file-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pdfmg-file-copy {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.pdfmg-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.pdfmg-row-index {
    display: inline-flex;
    gap: 0;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #fff7e6;
    border: 1px solid #eed6a0;
    font-size: 12px;
    font-weight: 700;
}

.pdfmg-list-name {
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    color: #2f2a24;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdfmg-list-meta {
    color: #645f59;
}

.pdfmg-file-actions,
.pdfmg-action-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.pdfmg-action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pdfmg-chip,
.pdfmg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.pdfmg-chip:hover:not(:disabled),
.pdfmg-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.pdfmg-chip:disabled,
.pdfmg-btn:disabled {
    opacity: 0.52;
    cursor: not-allowed;
}

.pdfmg-chip {
    min-height: 34px;
    padding: 0 10px;
    background: #fbf6ea;
    border-color: #ecdab2;
    color: #7b5b1f;
}

.pdfmg-chip.is-danger {
    background: #fff2f0;
    border-color: #f0c1ba;
    color: #b54f42;
}

.pdfmg-btn-primary {
    background: linear-gradient(135deg, #c89a1c 0%, #b8860b 100%);
    color: #fff;
    box-shadow: 0 6px 14px rgba(184, 134, 11, 0.18);
}

.pdfmg-btn-secondary {
    background: #fff8e8;
    border-color: #e6d29b;
    color: #7b5414;
}

.pdfmg-btn-ghost {
    background: #fdfbf7;
    border-color: #ded4c6;
    color: #5b544c;
}

.pdfmg-note-box {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fffaf0;
    border: 1px solid #f0dfb1;
}

.pdfmg-action-stack {
    display: grid;
    gap: 10px;
}

.pdfmg-note-box strong {
    font-size: 13px;
    color: #704d14;
}

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

.pdfmg-summary-card,
.pdfmg-result-card {
    display: grid;
    gap: 6px;
    min-height: 92px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fffdf9;
    border: 1px solid #ece4d5;
}

.pdfmg-summary-card-accent,
.pdfmg-result-card-accent {
    background: linear-gradient(135deg, #fff7e1 0%, #fffdf7 100%);
    border-color: #ecd390;
}

.pdfmg-summary-card-accent.is-ready {
    border-color: #d9bd70;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14);
}

.pdfmg-summary-label,
.pdfmg-result-label {
    font-size: 12px;
    font-weight: 700;
    color: #8a6d2d;
    letter-spacing: 0.01em;
}

.pdfmg-summary-value,
.pdfmg-result-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
    color: #2f2a24;
}

.pdfmg-summary-value-small,
.pdfmg-result-value-small {
    font-size: 16px;
    line-height: 1.4;
    word-break: break-word;
}

.pdfmg-table-wrap {
    overflow-x: auto;
    border: 1px solid #ece4d5;
    border-radius: 14px;
    background: #fffdf9;
}

.pdfmg-file-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.pdfmg-file-table th,
.pdfmg-file-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #eee6d7;
    text-align: left;
    font-size: 13px;
    color: #3c3834;
    vertical-align: middle;
}

.pdfmg-file-table thead th {
    background: #fcf7ee;
    font-size: 12px;
    font-weight: 700;
    color: #7d6631;
    white-space: nowrap;
}

.pdfmg-file-table tbody tr:last-child td {
    border-bottom: 0;
}

.pdfmg-file-table tbody tr.is-selected {
    background: rgba(212, 175, 55, 0.08);
}

.pdfmg-table-file {
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdfmg-table-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f9f4e7;
    border: 1px solid #ecdab2;
    color: #7a6330;
    font-size: 12px;
    font-weight: 700;
}

.pdfmg-empty-row {
    text-align: center;
    color: #726b64;
}

.pdfmg-disclaimer {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
    padding: 14px;
    background: linear-gradient(135deg, #faf7ef 0%, #ffffff 100%);
}

.pdfmg-disclaimer-text {
    font-size: 13px;
    line-height: 1.65;
    color: #5f5a56;
}

@media (max-width: 1180px) {
    .pdfmg-top-grid {
        grid-template-columns: 1fr;
    }

    .pdfmg-preview-shell {
        min-height: 480px;
    }
}

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

    .pdfmg-preview-image-wrap {
        min-height: 380px;
    }
}

@media (max-width: 640px) {
    .pdfmg-preview-section,
    .pdfmg-order-section,
    .pdfmg-action-section,
    .pdfmg-summary-section,
    .pdfmg-table-section,
    .pdfmg-result-section,
    .pdfmg-disclaimer {
        padding: 12px;
        border-radius: 14px;
    }


    .pdfmg-top-grid + .pdfmg-summary-section,
    .pdfmg-summary-section + .pdfmg-table-section,
    .pdfmg-table-section + .pdfmg-result-section,
    .pdfmg-result-section + .pdfmg-disclaimer {
        margin-top: 10px;
    }

    .pdfmg-section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .pdfmg-preview-shell {
        min-height: 420px;
    }

    .pdfmg-preview-image-wrap {
        min-height: 300px;
        padding-top: 24px;
    }

    .pdfmg-preview-image {
        max-height: 320px;
    }

    .pdfmg-empty-note-grid,
    .pdfmg-preview-meta,
    .pdfmg-summary-grid,
    .pdfmg-result-grid,
    .pdfmg-file-actions,
    .pdfmg-action-row {
        grid-template-columns: 1fr;
    }

    .pdfmg-file-main {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .pdfmg-file-thumb {
        width: 64px;
        height: 84px;
    }

    .pdfmg-summary-card,
    .pdfmg-result-card {
        min-height: 0;
    }

    .pdfmg-summary-value,
    .pdfmg-result-value {
        font-size: 22px;
    }

    .pdfmg-summary-value-small,
    .pdfmg-result-value-small {
        font-size: 15px;
    }
}
