/* ══════════════════════════════════════════════════════
   AMP — Attention Mining Protocol — Public Styles
   ══════════════════════════════════════════════════════ */
:root {
  --amp-blue:     #1E3A5F;
  --amp-accent:   #2D7DD2;
  --amp-green:    #1A7A4A;
  --amp-success:  #D1FAE5;
  --amp-warning:  #FEF3C7;
  --amp-error:    #FEE2E2;
  --amp-border:   #D1D5DB;
  --amp-gray-100: #F8FAFC;
  --amp-gray-200: #F0F2F5;
  --amp-text:     #1F2937;
  --amp-muted:    #6B7280;
  --amp-radius:   10px;
  --amp-shadow:   0 2px 12px rgba(0,0,0,0.08);
}

/* ── Base Reset ─────────────────────────────────────── */
.amp-dashboard,
.amp-advertiser-portal {
  max-width: 860px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  color: var(--amp-text);
  line-height: 1.5;
}

/* ── Cards ──────────────────────────────────────────── */
.amp-card {
  background: #fff;
  border: 1px solid var(--amp-border);
  border-radius: var(--amp-radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--amp-shadow);
}
.amp-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.amp-card-title h3 {
  margin: 0;
  font-size: 1.05em;
  color: var(--amp-blue);
  font-weight: 700;
}
.amp-card-icon {
  font-size: 1.15em;
  line-height: 1;
}

/* ── Dashboard Header ───────────────────────────────── */
.amp-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: linear-gradient(135deg, var(--amp-blue), #2D5C9E);
  color: #fff;
  border-radius: var(--amp-radius);
  padding: 24px;
  margin-bottom: 20px;
}
.amp-dash-header-info { display: flex; align-items: center; gap: 14px; }
.amp-avatar {
  width: 48px; height: 48px;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5em; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.amp-dash-username { font-size: 1.15em; font-weight: 700; }
.amp-dash-sub      { font-size: 0.82em; opacity: 0.75; margin-top: 2px; }
.amp-dash-header-stats { display: flex; gap: 24px; }
.amp-mini-stat     { text-align: right; }
.amp-mini-stat-val { font-size: 1.25em; font-weight: 700; }
.amp-mini-stat-lbl { font-size: 0.75em; opacity: 0.75; }

/* ── Daily Cap Bar ───────────────────────────────────── */
.amp-cap-card {
  background: var(--amp-gray-100);
  padding: 16px 20px;
}
.amp-cap-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85em;
  color: var(--amp-muted);
  margin-bottom: 6px;
}
.amp-pool-bar {
  background: #E5E7EB;
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
}
.amp-pool-bar-fill {
  background: linear-gradient(90deg, var(--amp-accent), var(--amp-green));
  height: 100%;
  border-radius: 20px;
  transition: width 0.6s ease;
  min-width: 4px;
}
.amp-cap-hint { font-size: 0.8em; color: var(--amp-muted); margin-top: 6px; }

/* ── Wallet Section ─────────────────────────────────── */
.amp-wallet-section {
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  border-color: #BFDBFE;
}
.amp-wallet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.amp-wallet-connected {
  display: flex;
  align-items: center;
  gap: 8px;
}
.amp-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.amp-dot-green  { background: #22C55E; box-shadow: 0 0 0 3px rgba(34,197,94,0.2); }
.amp-wallet-connected code {
  font-size: 0.9em;
  background: rgba(255,255,255,0.7);
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #BFDBFE;
}
.amp-wallet-actions { display: flex; gap: 8px; }

/* ── Balance Cards ──────────────────────────────────── */
.amp-balances-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px,1fr));
  gap: 16px;
}
.amp-balance-card {
  background: var(--amp-gray-100);
  border: 2px solid var(--amp-border);
  border-radius: var(--amp-radius);
  padding: 20px 16px;
  text-align: center;
  position: relative;
  transition: border-color 0.2s;
}
.amp-primary-token {
  border-color: var(--amp-accent);
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
}
.amp-token-badge {
  position: absolute;
  top: -1px; right: -1px;
  background: var(--amp-accent);
  color: #fff;
  font-size: 0.68em;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 0 8px 0 6px;
}
.amp-balance-ticker { font-size: 0.85em; font-weight: 700; color: var(--amp-accent); margin-bottom: 4px; text-transform: uppercase; }
.amp-balance-amount { font-size: 2em; font-weight: 800; color: var(--amp-blue); line-height: 1.1; }
.amp-balance-name   { font-size: 0.78em; color: var(--amp-muted); margin: 4px 0 12px; }
.amp-withdraw-info  { font-size: 0.78em; color: var(--amp-muted); margin-bottom: 8px; }

