/* ==========================================================================
   WooCommerce Payment Proof Upload — Frontend & Admin Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Shared wrapper — used in thank-you page, my-account, and guest lookup
   -------------------------------------------------------------------------- */

.wppu-wrapper [hidden] {
    display: none !important;
}

.wppu-wrapper,
.wppu-lookup-form,
.wppu-bank-details {
    border: 1px solid #e2e8f0;
    padding: 24px;
    margin: 24px 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    box-sizing: border-box;
}

.wppu-wrapper h2,
.wppu-lookup-form h2,
.wppu-bank-details h2,
.wppu-bank-details h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1a1a1a;
}

.wppu-help {
    margin: 0 0 16px;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Proof history — card grid (frontend)
   -------------------------------------------------------------------------- */

.wppu-existing {
    margin-bottom: 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
}

.wppu-existing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 6px;
}

.wppu-existing-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
}

.wppu-proof-count {
    font-size: 12px;
    color: #64748b;
    background: #e2e8f0;
    border-radius: 999px;
    padding: 2px 10px;
}

/* Card grid */
.wppu-proof-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.wppu-proof-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 12px 12px;
    gap: 8px;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.wppu-proof-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    border-color: #cbd5e1;
}

.wppu-proof-card-icon {
    color: #3b82f6;
    flex-shrink: 0;
}

.wppu-proof-card-icon svg {
    width: 36px;
    height: 36px;
    display: block;
}

.wppu-proof-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
}

.wppu-proof-card-name {
    font-weight: 600;
    font-size: 12px;
    color: #1a1a1a;
    word-break: break-all;
    overflow-wrap: break-word;
    /* Clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
}

.wppu-proof-card-date {
    font-size: 11px;
    color: #94a3b8;
}

.wppu-proof-card-note {
    font-size: 11px;
    color: #475569;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-style: italic;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wppu-proof-card-dl {
    margin-top: auto;
    font-size: 12px;
    padding: 5px 12px !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Upload form — dropzone
   -------------------------------------------------------------------------- */

.wppu-form-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

/* Dropzone wrapper — the <label> that wraps the hidden <input type="file"> */
.wppu-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 32px 20px;
    cursor: pointer;
    background: #f8fafc;
    transition: border-color 0.15s ease, background 0.15s ease;
    position: relative;
    touch-action: manipulation;
}

.wppu-dropzone:hover,
.wppu-dropzone:focus-within {
    border-color: #3b82f6;
    background: #eff6ff;
}

.wppu-dropzone:focus-visible {
    outline: 3px solid rgba(59,130,246,.25);
    outline-offset: 3px;
}

.wppu-dropzone.wppu-drag-over {
    border-color: #2563eb;
    background: #dbeafe;
}

.wppu-dropzone-icon svg {
    width: 40px;
    height: 40px;
    color: #3b82f6;
    opacity: 0.8;
}

.wppu-dropzone-label {
    font-size: 14px;
    color: #334155;
    line-height: 1.4;
}

.wppu-dropzone-label strong {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wppu-dropzone-types {
    font-size: 12px;
    color: #94a3b8;
}

/* The actual <input type="file"> is visually hidden but accessible */
.wppu-dropzone-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Shown after a file is selected */
.wppu-dropzone-chosen {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #1e3a8a;
}

.wppu-dropzone-chosen-icon svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #2563eb;
}

.wppu-dropzone-chosen-text {
    flex: 1;
    min-width: 0;
}

.wppu-dropzone-chosen-status {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #1d4ed8;
    margin-bottom: 2px;
}

.wppu-dropzone-chosen-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: #0f172a;
}

.wppu-dropzone-clear {
    background: none;
    border: none;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 0 2px;
    flex-shrink: 0;
    transition: color 0.1s;
}

.wppu-dropzone-clear:hover {
    color: #dc2626;
}

.wppu-upload-followup {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}

.wppu-upload-next-step {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #0f172a;
}

.wppu-upload-next-step strong {
    color: #1d4ed8;
}

/* --------------------------------------------------------------------------
   Form fields (note, billing email)
   -------------------------------------------------------------------------- */

.wppu-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wppu-field label,
.wppu-lookup-form label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
}

.wppu-field input[type="text"],
.wppu-field input[type="email"],
.wppu-lookup-form input[type="text"],
.wppu-lookup-form input[type="email"] {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 14px;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
    color: #1a1a1a;
}

.wppu-field input[type="text"]:focus,
.wppu-field input[type="email"]:focus,
.wppu-lookup-form input[type="text"]:focus,
.wppu-lookup-form input[type="email"]:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.wppu-field-hint {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

.wppu-optional {
    font-weight: 400;
    font-size: 12px;
    color: #94a3b8;
    margin-left: 3px;
}

/* --------------------------------------------------------------------------
   Upload button, progress bar, messages
   -------------------------------------------------------------------------- */

.wppu-submit,
.wppu-lookup-submit {
    margin-top: 4px;
}

.wppu-upload-followup .wppu-submit {
    align-self: flex-start;
    margin-top: 0;
}

.wppu-message {
    margin-top: 14px;
    font-size: 14px;
}

.wppu-inline-help {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
}

.wppu-success {
    color: #166534;
    font-weight: 600;
}

.wppu-error {
    color: #991b1b;
    font-weight: 600;
}

.is-uploading .wppu-submit,
.wppu-submit[disabled] {
    opacity: .55;
    cursor: not-allowed;
}

.wppu-upload-progress {
    margin-top: 16px;
}

.wppu-upload-progress-bar {
    position: relative;
    overflow: hidden;
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
}

.wppu-upload-progress-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: #3b82f6;
    transition: width .2s ease;
}

.wppu-upload-progress-text {
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
}

/* --------------------------------------------------------------------------
   Guest lookup form
   -------------------------------------------------------------------------- */

.wppu-lookup-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 20px;
    margin-bottom: 16px;
}

.wppu-lookup-fields p {
    margin: 0;
}

.wppu-lookup-return {
    margin-top: 16px;
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   Admin proof history (inside order meta box — narrow sidebar)
   -------------------------------------------------------------------------- */

.wppu-admin-meta-box .wppu-existing {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 14px;
}

.wppu-proof-history {
    margin: 10px 0 0;
    padding-left: 16px;
}

.wppu-proof-history-item + .wppu-proof-history-item {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.wppu-proof-history-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

.wppu-proof-history-title {
    font-weight: 600;
    font-size: 12px;
    word-break: break-all;
}

.wppu-proof-history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
}

.wppu-pdf-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}

.wppu-view-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Verification status badges (admin)
   -------------------------------------------------------------------------- */

.wppu-status-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    vertical-align: middle;
}

.wppu-status-pending  { background: #f1f5f9; color: #475569; }
.wppu-status-verified { background: #dcfce7; color: #166534; }
.wppu-status-rejected { background: #fee2e2; color: #991b1b; }

.wppu-verify-btn,
.wppu-reject-btn {
    margin-left: 2px;
}

/* --------------------------------------------------------------------------
   Queue table (admin screen)
   -------------------------------------------------------------------------- */

.wppu-proof-table .button {
    margin: 2px 4px 2px 0;
}
