/* ============================================================
   ActivGate Ad Units
   static/css/ads.css
   ============================================================ */

/* Ad Units (search results / detail pages) */
.ad-unit {
  position: relative;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
}
.ad-unit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.ad-unit__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(37, 99, 235, 0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  z-index: 2;
}
.ad-unit__content {
  padding: 12px;
}
.ad-unit__content h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
}
.ad-unit__content img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
}
.ad-unit__why {
  display: block;
  padding: 4px 12px 8px;
  font-size: 11px;
  color: #94a3b8;
  text-align: right;
  text-decoration: none;
}
.ad-unit__why:hover {
  color: #2563eb;
}

/* Display card (blog / social feeds) */
.ad-display-card {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.ad-display-card .badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

/* Post-booking ad */
.ad-post-booking {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-top: 20px;
}
.ad-post-booking h5 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Promote banner on partner dashboard */
.ad-promote-banner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.03), rgba(79, 70, 229, 0.03));
  border: 2px solid rgba(37, 99, 235, 0.15);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
}
.ad-promote-banner h5 {
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}
.ad-promote-banner p {
  color: #64748b;
  font-size: 14px;
  margin-bottom: 14px;
}

/* Boost button on owned content */
.ag-boost-btn,
.ag-card__action-btn--boost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 6px;
  padding: 3px 10px;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}
.ag-boost-btn:hover,
.ag-card__action-btn--boost:hover {
  background: rgba(37, 99, 235, 0.15);
  color: #1d4ed8;
  text-decoration: none;
}
.ag-boost-btn svg,
.ag-card__action-btn--boost svg {
  stroke: currentColor;
}

/* ============================================================
   Ads Studio shared primitives (dashboard.html, campaign_detail.html)
   ============================================================ */

.mgrBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--line, #e5e7eb);
  background: var(--surface, #fff);
  color: var(--heading, #1e293b);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: opacity .15s;
}
.mgrBtn:hover { opacity: .88; text-decoration: none; }
.mgrBtn--primary {
  background: linear-gradient(145deg, var(--primary, #2563eb), var(--accent, #4f46e5));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(46, 116, 184, .22);
}

.studio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.studio-muted {
  color: var(--muted, #64748b);
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.6;
}

.studio-card {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 14px;
  box-shadow: var(--shadow-soft, 0 1px 3px rgba(0, 0, 0, .06));
  overflow: auto;
}

/* ---- Wave 4: rich native ad unit (CLS-safe, tracked) ---- */
.ad-native-card {
  display: block;
  position: relative;
  border: 1px solid rgba(46, 116, 184, 0.15);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  text-decoration: none;
  color: inherit;
  min-height: 300px; /* reserves layout before/without image → zero CLS */
  transition: box-shadow .15s ease, transform .15s ease;
}
.ad-native-card:hover { box-shadow: 0 6px 20px rgba(30, 40, 74, 0.10); transform: translateY(-1px); }
.ad-native-card__media { position: relative; aspect-ratio: 16 / 10; background: #eef2f7; }
.ad-native-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-native-card__media-fallback { width: 100%; height: 100%; background: linear-gradient(135deg, #e2e8f0, #cbd5e1); }
.ad-native-card__badge {
  position: absolute; top: 10px; left: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: #334155; background: rgba(255,255,255,0.92); padding: 3px 8px; border-radius: 5px;
}
.ad-native-card__body { padding: 12px 14px 40px; }
.ad-native-card__title { font-size: 15px; font-weight: 700; color: #1e293b; line-height: 1.3; margin-bottom: 4px; }
.ad-native-card__meta { font-size: 12.5px; color: #64748b; margin-bottom: 8px; min-height: 16px; }
.ad-native-card__foot { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #475569; }
.ad-native-card__price { margin-left: auto; font-weight: 700; color: #1e293b; }
.ad-native-card__rating { color: #b45309; font-weight: 600; }
.ad-native-card__why {
  position: absolute; bottom: 8px; right: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid rgba(46,116,184,0.2); background: rgba(255,255,255,0.9);
  color: #64748b; font-size: 13px; line-height: 1; cursor: pointer;
}
.ad-native-card__why:hover { color: #1e293b; background: #fff; }

/* ---- Wave 5 T13: Search Top premium slot chrome ----
   Painted as a descendant of the served ad card itself, NOT on the
   `.ad-slot--search-top` wrapper (that wrapper is always rendered, even
   with no ad — see templates/ads/partials/_search_top_slot.html). Keeping
   the border/gradient/spacing here means an empty slot is a bare,
   invisible <div>, and a served search_top ad still looks premium. */
.ad-slot--search-top .ad-native-card {
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(255, 255, 255, 0));
  margin-bottom: 16px;
}

/* ---- Wave 4: why-this-ad popover ---- */
.ad-why-pop { width: 320px; max-width: calc(100vw - 16px); background: #fff; border: 1px solid rgba(46,116,184,0.18); border-radius: 12px; box-shadow: 0 12px 40px rgba(30,40,74,0.18); padding: 12px 14px; }
.ad-why-pop__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ad-why-pop__x { border: 0; background: none; cursor: pointer; font-size: 13px; color: #64748b; }
.ad-why-pop__adv { font-size: 12.5px; font-weight: 600; color: #1e293b; margin-bottom: 6px; }
.ad-why-pop__reasons { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; font-size: 12px; color: #334155; }
.ad-why-pop__reasons li { padding-left: 14px; position: relative; }
.ad-why-pop__reasons li::before { content: "•"; position: absolute; left: 2px; color: #94a3b8; }
.ad-why-pop__ctls { display: grid; gap: 6px; }
.ad-why-pop__ctl { text-align: left; border: 1px solid rgba(46,116,184,0.14); background: #f8fafc; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; cursor: pointer; }
.ad-why-pop__ctl:hover { background: #eef2f7; }
.ad-why-pop__manage { display: inline-block; margin-top: 10px; font-size: 11px; color: #2563eb; text-decoration: none; }
.ad-why-pop__error { margin-top: 8px; font-size: 12px; color: #dc2626; }
