/**
 * UPI Order Actions — My Account orders page styles
 *
 * Covers:
 *   - "Submit Proof / Pay" button on PENDING orders (blue)
 *   - "Submit Proof / Retry Payment" button on CANCELLED orders (orange)
 *   - Full-page spinner overlay during AJAX reorder (cancelled flow only)
 *   - Inline error message under the button
 *
 * All selectors prefixed .upi-oa- to avoid theme conflicts.
 *
 * @package  Custom_UPI_Gateway
 * @since    3.4
 */

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
    --upi-oa-blue: #2563eb;
    --upi-oa-blue-dark: #1d4ed8;
    --upi-oa-red: #dc2626;
    --upi-oa-border: #e2e8f0;
    --upi-oa-muted: #64748b;
    --upi-oa-transition: 0.15s ease;
}

/* ── Submit Proof / Pay — PENDING orders (blue) ──────────────────────────── */
/* This is a direct link (no AJAX), navigates straight to order-pay + QR popup */
.woocommerce-orders-table .button.upi_submit_proof {
    background: var(--upi-oa-blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--upi-oa-transition);
    text-decoration: none;
    display: inline-block;
}

.woocommerce-orders-table .button.upi_submit_proof:hover {
    background: var(--upi-oa-blue-dark);
    color: #fff;
}

/* Cancelled orders — override to orange to visually distinguish retry vs pay */
.woocommerce-orders-table tr.order-status-cancelled .button.upi_submit_proof,
.woocommerce-orders-table .order-status-cancelled .button.upi_submit_proof {
    background: #fff7ed;
    color: #c2410c;
    border: 1.5px solid #fed7aa;
}

.woocommerce-orders-table tr.order-status-cancelled .button.upi_submit_proof:hover,
.woocommerce-orders-table .order-status-cancelled .button.upi_submit_proof:hover {
    background: #ea580c;
    color: #fff;
    border-color: #ea580c;
}

.woocommerce-orders-table .button.upi_submit_proof.upi-oa-loading {
    opacity: 0.65;
    cursor: wait;
}

/* ── Full-page spinner overlay (cancelled orders AJAX reorder only) ──────── */
#upi-oa-page-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 40, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.upi-oa-overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

/* Rotating spinner ring */
.upi-oa-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: upiOaSpin 0.75s linear infinite;
}

@keyframes upiOaSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Inline error message ────────────────────────────────────────────────── */
.upi-oa-inline-error {
    display: block;
    margin-top: 6px;
    padding: 6px 10px;
    background: #fff1f2;
    color: var(--upi-oa-red);
    border: 1px solid #fecdd3;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* ════════════════════════════════════════════════════════════════════════════
   NOTICE BANNER — above My Account orders list
   ════════════════════════════════════════════════════════════════════════════ */

.upi-oa-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -24px 0 12px;
    padding: 10px 14px;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    font-size: 12.5px;
    color: #78350f;
    line-height: 1.55;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.upi-oa-notice__icon {
    font-size: 16px;
    flex-shrink: 0;
}

.upi-oa-notice__body {
    flex: 1;
    min-width: 0;
}

/* Reset theme styles on bold text inside notice (themes add borders/underlines) */
.upi-oa-notice strong {
    border: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    background: none !important;
    padding: 0 !important;
}

/* WhatsApp: simple inline underlined text link, no button */
.upi-oa-notice__wa {
    color: #059669;
    font-weight: 600;
    text-decoration: underline;
    margin-left: 4px;
    white-space: nowrap;
}

.upi-oa-notice__wa:hover {
    color: #047857;
}

/* Fix: browser auto-focuses the anchor on page load → shows black outline.
   Remove outline on mouse/touch focus; keep it for keyboard navigation only. */
.upi-oa-notice a:focus,
.upi-oa-notice strong:focus,
.upi-oa-notice *:focus {
    outline: none !important;
    box-shadow: none !important;
}

.upi-oa-notice a:focus-visible {
    outline: 2px solid #059669 !important;
    border-radius: 2px;
}

/* Mobile: allow wrapping */
@media (max-width: 600px) {
    .upi-oa-notice {
        align-items: flex-start;
        font-size: 12px;
    }

    .upi-oa-notice__wa {
        display: inline;
        white-space: normal;
    }
}