/*
 * Miracle Payment Escrow — Checkout & Admin Styles
 * Brand: navy (#1a2744) + gold (#D4AF37), Sora font, mobile-first.
 */

/* ── Variables ────────────────────────────────────────────────────────── */
:root {
    --mpe-navy:      #1a2744;
    --mpe-navy-lt:   #253560;
    --mpe-gold:      #D4AF37;
    --mpe-gold-lt:   #f0d060;
    --mpe-green:     #27ae60;
    --mpe-red:       #e74c3c;
    --mpe-orange:    #e67e22;
    --mpe-gray:      #7f8c8d;
    --mpe-surface:   rgba(26, 39, 68, 0.06);
    --mpe-radius:    12px;
    --mpe-font:      'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ══════════════════════════════════════════════════════════════════════
 * CHECKOUT WIDGET
 * ══════════════════════════════════════════════════════════════════════ */

.mpe-checkout-widget {
    background: var(--mpe-surface);
    border: 1.5px solid rgba(212, 175, 55, 0.25);
    border-radius: var(--mpe-radius);
    padding: 16px;
    margin-top: 12px;
    font-family: var(--mpe-font);
    animation: mpe-fade-in 0.3s ease;
}

@keyframes mpe-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Token logo */
.mpe-token-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 50%;
    margin-bottom: 10px;
    display: block;
}

/* Description */
.mpe-description {
    font-size: 13px;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Balance row */
.mpe-balance-row {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.mpe-balance-item {
    flex: 1;
    background: #fff;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 0;
}

.mpe-balance-item .mpe-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--mpe-navy);
    opacity: 0.6;
    margin-bottom: 4px;
}

.mpe-balance-item .mpe-value {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--mpe-navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* DVC currency equivalent */
.mpe-dvc-row {
    font-size: 12px;
    color: var(--mpe-gray);
    text-align: center;
    margin-bottom: 10px;
    padding: 6px 10px;
    background: rgba(212, 175, 55, 0.08);
    border-radius: 6px;
}

.mpe-dvc-row strong {
    color: var(--mpe-navy);
}

/* Notices */
.mpe-notice {
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mpe-notice::before {
    font-size: 16px;
    flex-shrink: 0;
}

.mpe-notice--success {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid rgba(39, 174, 96, 0.3);
    color: #1a5c34;
}
.mpe-notice--success::before { content: '✓'; }

.mpe-notice--error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #8b1a1a;
}
.mpe-notice--error::before { content: '✕'; }

.mpe-notice--warn {
    background: rgba(230, 126, 34, 0.1);
    border: 1px solid rgba(230, 126, 34, 0.3);
    color: #7a4000;
}
.mpe-notice--warn::before { content: '⚠'; }

/* Loading spinner */
.mpe-loading {
    text-align: center;
    color: var(--mpe-gray);
    font-size: 13px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mpe-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-top-color: var(--mpe-gold);
    border-radius: 50%;
    animation: mpe-spin 0.7s linear infinite;
}

@keyframes mpe-spin {
    to { transform: rotate(360deg); }
}

/* Mobile: stack balance items vertically on very small screens */
@media (max-width: 380px) {
    .mpe-balance-row { flex-direction: column; }
}

/* ══════════════════════════════════════════════════════════════════════
 * ADMIN PANEL
 * ══════════════════════════════════════════════════════════════════════ */

.mpe-admin-wrap {
    font-family: var(--mpe-font);
}

/* Stats row */
.mpe-admin-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.mpe-stat-card {
    background: #fff;
    border-radius: var(--mpe-radius);
    padding: 16px 20px;
    min-width: 160px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    flex: 1;
}

.mpe-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 6px;
}

.mpe-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--mpe-navy);
    margin-bottom: 2px;
}

.mpe-stat-sub {
    font-size: 12px;
    color: #aaa;
}

/* Filter bar */
.mpe-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.mpe-filters select,
.mpe-filters input[type="text"] {
    height: 32px;
    border-radius: 6px;
    border: 1px solid #ddd;
    padding: 0 10px;
    font-size: 13px;
}

/* Admin table */
.mpe-admin-table {
    border-radius: var(--mpe-radius);
    overflow: hidden;
    font-size: 13px;
}

.mpe-admin-table th {
    background: var(--mpe-navy);
    color: #fff;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 12px;
}

.mpe-admin-table td {
    padding: 10px 12px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

.mpe-admin-table tr:hover td {
    background: rgba(212, 175, 55, 0.04);
}

/* Status badges */
.mpe-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.mpe-badge--gold   { background: rgba(212, 175, 55, 0.18); color: #7a5c00; }
.mpe-badge--green  { background: rgba(39, 174, 96, 0.15);  color: #1a5c34; }
.mpe-badge--red    { background: rgba(231, 76, 60, 0.15);  color: #8b1a1a; }
.mpe-badge--orange { background: rgba(230, 126, 34, 0.15); color: #7a4000; }
.mpe-badge--gray   { background: #f0f0f0;                  color: #555; }

/* Pagination */
.mpe-pagination {
    margin-top: 16px;
    display: flex;
    gap: 4px;
}

/* Action buttons */
.mpe-btn-release,
.mpe-btn-refund {
    font-size: 12px !important;
    padding: 3px 10px !important;
    height: auto !important;
}

.mpe-btn-refund {
    background: rgba(231, 76, 60, 0.08) !important;
    border-color: rgba(231, 76, 60, 0.4) !important;
    color: #c0392b !important;
}

.mpe-btn-refund:hover {
    background: rgba(231, 76, 60, 0.18) !important;
}
