/**
 * Affiliate page - page-unique styles. v2 adaptation of v1 affiliate.css.
 * Covers affiliate dashboard (account endpoint) and affiliate landing template.
 *
 * @package HID_VP_Solution_V2
 */

/* ── Stat cards ── */
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px;
  transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.stat-card:hover { border-color: var(--cobalt-700); transform: translateY(-2px); }
.stat-card-num {
  font-family: var(--font-display); font-size: 28px; font-weight: 900;
  color: var(--text-1); letter-spacing: -0.5px; margin-bottom: 4px;
}
.stat-card-label { font-size: 12.5px; color: var(--text-2); }

/* ── Referral link card (always dark gradient - intentional, do not substitute bg tokens) ── */
.affiliate-link-card {
  background: linear-gradient(135deg, #0a1535, #112046);
  border: 1px solid rgba(28,104,188,.25);
  border-radius: var(--r-xl); padding: 24px;
  position: relative; overflow: hidden;
}
[data-theme="light"] .affiliate-link-card {
  background: linear-gradient(135deg, #1236a8, var(--cobalt-600));
}
.affiliate-link-card::after {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(28,104,188,.25), transparent 70%);
  pointer-events: none;
}
.affiliate-link-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: rgba(255,255,255,.5); margin-bottom: 8px;
  position: relative; z-index: 1;
}
.affiliate-link-url {
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  color: #fff; margin-bottom: 16px; position: relative; z-index: 1;
  word-break: break-all; line-height: 1.4;
}
.affiliate-link-actions { display: flex; gap: 8px; position: relative; z-index: 1; flex-wrap: wrap; }
.affiliate-link-actions .btn { height: 38px; }
.affiliate-link-actions .btn-outline {
  background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.25); color: #fff;
}
.affiliate-link-actions .btn-outline:hover { background: rgba(255,255,255,.18); }
.aff-copy.is-copied { background: var(--green-700); border-color: var(--green-700); color: #fff; }

/* ── Affiliate sections ── */
.vp-affiliate .aff-how h3,
.vp-affiliate .aff-withdrawals h3 {
  font-family: var(--font-display); font-size: 16px; font-weight: 800;
  color: var(--text-1); margin: 0 0 8px; overflow: hidden;
}
.vp-affiliate .aff-how p { font-size: 13.5px; color: var(--text-2); line-height: 1.7; margin: 0; }

/* ── Withdrawals table ── */
.vp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.vp-table th {
  text-align: left; padding: 12px 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-2); border-bottom: 1px solid var(--border);
}
.vp-table td {
  padding: 14px 10px; border-bottom: 1px solid var(--border);
  color: var(--text-2); vertical-align: middle;
}
.vp-table tr:last-child td { border-bottom: none; }
.vp-table td strong { color: var(--text-1); font-family: var(--font-display); font-weight: 800; }

/* ── Status chips ── */
.status-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
}
.status-chip.status-pending    { background: rgba(28,104,188,.12); color: var(--cobalt-600); }
.status-chip.status-processing { background: rgba(245,166,35,.12); color: var(--amber-500); }
.status-chip.status-paid       { background: rgba(0,196,140,.12); color: var(--green-700); }
.status-chip.status-rejected   { background: rgba(188,33,43,.12); color: var(--red-400); }

/* ── Withdrawal modal ── */
.aff-modal-backdrop {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; transition: opacity 0.2s ease;
}
.aff-modal-backdrop.open { opacity: 1; }
.aff-modal {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-float);
  overflow: hidden; transform: translateY(8px); transition: transform 0.2s ease;
}
.aff-modal-backdrop.open .aff-modal { transform: translateY(0); }
.aff-modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.aff-modal-title { font-family: var(--font-display); font-size: 16px; font-weight: 800; color: var(--text-1); margin: 0; }
.aff-modal-close {
  background: none; border: none; color: var(--text-2);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px;
  transition: color var(--fast) var(--ease);
}
.aff-modal-close:hover { color: var(--text-1); }
.aff-modal-body { padding: 22px; }
.aff-modal-avail { font-size: 12.5px; color: var(--text-2); margin: 0 0 16px; }
.aff-modal-avail strong { color: var(--green-700); }
.aff-modal-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.aff-modal-field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.aff-modal-field input {
  height: 46px; padding: 0 14px;
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--text-1);
  font-size: 14px; font-family: var(--font-body); outline: none;
  transition: border-color var(--fast) var(--ease); width: 100%;
}
.aff-modal-field input:focus { border-color: var(--cobalt-700); box-shadow: 0 0 0 3px rgba(28,104,188,.12); }
.aff-modal-msg { font-size: 12.5px; margin: 0 0 12px; min-height: 1em; }
.aff-modal-msg.error { color: var(--red-400); }
.aff-modal-msg.success { color: var(--green-700); }
.aff-modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.aff-modal-actions .btn { flex: 1; justify-content: center; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .vp-affiliate .aff-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .vp-table { font-size: 12.5px; }
  .vp-table th, .vp-table td { padding: 10px 6px; }
}
