/* ============================================================
   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: var(--ag-radius-xl);
  overflow: hidden;
  background: var(--ag-color-bg-surface);
  transition: transform 0.2s, box-shadow 0.2s;
}
.ad-unit:hover {
  transform: translateY(-2px);
  /* Intentionally stronger hover-lift shadow than the token system provides
     (--ag-shadow-* tokens use a tinted rgba(24,33,51,...) base at different
     offsets/blur; none is a close match to this quick, tight lift). Kept
     hardcoded per Task 7 Step 6 rather than inventing a new token. */
  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: var(--ag-radius-sm);
  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: var(--ag-radius-md);
}
.ad-unit__why {
  display: block;
  padding: 4px 12px 8px;
  font-size: 11px;
  color: var(--ag-color-text-muted);
  text-align: right;
  text-decoration: none;
}
.ad-unit__why:hover {
  color: var(--ag-color-brand-primary-hover);
}

/* Display card (blog / social feeds) */
.ad-display-card {
  position: relative;
  border: 1px solid var(--ag-color-border);
  border-radius: var(--ag-radius-xl);
  overflow: hidden;
  background: var(--ag-color-bg-surface);
}
.ad-display-card .badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

/* Post-booking ad */
.ad-post-booking {
  background: var(--ag-color-bg-surface-alt);
  border: 1px solid var(--ag-color-border);
  border-radius: var(--ag-radius-xl);
  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: var(--ag-radius-3xl);
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
}
.ad-promote-banner h5 {
  font-weight: 700;
  color: var(--ag-color-text-heading);
  margin-bottom: 6px;
}
.ad-promote-banner p {
  color: var(--ag-color-text-subtle);
  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: var(--ag-color-brand-primary);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--ag-radius-sm);
  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: var(--ag-radius-xl);
  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: var(--button-gradient);
  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: var(--ag-radius-2xl);
  box-shadow: var(--shadow-soft);
  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: var(--ag-radius-xl);
  overflow: hidden;
  background: var(--ag-color-bg-surface);
  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: var(--ag-color-bg-page-alt); }
.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, var(--ag-color-border), #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: var(--ag-color-text-body); background: rgba(255,255,255,0.92); padding: 3px 8px; border-radius: var(--ag-radius-sm);
}
.ad-native-card__body { padding: 12px 14px 40px; }
.ad-native-card__title { font-size: 15px; font-weight: 700; color: var(--ag-color-text-heading); line-height: 1.3; margin-bottom: 4px; }
.ad-native-card__meta { font-size: 12.5px; color: var(--ag-color-text-subtle); 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: var(--ag-color-text-heading); }
.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: var(--ag-color-text-subtle); font-size: 13px; line-height: 1; cursor: pointer;
}
.ad-native-card__why:hover { color: var(--ag-color-text-heading); background: var(--ag-color-bg-surface); }

/* ---- 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: var(--ag-radius-xl);
  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: var(--ag-color-bg-surface); border: 1px solid rgba(46,116,184,0.18); border-radius: var(--ag-radius-xl); 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: var(--ag-color-text-subtle); }
.ad-why-pop__adv { font-size: 12.5px; font-weight: 600; color: var(--ag-color-text-heading); margin-bottom: 6px; }
.ad-why-pop__reasons { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; font-size: 12px; color: var(--ag-color-text-body); }
.ad-why-pop__reasons li { padding-left: 14px; position: relative; }
.ad-why-pop__reasons li::before { content: "•"; position: absolute; left: 2px; color: var(--ag-color-text-muted); }
.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: var(--ag-color-bg-surface-alt); border-radius: var(--ag-radius-md); padding: 8px 10px; font-size: 12.5px; cursor: pointer; }
.ad-why-pop__ctl:hover { background: var(--ag-color-bg-page-alt); }
.ad-why-pop__manage { display: inline-block; margin-top: 10px; font-size: 11px; color: var(--ag-color-brand-primary); text-decoration: none; }
.ad-why-pop__error { margin-top: 8px; font-size: 12px; color: #dc2626; }
