/**
 * PDF Page Number Adder Styles
 * Styles for the Spanish PDF Page Number Adder
 *
 * @package Zipper
 */

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

.ppn-tool-intro {
    margin-bottom: 14px;
}

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

.ppn-main-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.ppn-input-col {
    position: sticky;
    top: 20px;
}

.ppn-result-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.ppn-input-section {
    max-width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    box-sizing: border-box;
}

.ppn-input-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
}

.ppn-input-title i {
    color: #d4af37;
}

.ppn-upload-area {
    border: 2px dashed #e8e4dc;
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    background: #faf9f7;
    cursor: pointer;
    transition: all 0.2s;
}

.ppn-upload-area:hover,
.ppn-upload-area.dragover {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.09);
}

.ppn-upload-icon {
    display: block;
    font-size: 30px;
    color: #d4af37;
    margin-bottom: 8px;
}

.ppn-upload-text {
    font-size: 13px;
    color: #5f5a56;
    margin-bottom: 4px;
}

.ppn-upload-hint {
    font-size: 11px;
    color: #9e988f;
}

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

.ppn-control-group,
.ppn-control-group-sub {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ppn-control-group {
    padding: 12px;
    border: 1px solid #ece7df;
    border-radius: 8px;
    background: #faf9f7;
}

.ppn-control-label {
    font-size: 12px;
    font-weight: 600;
    color: #5f5a56;
}

.ppn-helper-text {
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
    color: #7a746d;
}

.ppn-text-input,
.ppn-number-input,
.ppn-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 38px;
    border: 1px solid #ddd7cb;
    border-radius: 6px;
    background: #fff;
    padding: 0 10px;
    font-size: 13px;
    color: #2d2a26;
    box-sizing: border-box;
}

.ppn-text-input:focus,
.ppn-number-input:focus,
.ppn-select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.ppn-style-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 8px;
    align-items: end;
}

.ppn-color-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ppn-color-item label {
    font-size: 11px;
    font-weight: 600;
    color: #5f5a56;
}

.ppn-color-input {
    width: 100%;
    height: 36px;
    border: 1px solid #ddd7cb;
    border-radius: 6px;
    padding: 3px;
    box-sizing: border-box;
    cursor: pointer;
}

.ppn-range-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ppn-range-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.ppn-range-label {
    font-size: 12px;
    color: #5f5a56;
}

.ppn-range-value {
    font-size: 12px;
    font-weight: 700;
    color: #d4af37;
    white-space: nowrap;
}

.ppn-range {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #e8e4dc;
    outline: none;
    appearance: none;
    cursor: pointer;
}

.ppn-range::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ppn-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ppn-position-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.ppn-position-btn {
    height: 34px;
    border: 1px solid #ddd7cb;
    border-radius: 6px;
    background: #fff;
    color: #5f5a56;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ppn-position-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
}

.ppn-position-btn.active {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.14);
    color: #a67f07;
}

.ppn-radio-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ppn-radio-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #5f5a56;
}

.ppn-radio-item input {
    width: 16px;
    height: 16px;
    accent-color: #d4af37;
}

.ppn-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ppn-btn {
    height: 38px;
    border: 1px solid #ddd7cb;
    border-radius: 6px;
    background: #fff;
    color: #5f5a56;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ppn-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
}

.ppn-btn:disabled {
    border-color: #ece7df;
    background: #f3f1ed;
    color: #b5afa9;
    cursor: not-allowed;
}

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

.ppn-btn-primary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(212, 175, 55, 0.3);
}

.ppn-btn-primary:disabled {
    border: 1px solid #ece7df;
    background: #e8e4dc;
    color: #a09a94;
    box-shadow: none;
    transform: none;
}

.ppn-waiting {
    border: 1px solid #f0d2d5;
    border-radius: 12px;
    background: #fff4f5;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ppn-waiting-icon {
    color: #c62828;
    font-size: 20px;
}

.ppn-waiting-title {
    font-size: 14px;
    font-weight: 700;
    color: #7f1d1d;
}

.ppn-waiting-desc {
    margin: 0;
    font-size: 12px;
    color: #9f3232;
    line-height: 1.5;
}

.ppn-preview-section {
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ppn-preview-placeholder {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 24px;
    background: #faf9f7;
    color: #8f8a84;
    font-size: 13px;
    line-height: 1.6;
}

.ppn-preview-canvas-wrap {
    min-height: 280px;
    max-height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow: hidden;
    padding: 12px;
    background: #f8f8f8;
    box-sizing: border-box;
}

.ppn-preview-canvas {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.ppn-preview-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 10px 14px;
    border-top: 1px solid #e8e4dc;
    background: #faf9f7;
    font-size: 12px;
    color: #5f5a56;
}

.ppn-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ppn-meta-item i {
    color: #d4af37;
}

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

.ppn-summary-card {
    min-width: 0;
    border: 1px solid #ece7df;
    border-radius: 10px;
    background: #fff;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ppn-summary-label {
    font-size: 11px;
    color: #8d877f;
}

.ppn-summary-value {
    font-size: 15px;
    font-weight: 700;
    color: #2d2a26;
    word-break: break-word;
}

.ppn-pages-section {
    min-width: 0;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    background: #fff;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ppn-pages-title {
    margin: 0;
    font-size: 15px;
    color: #2d2a26;
}

.ppn-page-list-text {
    margin: 0;
    font-size: 12px;
    color: #5f5a56;
    line-height: 1.5;
}

.ppn-page-list-text.is-error {
    color: #b3261e;
}

.ppn-page-table-wrap {
    max-width: 100%;
    border: 1px solid #ece7df;
    border-radius: 8px;
    overflow-x: auto;
}

.ppn-page-table {
    width: 100%;
    min-width: 440px;
    border-collapse: collapse;
    font-size: 12px;
}

.ppn-page-table th,
.ppn-page-table td {
    border-bottom: 1px solid #f0ebe3;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}

.ppn-page-table th {
    background: #f8f6f2;
    color: #6a655f;
    font-weight: 700;
}

.ppn-page-table tbody tr:last-child td {
    border-bottom: 0;
}

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

.ppn-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(108, 117, 125, 0.08);
}

.ppn-note i {
    color: #6c757d;
    font-size: 16px;
    margin-top: 1px;
}

.ppn-note-text {
    font-size: 12px;
    line-height: 1.5;
    color: #5f5a56;
}

@media (max-width: 900px) {
    .ppn-main-layout {
        grid-template-columns: 300px minmax(0, 1fr);
        gap: 14px;
    }

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

@media (max-width: 768px) {
    .ppn-main-layout {
        grid-template-columns: 1fr;
    }

    .ppn-result-col {
        order: 1;
    }

    .ppn-input-col {
        order: 2;
        position: static;
    }

    .ppn-preview-placeholder,
    .ppn-preview-canvas-wrap {
        min-height: 220px;
        max-height: 430px;
    }
}

@media (max-width: 480px) {
    .ppn-style-row,
    .ppn-actions,
    .ppn-summary-grid {
        grid-template-columns: 1fr;
    }

    .ppn-radio-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .ppn-range-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
