/**
 * Ad placement styles — dark-themed, BroFi branded.
 * All ad slots maintain layout integrity and never overlap app content.
 */

/* ── General Ad Placement ── */
.ad-placement {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Placeholder (for unmonetized slots) ── */
.ad-placeholder {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  position: relative;
}
.ad-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.ad-brofi-tag {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.ad-label {
  background: var(--accent-dim);
  border: 1px solid rgba(0,255,136,0.2);
  color: var(--accent);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.ad-placeholder-copy {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── PLACEMENT 1: Hero Banner (728x90 leaderboard) ── */
.ad-hero {
  margin: 0;
}
.ad-hero .ad-placeholder {
  border-radius: 0;
  border-left: none;
  border-right: none;
  background: var(--surface);
  padding: 0.5rem;
}

/* ── PLACEMENT 2: Sidebar (300x250 sticky) ── */
.ad-sidebar-fixed {
  position: sticky;
  top: 80px;
  width: 300px;
  flex-shrink: 0;
}
.ad-sidebar-fixed .ad-placeholder {
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── PLACEMENT 3: Mid-Content Banner ── */
.ad-midcontent {
  margin: 2rem 0;
}

/* ── PLACEMENT 4: Mobile Interstitial ── */
.ad-interstitial {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
}
.interstitial-overlay {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.interstitial-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  position: relative;
}
.interstitial-content {
  margin: 1rem 0;
}
.interstitial-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.25rem;
}
.interstitial-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 0 0 16px 16px;
  width: 0%;
  transition: width 5s linear;
}

/* ── PLACEMENT 5: Rewarded Video ── */
.rewarded-video-player {
  background: var(--surface-2);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.rewarded-placeholder {
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.rewarded-progress-bar {
  height: 4px;
  background: var(--surface-2);
  width: 100%;
}
.rewarded-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 30s linear;
}

/* ── PLACEMENT 6: Native In-Feed Ad ── */
.ad-native-card {
  background: var(--surface);
  border: 1px solid rgba(0,255,136,0.12);
  border-radius: 14px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}
.ad-native-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(0,255,136,0.3), transparent);
}
.ad-sponsor-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.ad-native-body {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.ad-native-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.ad-native-content {
  flex: 1;
}
.ad-native-title {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.ad-native-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.ad-native-cta {
  background: var(--accent-dim);
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.2s;
}
.ad-native-cta:hover {
  background: rgba(0,255,136,0.2);
}

/* ── PLACEMENT 7: Push Notification Prompt ── */
.push-prompt {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--surface);
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 14px;
  padding: 1.25rem;
  max-width: 320px;
  z-index: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  display: none;
}
.push-prompt.show {
  display: block;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.push-prompt-title {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.push-prompt-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.push-prompt-actions {
  display: flex;
  gap: 0.5rem;
}
.push-prompt-actions .btn { flex: 1; font-size: 0.78rem; }

/* ── PLACEMENT 8: Sponsored Links ── */
.sponsored-links-block {
  margin-top: 1.5rem;
}
.sponsored-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.sponsored-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface-2);
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
  cursor: pointer;
}
.sponsored-link:hover {
  background: rgba(0,255,136,0.06);
  border-color: rgba(0,255,136,0.2);
}
.sponsored-link-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}
.sponsored-link-body { flex: 1; }
.sponsored-link-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}
.sponsored-link-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.sponsored-link-cta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.sponsored-links-footer {
  text-align: center;
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* ── PLACEMENT 9: Promoted Social (inline prompt) ── */
.promoted-social-prompt {
  background: var(--accent-dim);
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 10px;
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  gap: 1rem;
}
.promoted-social-prompt-text {
  font-size: 0.8rem;
  color: var(--text);
}
.promoted-social-prompt-text strong {
  color: var(--accent);
}

/* ── PLACEMENT 10: Email Digest (handled by backend job, no styles needed) ── */

/* ── Ad Revenue Dashboard (Settings Tab) ── */
.ad-revenue-section {
  margin-top: 1.5rem;
}
.ad-revenue-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.ad-revenue-card {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 0.875rem;
  text-align: center;
}
.ad-revenue-card .ad-rev-val {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
}
.ad-revenue-card .ad-rev-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ad-revenue-breakdown {
  margin-top: 1rem;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 1rem;
}
.ad-rev-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}
.ad-rev-row:last-child { border-bottom: none; }
.ad-rev-row-name { color: var(--text); }
.ad-rev-row-model { color: var(--text-muted); font-size: 0.65rem; }
.ad-rev-row-rev { color: var(--accent); font-weight: 700; }

/* ── Layout: Dashboard with Sidebar ── */
.dashboard-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.dashboard-main {
  flex: 1;
  min-width: 0;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .ad-sidebar-fixed { display: none; }
  .dashboard-layout { flex-direction: column; }
  .ad-revenue-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .ad-hero .ad-placeholder,
  .ad-midcontent .ad-placeholder { border-radius: 8px; }
  .ad-revenue-grid { grid-template-columns: 1fr; }
  .interstitial-box { padding: 1.25rem; }
}