/* Frontend styles for Print Proof Portal */

.ppp-wrapper {
    padding: 40px 16px;
    background: linear-gradient(135deg, #f4f6fb, #ffffff);
    display: flex;
    justify-content: center;
    font-family: inherit;
}

.ppp-card {
    max-width: 1180px;
    width: 100%;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    padding: 28px 28px 32px;
    box-sizing: border-box;
}

.ppp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ppp-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.25;
    font-weight: 600;
    color: #111827;
}

.ppp-subtitle {
    margin: 6px 0 0;
    color: #4b5563;
    font-size: 14px;
}

.ppp-label {
    font-weight: 500;
    margin-right: 6px;
}

.ppp-email {
    color: #2563eb;
}

.ppp-status-badge {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ppp-status-draft {
    background: #e5e7eb;
    color: #374151;
}

.ppp-status-sent {
    background: #eff6ff;
    color: #1d4ed8;
}

.ppp-status-approved {
    background: #ecfdf5;
    color: #15803d;
}

.ppp-status-changes_requested {
    background: #fff7ed;
    color: #c2410c;
}

.ppp-alert {
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-size: 14px;
}

.ppp-alert-success {
    border: 1px solid #bbf7d0;
    background: #ecfdf3;
    color: #166534;
}

.ppp-alert-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.ppp-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 24px;
    margin-top: 10px;
}

.ppp-section-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.ppp-helper {
    margin: 0 0 14px;
    font-size: 13px;
    color: #6b7280;
}

.ppp-left {
    min-width: 0;
}

.ppp-right {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ppp-proof-card {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 14px;
}

.ppp-proof-link {
    margin: 0 0 10px;
    font-size: 13px;
}

.ppp-proof-link a {
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 500;
}

.ppp-proof-link a:hover {
    text-decoration: underline;
}

.ppp-preview-frame {
    border-radius: 0;
    overflow: hidden;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.ppp-preview-frame img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0;
}

.ppp-preview-placeholder {
    border-radius: 10px;
    border: 1px dashed #9ca3af;
    padding: 18px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    background: #f9fafb;
}

.ppp-file-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
}

.ppp-file-list li {
    margin: 2px 0;
}

.ppp-panel {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 16px 16px 18px;
}

.ppp-order-detail p {
    margin: 0 0 6px;
    font-size: 13px;
    color: #374151;
}

.ppp-form {
    margin-top: 6px;
}

.ppp-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #374151;
}

.ppp-check input[type="checkbox"] {
    margin-top: 2px;
}

.ppp-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ppp-btn {
    border-radius: 999px;
    border: none;
    cursor: pointer;
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.05s ease-out, box-shadow 0.05s ease-out, background-color 0.1s ease-out;
}

.ppp-btn-approve {
    background: #16a34a;
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(22, 163, 74, 0.25);
}

.ppp-btn-approve:hover {
    background: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(22, 163, 74, 0.32);
}

.ppp-btn-changes {
    background: #f97316;
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(249, 115, 22, 0.25);
}

.ppp-btn-changes:hover {
    background: #ea580c;
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(249, 115, 22, 0.32);
}

.ppp-textarea {
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    padding: 10px 12px;
    font-size: 13px;
    resize: vertical;
    min-height: 120px;
}

.ppp-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb33;
}

@media (max-width: 900px) {
    .ppp-card {
        padding: 20px 18px 24px;
    }

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

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

    .ppp-status-badge {
        margin-top: 4px;
    }
}

@media (max-width: 600px) {
    .ppp-wrapper {
        padding: 24px 8px;
    }

    .ppp-title {
        font-size: 20px;
    }
}

.ppp-proof-file {
    margin-bottom: 14px;
    text-align: center;
}

.ppp-file-name {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 6px;
    word-break: break-word;
}

.ppp-preview-frame.ppp-preview-pdf {
    background: #f9fafb;
    padding: 0;
}

.ppp-preview-frame.ppp-preview-pdf iframe {
    width: 100%;
    height: 480px;
    border: none;
    display: block;
    background: #f9fafb;
}

