/**
 * PDF Page Rotator Styles
 * Styles for the Spanish PDF Page Rotator tool
 *
 * @package Zipper
 */

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

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

/* JS / semantic hook classes */
.ppr-control,
.ppr-current-card,
.ppr-range-card,
.ppr-range-action,
.ppr-bulk-card,
.ppr-summary-card,
.ppr-download-card {}

.ppr-stage-section,
.ppr-panel-card,
.ppr-thumb-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-panel-card,
.ppr-thumb-section {
    padding: 16px;
}

.ppr-thumb-section,
.ppr-disclaimer {
    grid-column: 1 / -1;
}

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

.ppr-tool-intro,
.ppr-stage-head,
.ppr-section-head,
.ppr-preview-meta,
.ppr-waiting,
.ppr-waiting-copy,
.ppr-preview-pane,
.ppr-preview-toolbar,
.ppr-preview-page-field,
.ppr-page-input-row,
.ppr-side-column,
.ppr-side-grid,
.ppr-inline-notes,
.ppr-action-grid,
.ppr-summary-grid,
.ppr-thumb-grid,
.ppr-thumb-footer,
.ppr-thumb-meta,
.ppr-thumb-actions,
.ppr-disclaimer,
.ppr-upload-area,
.ppr-range-box,
.ppr-download-row {
    min-width: 0;
}

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

.ppr-tool-lead,
.ppr-section-lead,
.ppr-range-hint,
.ppr-summary-note,
.ppr-download-help,
.ppr-thumb-empty,
.ppr-preview-empty p,
.ppr-waiting-desc,
.ppr-disclaimer-text {
    margin: 0;
    font-size: 13px;
    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-inline-note i,
.ppr-disclaimer i,
.ppr-waiting-icon i,
.ppr-preview-empty-icon i,
.ppr-upload-icon i {
    color: #d4af37;
}

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

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

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

.ppr-preview-pane,
.ppr-side-column,
.ppr-bottom-grid,
.ppr-range-box,
.ppr-empty-copy {
    display: grid;
    gap: 12px;
}

#pprEmptyState,
.ppr-empty-state {
    display: grid;
}

#pprEmptyState > .ppr-preview-empty,
.ppr-preview-empty {
    display: grid;
    gap: 14px;
    align-items: center;
    justify-items: stretch;
    min-height: 268px;
    padding: 20px;
    border: 1px dashed #e8e4dc;
    border-radius: 12px;
    background: #faf9f7;
}

.ppr-empty-copy {
    justify-items: center;
    text-align: center;
}

.ppr-preview-empty-icon {
    font-size: 36px;
}

#pprUploadArea,
.ppr-upload-area {
    display: grid;
    gap: 6px;
    justify-items: center;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 22px 16px;
    border: 2px dashed #e8e4dc;
    border-radius: 12px;
    background: #faf9f7;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#pprUploadArea:hover,
.ppr-upload-area:hover,
.ppr-stage-section.is-dragover #pprUploadArea,
.ppr-stage-section.is-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: 30px;
}

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

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

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

.ppr-inline-notes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.ppr-inline-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid #ece7df;
    border-radius: 999px;
    background: #fff;
    font-size: 11px;
    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-preview-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: end;
}

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

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

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

.ppr-page-input,
.ppr-range-input {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #d9d3c8;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    color: #1a1816;
    box-sizing: border-box;
}

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

.ppr-page-total {
    font-size: 12px;
    color: #7c756d;
}

.ppr-preview-shell {
    position: relative;
    display: grid;
    justify-items: center;
    padding: 18px;
    border-radius: 12px;
    background: linear-gradient(180deg, #f7f4ee 0%, #fdfbf7 100%);
    border: 1px solid #ece7df;
    overflow: auto;
}

.ppr-preview-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(26, 24, 22, 0.78);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.ppr-preview-badge.is-rotated {
    background: rgba(212, 175, 55, 0.92);
    color: #2d2a26;
}

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

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

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

.ppr-panel-card {
    display: grid;
    gap: 12px;
}

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

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

.ppr-action-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ppr-action-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 12px;
    border: 1px solid #ddd7cc;
    border-radius: 10px;
    background: #faf9f7;
    color: #3b3834;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ppr-action-chip:hover:not(:disabled) {
    border-color: #d4af37;
    color: #9f7807;
    background: rgba(212, 175, 55, 0.08);
    transform: translateY(-1px);
}

