/* Provider advertising console (advertising.html / advertising.js).
   Banner styles themselves live in css/ads.css. */

.adv-main { max-width: 1320px; }
.adv-main [hidden] { display: none !important; }

.adv-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.adv-header h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -0.01em; }
.adv-header p.muted { margin: 0; max-width: 640px; }
.adv-header-actions { display: flex; gap: 10px; }
.adv-header-actions a:hover { text-decoration: none; }
.adv-eyebrow { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }

/* KPIs */
.adv-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.adv-kpi {
  display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.adv-kpi span { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.adv-kpi strong { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.adv-kpi small { font-size: 12.5px; color: var(--text-faint); }
.adv-kpi--balance { background: linear-gradient(135deg, #f15a2c, #ff9b52); border: none; color: #fff; }
.adv-kpi--balance span, .adv-kpi--balance small { color: rgba(255, 255, 255, 0.88); }

/* Layout */
.adv-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.adv-card { margin-bottom: 20px; }
.adv-grid .adv-card { margin-bottom: 0; }
.adv-card-head h2 { margin: 0 0 6px; font-size: 18px; }
.adv-card-head p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.55; }
.adv-card-head--row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.adv-buy { position: sticky; top: 24px; }

.adv-label { margin: 22px 0 10px; font-size: 13px; font-weight: 700; color: var(--text); }
.adv-label .muted { font-weight: 500; }
.adv-sublabel { margin: 14px 0 8px !important; }
.adv-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.adv-fields label { margin: 0 0 7px; display: flex; align-items: baseline; gap: 6px; }
.adv-fields label .adv-count { margin-left: auto; }
.adv-fields input, .adv-fields textarea { padding: 11px 13px; }
.adv-fields .is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12); }
.adv-span2 { grid-column: 1 / -1; }
.adv-count { font-weight: 500; color: var(--text-faint); font-size: 12px; }
.adv-full { width: 100%; margin-top: 16px; padding: 13px; }

/* Placement picker with a mini marketplace wireframe */
.adv-placements { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adv-place {
  position: relative; display: flex; gap: 14px; align-items: flex-start; margin: 0; padding: 14px;
  border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface);
  font-weight: 400; color: var(--text); transition: border-color 0.15s, box-shadow 0.15s;
}
.adv-place:hover { border-color: var(--text-faint); }
.adv-place.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(241, 90, 44, 0.12); }
.adv-place input { position: absolute; top: 12px; right: 12px; width: 16px; height: 16px; accent-color: var(--accent); }
.adv-place-text { display: flex; flex-direction: column; gap: 3px; padding-right: 18px; }
.adv-place-text strong { font-size: 14px; }
.adv-place-text small { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.adv-place-text em { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--accent); margin-top: 2px; }

.adv-wire-frame {
  flex-shrink: 0; position: relative; width: 74px; height: 62px; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--border);
}
.adv-wire-frame i { position: absolute; border-radius: 2px; background: #dbe1ea; }
.adv-wire-frame .wf-cats { left: 5px; right: 5px; top: 5px; height: 4px; }
.adv-wire-frame .wf-top { left: 5px; right: 5px; top: 12px; height: 9px; }
.adv-wire-frame .wf-filters { left: 5px; width: 18px; top: 24px; height: 16px; }
.adv-wire-frame .wf-side { left: 5px; width: 18px; top: 43px; height: 13px; }
.adv-wire-frame .wf-grid { left: 27px; right: 5px; top: 24px; bottom: 6px; background: repeating-linear-gradient(90deg, #dbe1ea 0 12px, transparent 12px 15px); }
.adv-wire-frame--top .wf-top, .adv-wire-frame--side .wf-side { background: var(--accent); animation: adv-blink 1.6s ease-in-out infinite; }
@keyframes adv-blink { 50% { opacity: 0.55; } }

/* Write with Jozie AI */
.adv-ai {
  margin-bottom: 18px; padding: 16px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.07), rgba(241, 90, 44, 0.06));
  border: 1px solid rgba(124, 58, 237, 0.22);
}
.adv-ai-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.adv-ai-head > div { display: flex; flex-direction: column; gap: 2px; }
.adv-ai-head strong { font-size: 14px; }
.adv-ai-head small { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.adv-ai-badge {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #f15a2c); color: #fff; font-size: 12px; font-weight: 700;
}
.adv-ai-badge svg { width: 13px; height: 13px; }
.adv-ai textarea { padding: 11px 13px; background: var(--surface); }
.adv-ai textarea.is-invalid { border-color: var(--danger); }
.adv-ai-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.adv-ai-actions .btn-primary { padding: 9px 16px; background: #7c3aed; }
.adv-ai-actions .btn-primary:hover { background: #6d28d9; }
.adv-ai-actions small { font-size: 12px; }
.adv-ai-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.adv-ai-results:empty { display: none; }
.adv-ai-option {
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 6px; text-align: left; padding: 12px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--surface); font: inherit; color: var(--text); cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.adv-ai-option:hover { border-color: #7c3aed; transform: translateY(-1px); }
.adv-ai-option.active { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15); }
.adv-ai-option-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); }
.adv-ai-use { color: #7c3aed; }
.adv-ai-option strong { font-size: 14px; line-height: 1.3; }
.adv-ai-option > span:not(.adv-ai-option-head) { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.adv-ai-option em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--accent); margin-top: auto; }
.adv-ai-skel {
  min-height: 120px; cursor: default; border-style: dashed;
  background: linear-gradient(90deg, #f1edfb 0%, #faf8ff 50%, #f1edfb 100%); background-size: 200% 100%;
  animation: adv-shimmer 1.2s linear infinite;
}
@keyframes adv-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.adv-flash { animation: adv-flash 1.2s ease; }
@keyframes adv-flash { 0% { box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.35); border-color: #7c3aed; } 100% { box-shadow: none; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Themes */
.adv-themes { display: flex; gap: 10px; flex-wrap: wrap; }
.adv-swatch { width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.adv-swatch.active { box-shadow: 0 0 0 2px var(--text); }

/* Duration chips */
.adv-fields input[type="range"] { padding: 0; height: 32px; accent-color: var(--accent); background: transparent; border: none; }
.adv-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.adv-chips button {
  padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg);
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-muted); cursor: pointer;
}
.adv-chips button.active { border-color: var(--accent); color: var(--accent); background: rgba(241, 90, 44, 0.08); }

/* Preview */
.adv-preview {
  margin-top: 24px; padding: 18px; border-radius: 12px; background: var(--bg); border: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 16px;
}
.adv-preview-label { margin: 0 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); }
.adv-preview-item--side .ad { max-width: 260px; }

/* Cost bar */
.adv-cost {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 20px; padding: 16px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
}
.adv-cost > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.adv-cost strong { font-size: 22px; font-weight: 800; }
.adv-cost-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.adv-cost-right .btn-primary { padding: 12px 22px; }
.adv-warn { color: var(--warning) !important; font-weight: 600; }

/* Credit packs + methods */
.adv-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.adv-pack {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px;
  border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; font: inherit;
}
.adv-pack strong { font-size: 17px; }
.adv-pack small { font-size: 12px; color: var(--text-muted); }
.adv-pack:hover { border-color: var(--text-faint); }
.adv-pack.active { border-color: var(--accent); background: rgba(241, 90, 44, 0.06); }

.adv-methods { display: flex; flex-direction: column; gap: 10px; }
.adv-method { margin: 0; cursor: pointer; font-weight: 400; color: var(--text); }
.adv-method input { position: absolute; opacity: 0; pointer-events: none; }
.adv-method-body {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px;
  border: 1.5px solid var(--border); transition: border-color 0.15s, box-shadow 0.15s;
}
.adv-method input:checked + .adv-method-body { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(241, 90, 44, 0.12); }
.adv-method input:focus-visible + .adv-method-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.adv-method input:disabled + .adv-method-body { opacity: 0.5; cursor: not-allowed; }
.adv-method-body > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.adv-method-body strong { font-size: 14px; }
.adv-method-body small { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.adv-method-icon {
  flex-shrink: 0; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px;
  background: var(--bg); color: var(--text-muted);
}
.adv-method-icon svg { width: 18px; height: 18px; }
.adv-method-icon--mc { background: #7b3ff2; color: #fff; font-weight: 800; }

.adv-buy-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.adv-buy-total strong { font-size: 22px; }

/* Tables */
.adv-table-wrap { overflow-x: auto; }
.adv-table { width: 100%; }
.adv-table td { vertical-align: middle; }
.adv-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.adv-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.adv-sm { padding: 6px 10px; font-size: 12.5px; white-space: nowrap; }
.adv-empty { margin: 8px 0 0; }
.badge-pending_review, .badge-scheduled { background: rgba(2, 132, 199, 0.12); color: var(--info); }
.badge-ended { background: rgba(91, 100, 120, 0.12); color: var(--text-muted); }

/* Payment dialog */
.adv-pay { width: min(620px, calc(100vw - 32px)); }
.adv-ref {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 10px;
  background: rgba(241, 90, 44, 0.08); border: 1px solid rgba(241, 90, 44, 0.25); margin-bottom: 14px;
}
.adv-ref span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); }
.adv-ref code { font-size: 18px; font-weight: 800; letter-spacing: 0.04em; }
.adv-wire { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.adv-wire-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; font-size: 14px; }
.adv-wire-row + .adv-wire-row { border-top: 1px solid var(--border); }
.adv-wire-row span { color: var(--text-muted); font-size: 13px; }
.adv-wire-row strong { word-break: break-word; }
.adv-copy {
  margin-left: auto; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface);
  font: inherit; font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer;
}
.adv-copy:hover { color: var(--text); }

.adv-mc { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.adv-mc-qr { padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--border); }
.adv-mc-qr img { display: block; width: 220px; height: 220px; }
.adv-mc-info { display: flex; flex-direction: column; gap: 10px; }
.adv-mc-info p { margin: 0; }
.adv-mc-amount { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.adv-mc-amount span { font-size: 15px; color: var(--text-muted); font-weight: 700; }
.adv-mc-steps { margin: 4px 0; padding-left: 18px; font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.adv-mc-info .btn:hover { text-decoration: none; }
.adv-mc-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.adv-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: adv-spin 0.8s linear infinite; }
@keyframes adv-spin { to { transform: rotate(360deg); } }

.adv-paid { text-align: center; padding: 12px 0 4px; }
.adv-paid-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: rgba(22, 163, 74, 0.12); color: var(--success); font-size: 28px; font-weight: 800; }
.adv-paid h3 { margin: 12px 0 6px; font-size: 18px; text-transform: none; letter-spacing: normal; color: var(--text); }

/* Responsive */
@media (max-width: 1180px) {
  .adv-grid { grid-template-columns: 1fr; }
  .adv-buy { position: static; }
}
@media (max-width: 860px) {
  .adv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adv-placements, .adv-fields, .adv-ai-results { grid-template-columns: 1fr; }
  .adv-mc { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .adv-mc-steps { text-align: left; }
  .adv-wire-row { grid-template-columns: 1fr auto; }
  .adv-wire-row span { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .adv-wire-frame--top .wf-top, .adv-wire-frame--side .wf-side, .adv-spinner, .adv-ai-skel, .adv-flash { animation: none; }
}