/* Phase 2: PDF first-page style */
.ppp-preview-frame.ppp-preview-pdf {
    overflow: hidden;
}

.ppp-preview-frame.ppp-preview-pdf iframe {
    height: 420px;
    border: none;
    display: block;
}

/* Phase 2: optional watermark overlay class (for future use) */
.ppp-preview-frame.ppp-watermarked {
    position: relative;
}

.ppp-preview-frame.ppp-watermarked::before {
    content: "PROOF";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    font-size: 32px;
    font-weight: 700;
    color: rgba(255,255,255,0.75);
    text-shadow: 0 0 4px rgba(0,0,0,0.7);
    pointer-events: none;
    z-index: 2;
}

/* PDF image preview (generated from first page) */
.ppp-preview-frame.ppp-preview-pdf-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

/* Change history list under Request Changes */
.ppp-change-history {
    margin-top: 16px;
    font-size: 13px;
}
.ppp-change-history .ppp-section-subtitle {
    font-size: 11px !important;
    font-weight: 600;
    margin: 0 0 4px;
}


.ppp-change-history-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.ppp-change-history-list li {
    margin-bottom: 6px;
}

.ppp-change-history-meta {
    display: block;
    font-weight: 500;
    color: #4b5563;
}

.ppp-change-history-text {
    display: block;
    color: #374151;
}

/* Compact one-line change history entries */
.ppp-change-history-list li {
    margin-bottom: 4px;
}

.ppp-change-history-meta,
.ppp-change-history-text {
    display: inline;
}

/* Make artwork previews smaller */
.ppp-preview-frame img {
    max-height: 420px;
    width: auto;
}

.ppp-preview-frame.ppp-preview-pdf iframe {
    height: 360px;
}

/* Force change history entries to be single-line: DATE: message */
.ppp-change-history-list li {
    margin-bottom: 2px;
    white-space: normal;
}

.ppp-change-history-list li .ppp-change-history-meta,
.ppp-change-history-list li .ppp-change-history-text {
    display: inline !important;
}

.ppp-change-history-list li .ppp-change-history-meta::after {
    content: " ";
}

/* Compact change history li after markup simplification */
.ppp-change-history-list li {
    margin-bottom: 4px;
}


/* Per-set card wrapper */
.ppp-set-layout {
    margin-top: 16px;
    margin-bottom: 18px;
    padding: 18px 18px 20px;
    border-radius: 16px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}


/* Per-set status badge */
.ppp-set-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    vertical-align: middle;
    line-height: 1;
}

.ppp-set-status-approved {
    background: #dcfce7;
    color: #166534;
}

.ppp-set-status-changes {
    background: #ffedd5;
    color: #9a3412;
}

.ppp-set-status-generic {
    background: #e5e7eb;
    color: #374151;
}


/* PROOF watermark overlay on previews */
.ppp-has-watermark {
    position: relative;
    overflow: hidden;
}

.ppp-has-watermark::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Ctext x='0' y='60' fill='black' fill-opacity='0.4' font-size='40' font-family='Arial, sans-serif' transform='rotate(-45 110 110)'%3EPROOF%3C/text%3E%3C/svg%3E");
    background-repeat: repeat;
}


.ppp-has-watermark::after {
    content: "PROOF";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 64px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
    pointer-events: none;
    white-space: nowrap;
}


/* Simple proof zoom modal */
.ppp-proof-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.ppp-proof-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.ppp-proof-modal-dialog {
    position: relative;
    width: auto;
    max-width: 60vw;
    max-height: 60vh;
    margin: 0 auto;
    background: #111827;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
}

.ppp-proof-modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    border: 0;
    background: transparent;
    color: #f9fafb;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.ppp-proof-modal-body {
    padding: 16px 16px 16px;
}

.ppp-proof-modal-inner {
    text-align: center;
}

.ppp-proof-modal-inner img {
    max-width: 60vw;
    max-height: 60vh;
    height: auto;
    border-radius: 8px;
}
