/* ============================================
   eResonate — Ad Server demo console
   ============================================ */

.nav-links a.active { color: var(--text); }

.demo-bar {
  margin-top: var(--nav-h);
  background: rgba(62, 224, 140, 0.08);
  border-bottom: 1px solid rgba(62, 224, 140, 0.25);
  padding: 0.6rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  text-align: center;
}
.demo-pill {
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--money);
  border: 1px solid rgba(62, 224, 140, 0.4);
  border-radius: 20px;
  padding: 0.15rem 0.7rem;
  white-space: nowrap;
}

.ads { padding: 2rem 2rem 4.5rem; }
.ads-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.ads-head h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
}
.ads-env { font-size: 0.5em; color: var(--text-dim); font-weight: 600; }
.ads-sub { color: var(--text-muted); max-width: 640px; font-size: 0.95rem; margin-top: 0.4rem; }
.ads-sub strong { color: var(--money); }
.ads-controls { display: flex; gap: 0.7rem; flex-wrap: wrap; }

/* KPI tiles */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.2rem;
}
.kpi--money { border-color: rgba(62, 224, 140, 0.35); background: linear-gradient(160deg, rgba(62, 224, 140, 0.08), var(--bg-card) 60%); }
.kpi-num {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.kpi--money .kpi-num { color: var(--money); }
.kpi-label { font-size: 0.66rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.2rem; }

/* Layout */
.ads-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.25rem;
}
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem 1.3rem;
  margin-bottom: 1.25rem;
}
.ads-main .panel:last-child, .ads-side .panel:last-child { margin-bottom: 0; }
.panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.pt-hint { font-size: 0.65rem; color: var(--text-dim); font-weight: 500; }

/* Auction visualizer */
.auction-viz { min-height: 190px; }
.viz-empty { color: var(--text-dim); font-size: 0.85rem; padding: 2rem 0; text-align: center; }
.viz-req {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.8rem;
}
.viz-req .vr-key { color: var(--accent); }
.bid-row {
  display: grid;
  grid-template-columns: 150px 1fr 74px;
  align-items: center;
  gap: 0.8rem;
  padding: 0.3rem 0;
  animation: bidIn 0.3s ease both;
}
@keyframes bidIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
.bid-name { font-size: 0.78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bid-dsp { font-size: 0.6rem; color: var(--text-dim); display: block; }
.bid-track { height: 16px; background: rgba(255, 255, 255, 0.05); border-radius: 4px; overflow: hidden; }
.bid-fill {
  height: 100%;
  border-radius: 4px;
  background: rgba(136, 136, 170, 0.5);
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bid-row.winner .bid-fill { background: linear-gradient(90deg, var(--accent), var(--accent2)); box-shadow: 0 0 14px var(--accent-glow); }
.bid-row.winner .bid-name { color: var(--accent); }
.bid-val { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 0.76rem; text-align: right; font-variant-numeric: tabular-nums; }
.viz-result {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.viz-result strong { color: var(--money); }

/* Log */
.ads-log {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.68rem;
  line-height: 1.8;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  color: var(--text-muted);
}
.log-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: bidIn 0.25s ease; }
.log-line .lg-n { color: var(--text-dim); }
.log-line .lg-slot { color: #7FB8FF; }
.log-line .lg-seg { color: #C9A2FF; }
.log-line .lg-win { color: var(--text); font-weight: 600; }
.log-line .lg-money { color: var(--money); }

/* Revenue routing */
.route-num {
  font-family: 'Outfit', sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--money);
  font-variant-numeric: tabular-nums;
}
.route-label { font-size: 0.68rem; color: var(--text-dim); margin: 0.15rem 0 0.9rem; }
.route-bar {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.8rem;
}
.route-a { flex: 1; padding: 0.45rem; background: rgba(168, 85, 247, 0.25); color: #D9BAFF; }
.route-v { flex: 1; padding: 0.45rem; background: rgba(62, 224, 140, 0.18); color: var(--money); }
.route-note { font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; }

/* Segments */
.seg-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}
.seg-row:last-child { border-bottom: none; }
.seg-name { font-weight: 600; }
.seg-size { color: var(--text-dim); font-size: 0.68rem; font-variant-numeric: tabular-nums; }
.why-list li { font-size: 0.78rem; color: var(--text-muted); padding: 0.3rem 0; line-height: 1.45; }

/* Campaign table */
.campaigns { margin-bottom: 1.25rem; }
.camp-table { overflow-x: auto; }
.camp-head, .camp-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.4fr 1fr 0.8fr 0.7fr 0.8fr;
  gap: 0.8rem;
  align-items: center;
  padding: 0.55rem 0.4rem;
  min-width: 720px;
}
.camp-head {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.camp-row { border-bottom: 1px solid var(--border); font-size: 0.8rem; }
.camp-row:last-child { border-bottom: none; }
.camp-brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; }
.camp-ico {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.camp-dsp { color: var(--text-muted); font-size: 0.72rem; }
.camp-tgt { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.camp-tgt span {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.06rem 0.4rem;
  white-space: nowrap;
}
.camp-budget { min-width: 110px; }
.cb-track { height: 6px; background: rgba(255, 255, 255, 0.07); border-radius: 3px; overflow: hidden; margin-top: 0.25rem; }
.cb-spent { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 3px; }
.camp-budget.done .cb-spent { background: var(--text-dim); }
.cb-nums { font-size: 0.64rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.camp-stat { font-variant-numeric: tabular-nums; font-size: 0.76rem; color: var(--text-muted); }
.camp-status { font-family: 'Outfit', sans-serif; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.06em; }
.camp-status.live { color: var(--money); }
.camp-status.done { color: var(--text-dim); }
.reset-btn {
  margin-top: 0.9rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 8px;
  font-size: 0.7rem;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}
.reset-btn:hover { color: #FF7A5C; border-color: rgba(255, 122, 92, 0.4); }

/* CTA */
.ads-cta {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), transparent 70%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
}
.ads-cta h2 { font-family: 'Outfit', sans-serif; font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 800; margin-bottom: 0.5rem; }
.ads-cta p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 1.5rem; }
.ads-cta-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 1024px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .kpi--money { grid-column: span 2; }
  .ads-grid { grid-template-columns: 1fr; }
}