.ppr-action-chip:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

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

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

.ppr-summary-item-accent {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.1) 0%, rgba(212, 175, 55, 0.04) 100%);
    border-color: rgba(212, 175, 55, 0.32);
}

.ppr-summary-item.is-ready {
    border-color: rgba(46, 125, 50, 0.28);
    background: rgba(46, 125, 50, 0.06);
}

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

.ppr-summary-value {
    font-size: 20px;
    font-weight: 800;
    color: #1a1816;
    line-height: 1.1;
}

.ppr-summary-value-small {
    font-size: 15px;
}

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

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

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

.ppr-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.ppr-btn-primary {
    background: #faf7f2;
    color: #8a6500;
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.16);
}

.ppr-btn-primary:hover:not(:disabled) {
    background: #f7f0e1;
    color: #7a5800;
    box-shadow: 0 8px 18px rgba(212, 175, 55, 0.2);
}

.ppr-btn-secondary,
.ppr-btn-ghost {
    background: #faf9f7;
    color: #5f5a56;
    border-color: #ddd7cc;
}

.ppr-btn-secondary:hover:not(:disabled),
.ppr-btn-ghost:hover:not(:disabled) {
    border-color: #d4af37;
    color: #9f7807;
    background: rgba(212, 175, 55, 0.08);
}

.ppr-thumb-progress {
    font-size: 12px;
    font-weight: 600;
    color: #7c756d;
}

.ppr-thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.ppr-thumb-empty {
    padding: 18px;
    border: 1px dashed #ddd7cc;
    border-radius: 10px;
    background: #faf9f7;
    text-align: center;
}

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

.ppr-thumb-card.is-active {
    border-color: rgba(212, 175, 55, 0.42);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.12);
}

.ppr-thumb-card.is-rotated {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.08) 0%, rgba(255, 255, 255, 1) 100%);
}

.ppr-thumb-preview-btn {
    position: relative;
    display: grid;
    gap: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.ppr-thumb-status-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(26, 24, 22, 0.76);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.ppr-thumb-status-badge.is-rotated {
    background: rgba(212, 175, 55, 0.95);
    color: #2d2a26;
}

.ppr-thumb-canvas-wrap {
    display: grid;
    place-items: center;
    min-height: 170px;
    padding: 12px;
    border-radius: 10px;
    background: #f8f5ee;
    border: 1px solid #eee8dc;
}

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

.ppr-thumb-render-fallback {
    text-align: center;
    font-size: 11px;
    line-height: 1.5;
    color: #7c756d;
}

.ppr-thumb-footer {
    display: grid;
    gap: 8px;
}

.ppr-thumb-meta {
    display: grid;
    gap: 2px;
}

.ppr-thumb-label {
    font-size: 12px;
    font-weight: 700;
    color: #1a1816;
}

.ppr-thumb-rotation {
    font-size: 11px;
    color: #7c756d;
}

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

.ppr-thumb-action-btn {
    min-height: 34px;
    padding: 8px 6px;
    border: 1px solid #ddd7cc;
    border-radius: 8px;
    background: #faf9f7;
    font-size: 11px;
    font-weight: 600;
    color: #4b4640;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.ppr-thumb-action-btn:hover {
    border-color: #d4af37;
    color: #9f7807;
    background: rgba(212, 175, 55, 0.08);
}

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

@media (max-width: 1080px) {
    .ppr-workbench {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .ppr-stage-head,
    .ppr-section-head {
        flex-direction: column;
    }

    .ppr-side-column {
        gap: 10px;
    }
}

@media (max-width: 720px) {
    .ppr-stage-section,
    .ppr-panel-card,
    .ppr-thumb-section {
        padding: 14px;
    }

    .ppr-preview-toolbar,
    .ppr-summary-grid,
    .ppr-preview-meta,
    .ppr-download-row,
    .ppr-action-grid-two,
    .ppr-action-grid-three {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .ppr-preview-empty {
        min-height: 224px;
        padding: 16px;
    }

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


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

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

    .ppr-btn:hover,
    .ppr-action-chip:hover,
    .ppr-thumb-action-btn:hover {
        transform: none !important;
    }
}