/* ── Tables ─────────────────────────────────────────── */
.amp-table-wrap { overflow-x: auto; }
.amp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88em;
}
.amp-table th {
  background: var(--amp-blue);
  color: #fff;
  padding: 9px 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.amp-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--amp-border);
  vertical-align: middle;
}
.amp-table tr:last-child td { border-bottom: none; }
.amp-table tr:hover td { background: var(--amp-gray-100); }
.amp-amount-cell { font-weight: 700; color: var(--amp-green); font-size: 0.95em; }
.amp-date-cell   { color: var(--amp-muted); white-space: nowrap; }

/* ── Badges ─────────────────────────────────────────── */
.amp-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: 600;
  white-space: nowrap;
}
.amp-badge-pending    { background: #FEF3C7; color: #92400E; }
.amp-badge-approved   { background: #D1FAE5; color: #065F46; }
.amp-badge-processing { background: #DBEAFE; color: #1E40AF; }
.amp-badge-completed  { background: #D1FAE5; color: #065F46; }
.amp-badge-paid       { background: #D1FAE5; color: #065F46; }
.amp-badge-failed     { background: #FEE2E2; color: #991B1B; }
.amp-badge-rejected   { background: #FEE2E2; color: #991B1B; }
.amp-badge-active     { background: #D1FAE5; color: #065F46; }

/* ── Buttons ─────────────────────────────────────────── */
.amp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  line-height: 1.3;
}
.amp-btn:hover    { opacity: 0.88; transform: translateY(-1px); }
.amp-btn:active   { transform: translateY(0); }
.amp-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.amp-btn-primary   { background: var(--amp-accent); color: #fff; }
.amp-btn-secondary { background: var(--amp-gray-200); color: var(--amp-blue); border: 1px solid var(--amp-border); }
.amp-btn-lg        { padding: 12px 28px; font-size: 1em; }
.amp-btn-sm        { padding: 5px 12px; font-size: 0.8em; }
.amp-btn-full      { width: 100%; }

/* ── Inputs ─────────────────────────────────────────── */
.amp-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--amp-border);
  border-radius: 7px;
  font-size: 0.92em;
  color: var(--amp-text);
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.amp-input:focus {
  outline: none;
  border-color: var(--amp-accent);
  box-shadow: 0 0 0 3px rgba(45,125,210,0.15);
}

/* ── Feedback ────────────────────────────────────────── */
.amp-feedback {
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 0.88em;
  font-weight: 500;
}
.amp-feedback-success { background: var(--amp-success); color: #065F46; border: 1px solid #6EE7B7; }
.amp-feedback-error   { background: var(--amp-error);   color: #991B1B; border: 1px solid #FCA5A5; }
.amp-feedback-info    { background: #DBEAFE; color: #1E40AF; border: 1px solid #93C5FD; }

/* ── Notices ─────────────────────────────────────────── */
.amp-notice         { padding: 12px 16px; border-radius: 7px; margin: 12px 0; font-size: 0.9em; }
.amp-notice-warning { background: var(--amp-warning); color: #92400E; border: 1px solid #FCD34D; }
.amp-notice-error   { background: var(--amp-error);   color: #991B1B; border: 1px solid #FCA5A5; }

/* ── Empty states ────────────────────────────────────── */
.amp-empty-state { text-align: center; padding: 32px 20px; color: var(--amp-muted); }
.amp-empty-icon  { font-size: 2.5em; margin-bottom: 10px; }
.amp-login-prompt { text-align: center; padding: 40px 24px; }
.amp-login-prompt h3 { font-size: 1.3em; margin: 12px 0 8px; }

/* ── Withdrawal Modal ────────────────────────────────── */
.amp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.amp-modal-box {
  background: #fff;
  border-radius: var(--amp-radius);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  position: relative;
  animation: ampModalIn 0.2s ease;
}
@keyframes ampModalIn {
  from { opacity:0; transform: translateY(-16px) scale(0.97); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}
.amp-modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  font-size: 1.3em;
  cursor: pointer;
  color: var(--amp-muted);
  line-height: 1;
  padding: 4px;
}
.amp-modal-close:hover { color: var(--amp-text); }
.amp-modal-title { margin: 0 0 20px; font-size: 1.2em; color: var(--amp-blue); }
.amp-modal-summary {
  background: var(--amp-gray-100);
  border-radius: 7px;
  padding: 14px;
  margin-bottom: 18px;
}
.amp-modal-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.9em;
}
.amp-modal-net {
  border-top: 1px solid var(--amp-border);
  margin-top: 6px;
  padding-top: 8px;
  font-size: 1em;
}
.amp-modal-label { display: block; font-size: 0.88em; font-weight: 600; color: var(--amp-text); }

/* ── Ad Portal ───────────────────────────────────────── */
.amp-portal-header { text-align: center; margin-bottom: 28px; }
.amp-portal-title { font-size: 1.8em; font-weight: 800; color: var(--amp-blue); margin: 0 0 8px; }
.amp-portal-subtitle { color: var(--amp-muted); font-size: 1em; margin: 0; }

/* ── Step nav dots ──────────────────────────────────── */
.amp-steps-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 4px;
}
.amp-step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: default;
}
.amp-step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--amp-gray-200);
  border: 2px solid var(--amp-border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9em;
  color: var(--amp-muted);
  transition: all 0.2s;
}
.amp-step-dot.active .amp-step-num {
  background: var(--amp-accent);
  border-color: var(--amp-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(45,125,210,0.4);
}
.amp-step-dot.completed .amp-step-num {
  background: var(--amp-green);
  border-color: var(--amp-green);
  color: #fff;
}
.amp-step-label {
  font-size: 0.72em;
  color: var(--amp-muted);
  white-space: nowrap;
}
.amp-step-dot.active .amp-step-label { color: var(--amp-accent); font-weight: 600; }
.amp-step-connector {
  flex: 1 0 20px;
  height: 2px;
  background: var(--amp-border);
  margin-bottom: 16px;
  max-width: 60px;
}

/* ── Step panels ─────────────────────────────────────── */
.amp-step-panel          { display: none; }
.amp-step-panel.active   { display: block; animation: ampFadeIn 0.2s ease; }
@keyframes ampFadeIn { from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:translateY(0); } }
.amp-step-heading {
  font-size: 1.15em; font-weight: 700;
  color: var(--amp-blue);
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--amp-border);
}

/* ── Slot cards ─────────────────────────────────────── */
.amp-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
  gap: 16px;
}
.amp-slot-card {
  background: var(--amp-gray-100);
  border: 2px solid var(--amp-border);
  border-radius: var(--amp-radius);
  padding: 20px 16px;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.amp-slot-card:hover {
  border-color: var(--amp-accent);
  box-shadow: 0 4px 16px rgba(45,125,210,0.15);
}
.amp-slot-size  { font-size: 0.78em; color: var(--amp-muted); margin-bottom: 6px; }
.amp-slot-name  { font-weight: 700; font-size: 1em; margin-bottom: 8px; color: var(--amp-blue); }
.amp-slot-price { color: var(--amp-accent); font-weight: 700; font-size: 1em; }
.amp-slot-model { font-size: 0.75em; color: var(--amp-muted); font-weight: 400; }
.amp-slot-preview-box {
  background: linear-gradient(135deg, #E5E7EB, #D1D5DB);
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto;
  font-size: 0.7em;
  color: var(--amp-muted);
}
.amp-slot-example { margin: 8px 0; }

/* ── Date fields ─────────────────────────────────────── */
.amp-date-row { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.amp-field { flex: 1; min-width: 140px; }
.amp-field label { display: block; font-size: 0.88em; font-weight: 600; margin-bottom: 5px; }
.amp-field-hint { font-size: 0.78em; color: var(--amp-muted); margin: 4px 0 0; }

/* ── Price preview ───────────────────────────────────── */
.amp-price-box {
  background: var(--amp-gray-100);
  border: 1px solid var(--amp-border);
  border-radius: 7px;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 1em;
  color: var(--amp-text);
}
.amp-price-highlight { font-size: 1.2em; color: var(--amp-accent); }

/* ── Summary ─────────────────────────────────────────── */
.amp-selected-slot-info,
.amp-order-card {
  background: var(--amp-gray-100);
  border-radius: 7px;
  padding: 16px;
  margin-bottom: 20px;
}
.amp-summary-row {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  font-size: 0.9em;
  border-bottom: 1px solid var(--amp-border);
}
.amp-summary-row:last-child { border-bottom: none; }
.amp-summary-label { color: var(--amp-muted); min-width: 100px; }

/* ── Creative layout ─────────────────────────────────── */
.amp-creative-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 24px;
  margin-bottom: 20px;
}
.amp-preview-label { font-size: 0.82em; color: var(--amp-muted); margin-bottom: 8px; }
.amp-creative-placeholder {
  background: var(--amp-gray-200);
  border: 2px dashed var(--amp-border);
  border-radius: 8px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82em;
  color: var(--amp-muted);
  text-align: center;
  padding: 12px;
}

/* ── Payment ─────────────────────────────────────────── */
.amp-payment-options { margin-bottom: 20px; }
.amp-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--amp-muted);
  font-size: 0.85em;
}
.amp-divider::before, .amp-divider::after { content:''; flex:1; height:1px; background:var(--amp-border); }
.amp-manual-pay { background: var(--amp-gray-100); border-radius: 8px; padding: 16px; }
.amp-admin-wallet-addr { font-size: 0.88em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.amp-mono { font-size: 0.85em; word-break: break-all; }

/* ── Success ─────────────────────────────────────────── */
.amp-success-card {
  text-align: center;
  padding: 40px 24px;
  background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
  border-radius: var(--amp-radius);
  border: 1px solid #6EE7B7;
}
.amp-success-icon { font-size: 3em; margin-bottom: 12px; }
.amp-success-card h3 { font-size: 1.5em; color: #065F46; margin: 0 0 10px; }
.amp-success-details {
  display: inline-block;
  background: rgba(255,255,255,0.6);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.9em;
  margin-top: 8px;
}

/* ── Step actions ────────────────────────────────────── */
.amp-step-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* ── Reward toast ────────────────────────────────────── */
.amp-reward-toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--amp-blue);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  transform: translateY(72px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 99998;
  font-weight: 600;
  font-size: 0.9em;
  max-width: 280px;
}
.amp-reward-toast.amp-toast-show { transform: translateY(0); opacity: 1; }

/* ── Ad slot display ─────────────────────────────────── */
.amp-ad-slot     { display: inline-block; position: relative; }
.amp-ad-label    { position: absolute; top: 0; right: 0; background: rgba(0,0,0,0.45); color: #fff; font-size: 9px; padding: 1px 5px; border-radius: 0 0 0 4px; letter-spacing: 0.05em; }
.amp-ad-fallback { }

/* ── Wallet widget ───────────────────────────────────── */
.amp-wallet-widget { display: inline-flex; align-items: center; gap: 10px; }

/* ── Utility ─────────────────────────────────────────── */
.amp-hint        { font-size: 0.82em; color: var(--amp-muted); }
.amp-muted       { color: var(--amp-muted); }
.amp-link        { color: var(--amp-accent); text-decoration: none; font-size: 0.88em; }
.amp-link:hover  { text-decoration: underline; }
.amp-req         { color: #EF4444; }
.amp-tx-link     { color: var(--amp-accent); font-size: 0.85em; text-decoration: none; }
.amp-tx-link:hover { text-decoration: underline; }
.amp-mt4  { margin-top: 4px !important; }
.amp-mt8  { margin-top: 8px !important; }
.amp-mt12 { margin-top: 12px !important; }
.amp-text-center { text-align: center; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 640px) {
  .amp-dash-header     { flex-direction: column; align-items: flex-start; }
  .amp-dash-header-stats { flex-direction: row; }
  .amp-mini-stat       { text-align: left; }
  .amp-creative-layout { grid-template-columns: 1fr; }
  .amp-balances-grid   { grid-template-columns: repeat(2, 1fr); }
  .amp-slots-grid      { grid-template-columns: 1fr 1fr; }
  .amp-modal-box       { padding: 24px 18px; }
  .amp-steps-nav       { gap: 2px; }
  .amp-step-connector  { max-width: 20px; }
  .amp-step-label      { display: none; }
}
@media (max-width: 400px) {
  .amp-balances-grid { grid-template-columns: 1fr; }
  .amp-slots-grid    { grid-template-columns: 1fr; }
}
