/* =============================================
   WP Card Manager – Frontend Styles
   ============================================= */

:root {
    --wpcm-primary:    #2563eb;
    --wpcm-primary-d:  #1d4ed8;
    --wpcm-visa:       #1a1f71;
    --wpcm-master:     #eb001b;
    --wpcm-master-2:   #f79e1b;
    --wpcm-success:    #16a34a;
    --wpcm-danger:     #dc2626;
    --wpcm-text:       #111827;
    --wpcm-muted:      #6b7280;
    --wpcm-border:     #e5e7eb;
    --wpcm-bg:         #f9fafb;
    --wpcm-white:      #ffffff;
    --wpcm-radius:     12px;
    --wpcm-shadow:     0 4px 24px rgba(0,0,0,.08);
}

.wpcm-wrap { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 960px; margin: 0 auto; padding: 24px 16px; color: var(--wpcm-text); }
.wpcm-notice { padding: 16px; background: #fef3c7; border-left: 4px solid #f59e0b; border-radius: 6px; }
.wpcm-empty  { color: var(--wpcm-muted); text-align: center; padding: 40px; }

/* ── Buttons ── */
.wpcm-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: 8px; border: none; cursor: pointer; font-size: 14px; font-weight: 600; transition: all .15s; text-decoration: none; }
.wpcm-btn-primary  { background: var(--wpcm-primary); color: #fff; }
.wpcm-btn-primary:hover { background: var(--wpcm-primary-d); color:#fff; }
.wpcm-btn-ghost    { background: transparent; border: 1px solid var(--wpcm-border); color: var(--wpcm-text); }
.wpcm-btn-ghost:hover { background: var(--wpcm-bg); }
.wpcm-btn-sm       { padding: 6px 14px; font-size: 12px; border-radius: 6px; }
.wpcm-btn-lg       { padding: 14px 32px; font-size: 16px; }
.wpcm-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Wallet Hero ── */
.wpcm-wallet-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 32px; flex-wrap: wrap; }
.wpcm-wallet-balance-card { background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff; border-radius: var(--wpcm-radius); padding: 28px 36px; flex: 1; min-width: 260px; box-shadow: var(--wpcm-shadow); }
.wpcm-wallet-label  { display: block; font-size: 13px; opacity: .8; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.wpcm-wallet-amount { display: block; font-size: 36px; font-weight: 700; letter-spacing: -.02em; }
.wpcm-wallet-amount .woocommerce-Price-currencySymbol { font-size: 22px; }

/* ── Section ── */
.wpcm-section { margin-top: 40px; }
.wpcm-section h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; border-bottom: 2px solid var(--wpcm-border); padding-bottom: 8px; }

/* ── Table ── */
.wpcm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wpcm-table th, .wpcm-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--wpcm-border); }
.wpcm-table th { background: var(--wpcm-bg); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--wpcm-muted); }
.wpcm-table tr:hover td { background: var(--wpcm-bg); }

