/* DP Ads Manager — Front-End Styles */
/* All ad zones: responsive, clean, no layout breaking */

/* ── Base Ad Wrapper ── */
.dpam-zone { width: 100%; }
.dpam-ad   {
  width: 100%;
  overflow: hidden;
  position: relative;
}
.dpam-inner {
  box-sizing: border-box;
  width: 100%;
  padding: 0;
}

/* ── Brand Label ── */
.dpam-brand {
  display: block;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .55;
  padding: 4px 0 2px;
  text-align: center;
}

/* ── Ad Disclosure Label (Sponsored / Ad / Advertisement) ── */
.dpam-ad-label {
  display: block;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .5;
  text-align: center;
  padding: 2px 0;
}
/* Hide brand when label is shown — avoid redundancy */
.dpam-ad-label + .dpam-brand { display: none; }

/* ── Image wrapper — always full width ── */
.dpam-img-wrap {
  width: 100%;
  text-align: center;
}
.dpam-img-link {
  display: block;
  width: 100%;
}
.dpam-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
}

/* ══════════════════════════════════════════
   TOP BAR
══════════════════════════════════════════ */
.dpam-zone-top_bar {
  position: relative;
  z-index: 9999;
  width: 100%;
}
.dpam-pos-top_bar {
  padding: 10px 16px;
  text-align: center;
}
.dpam-pos-top_bar .dpam-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.dpam-pos-top_bar .dpam-img {
  max-height: 50px;
  width: auto;
  max-width: 100%;
  border-radius: 4px;
  object-fit: contain;
}
@media (max-width: 600px) {
  .dpam-pos-top_bar .dpam-inner { flex-direction: column; gap: 8px; }
  .dpam-pos-top_bar { padding: 8px 12px; }
}

/* ══════════════════════════════════════════
   IN-CONTENT + BELOW CONTENT
══════════════════════════════════════════ */
.dpam-zone-in_content,
.dpam-zone-below_content {
  clear: both;
  margin: 28px auto;
  text-align: center;
}
.dpam-pos-in_content,
.dpam-pos-below_content {
  padding: 12px 16px;
  border-radius: 10px;
  text-align: center;
}
.dpam-pos-in_content .dpam-img,
.dpam-pos-below_content .dpam-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: inline-block;
}
@media (max-width: 480px) {
  .dpam-zone-in_content,
  .dpam-zone-below_content { margin: 20px auto; }
}

/* ══════════════════════════════════════════
   IMAGE ADS
══════════════════════════════════════════ */
.dpam-img-link {
  display: inline-block;
  position: relative;
  text-decoration: none;
}
.dpam-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.dpam-img-link:hover .dpam-img { opacity: .92; }

/* ══════════════════════════════════════════
   CTA BUTTON
══════════════════════════════════════════ */
.dpam-cta-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 24px;
  background: #6C63FF;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 700;
  transition: background .2s, transform .15s;
  cursor: pointer;
  border: none;
}
.dpam-cta-btn:hover {
  background: #5a52e0;
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════
   VIDEO
══════════════════════════════════════════ */
.dpam-video-wrap {
  position: relative;
  text-align: center;
}
.dpam-video-wrap iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 8px;
  display: block;
}
.dpam-video-cta {
  margin-top: 12px;
  display: inline-block;
}

/* ══════════════════════════════════════════
   HTML / SCRIPT CODE ADS
══════════════════════════════════════════ */
.dpam-code-wrap {
  width: 100%;
  overflow: hidden;
  text-align: center;
}
.dpam-code-wrap > * { max-width: 100%; }

/* ══════════════════════════════════════════
   POPUP
══════════════════════════════════════════ */
#dpam-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#dpam-popup-box {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  width: min(520px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  animation: dpam-popup-in .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes dpam-popup-in {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
#dpam-popup-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(0,0,0,.08);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: .9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background .2s;
}
#dpam-popup-close:hover { background: rgba(0,0,0,.18); }
#dpam-popup-box .dpam-ad { border-radius: 10px; overflow: hidden; }
#dpam-popup-box .dpam-img { width: 100%; border-radius: 8px; }

/* Popup dark bg ads */
#dpam-popup-box .dpam-pos-popup { padding: 0; }

/* ══════════════════════════════════════════
   RESPONSIVE OVERRIDES
══════════════════════════════════════════ */
@media (max-width: 480px) {
  #dpam-popup-box   { padding: 14px; }
  .dpam-cta-btn     { font-size: .8rem; padding: 9px 18px; }
  .dpam-video-wrap iframe { border-radius: 6px; }
}

/* Dark mode — auto-match site's dark mode if present */
.dark-mode #dpam-popup-box,
[data-color-mode="dark"] #dpam-popup-box {
  background: #1a1d27;
  color: #F1F5F9;
}