/* ── Badges ── */
.wpcm-badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.wpcm-badge-visa   { background: #dbeafe; color: #1e40af; }
.wpcm-badge-master { background: #fee2e2; color: #991b1b; }
.wpcm-badge-credit { background: #dcfce7; color: #166534; }
.wpcm-badge-debit  { background: #fef2f2; color: #991b1b; }

/* ── Cards Header ── */
.wpcm-cards-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.wpcm-cards-header h2 { margin: 0; flex: 1; font-size: 24px; font-weight: 800; }
.wpcm-wallet-mini { font-size: 14px; color: var(--wpcm-muted); }
.wpcm-link { color: var(--wpcm-primary); text-decoration: none; margin-left: 6px; font-weight: 600; }

/* ── Virtual Card ── */
.wpcm-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; margin-bottom: 40px; }

.wpcm-card {
    border-radius: 18px;
    padding: 28px 24px 20px;
    min-height: 190px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.wpcm-card::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.wpcm-card::after {
    content: '';
    position: absolute;
    bottom: -80px; left: 40px;
    width: 240px; height: 240px;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
}
.wpcm-card-visa   { background: linear-gradient(135deg, #1a1f71 0%, #2563eb 100%); }
.wpcm-card-master { background: linear-gradient(135deg, #1c1c1c 0%, #4a1010 60%, #eb001b 100%); }

.wpcm-card-header { display: flex; justify-content: space-between; align-items: center; }
.wpcm-card-type   { font-size: 22px; font-weight: 900; letter-spacing: .04em; font-style: italic; }

.wpcm-card-chip {
    width: 42px; height: 32px;
    background: linear-gradient(135deg, #d4a520, #f5e07c, #d4a520);
    border-radius: 6px;
    position: relative;
    z-index: 1;
}
.wpcm-card-chip::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 28px; height: 20px;
    border: 1.5px solid rgba(0,0,0,.3);
    border-radius: 3px;
}

.wpcm-card-number { font-size: 20px; font-weight: 600; letter-spacing: .18em; position: relative; z-index: 1; }

.wpcm-card-info-row { display: flex; gap: 20px; position: relative; z-index: 1; }
.wpcm-card-info-label { display: block; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; margin-bottom: 2px; }
.wpcm-card-info-value { display: block; font-size: 13px; font-weight: 600; }

.wpcm-card-actions { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; margin-top: 4px; }
.wpcm-card-actions .wpcm-btn { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(4px); }
.wpcm-card-actions .wpcm-btn:hover { background: rgba(255,255,255,.35); }

.wpcm-card-status { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 3px 10px; border-radius: 99px; letter-spacing: .05em; }
.wpcm-status-active    { background: rgba(22,163,74,.25); color: #bbf7d0; }
.wpcm-status-frozen    { background: rgba(96,165,250,.25); color: #bfdbfe; }
.wpcm-status-cancelled { background: rgba(239,68,68,.25); color: #fecaca; }

/* ── Empty state ── */
.wpcm-empty-state { text-align: center; padding: 60px 20px; background: var(--wpcm-bg); border-radius: var(--wpcm-radius); border: 2px dashed var(--wpcm-border); }
.wpcm-empty-state p { color: var(--wpcm-muted); margin-bottom: 20px; font-size: 16px; }

/* ── Overlay / Modal ── */
.wpcm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(3px); }
.wpcm-modal-box { background: #fff; border-radius: 16px; padding: 32px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.wpcm-modal-box h3 { margin: 0 0 16px; font-size: 20px; font-weight: 800; }
.wpcm-modal-box label { display: block; font-size: 13px; font-weight: 600; color: var(--wpcm-muted); margin-bottom: 16px; }
.wpcm-modal-box input[type="number"] { display: block; width: 100%; margin-top: 6px; padding: 12px; border: 1.5px solid var(--wpcm-border); border-radius: 8px; font-size: 16px; box-sizing: border-box; outline: none; transition: border .15s; }
.wpcm-modal-box input:focus { border-color: var(--wpcm-primary); }
.wpcm-modal-box .wpcm-btn { width: 100%; justify-content: center; margin-top: 8px; }
.wpcm-msg { margin-top: 12px; padding: 10px; border-radius: 8px; font-size: 13px; display: none; }
.wpcm-msg.success { background: #dcfce7; color: #166534; display: block; }
.wpcm-msg.error   { background: #fee2e2; color: #991b1b; display: block; }

/* ── Card Details Modal ── */
#wpcm-card-details-content table { width: 100%; border-collapse: collapse; font-size: 14px; }
#wpcm-card-details-content td { padding: 8px 4px; border-bottom: 1px solid var(--wpcm-border); }
#wpcm-card-details-content td:first-child { color: var(--wpcm-muted); font-weight: 600; width: 44%; }

/* ── Order Card Page ── */
.wpcm-card-type-selector { display: flex; gap: 20px; margin: 24px 0; flex-wrap: wrap; }
.wpcm-card-option { flex: 1; min-width: 220px; cursor: pointer; }
.wpcm-card-option input { display: none; }
.wpcm-card-option-inner {
    border: 2px solid var(--wpcm-border);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    transition: all .15s;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.wpcm-card-option input:checked + .wpcm-card-option-inner { border-color: var(--wpcm-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.wpcm-card-logo { width: 64px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-style: italic; font-size: 20px; }
.wpcm-visa-logo   { background: #1a1f71; color: #fff; }
.wpcm-master-logo { background: #333; color: transparent; font-size: 28px; gap: 2px; }
.wpcm-master-logo span:first-child { color: #eb001b; }
.wpcm-master-logo span:last-child  { color: #f79e1b; margin-left: -10px; }
.wpcm-textarea-label { display: block; font-size: 14px; font-weight: 600; color: var(--wpcm-text); margin-bottom: 20px; }
.wpcm-textarea-label textarea { display: block; width: 100%; margin-top: 8px; padding: 12px; border: 1.5px solid var(--wpcm-border); border-radius: 8px; font-size: 14px; box-sizing: border-box; resize: vertical; outline: none; }
.wpcm-textarea-label textarea:focus { border-color: var(--wpcm-primary); }

/* ── Responsive ── */
@media (max-width: 600px) {
    .wpcm-wallet-balance-card { padding: 20px 24px; }
    .wpcm-wallet-amount { font-size: 28px; }
    .wpcm-card-number { font-size: 16px; letter-spacing: .12em; }
    .wpcm-card-info-row { gap: 12px; }
}
