/* ============================================================
   PPC PAGE — PPC-specific parts. Builds on ai-agent-modern.css,
   qa-modern.css, digital-marketing-modern.css and seo-modern.css.
   ============================================================ */

/* ── Hero: sponsored result + KPI trends ─────────────── */
.ppc-hero h1 {
  max-width: 640px;
}

/* Section-matched PPC imagery */
.ppc-page .dm-about-media img,
.ppc-page .ag-why-media img {
  display: block;
  width: 100%;
  aspect-ratio: 10 / 7;
  object-fit: cover;
  object-position: center;
}
.ppc-page .dm-about-media,
.ppc-page .ag-why-media {
  align-self: center;
}
@media (max-width: 900px) {
  .ppc-page .dm-about-media,
  .ppc-page .ag-why-media {
    width: min(100%, 680px);
    justify-self: center;
  }
}
.ppc-visual {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(100%, 520px);
  justify-self: center;
  padding: 20px 0 64px;
}
.ppc-ad {
  padding: 18px;
  border: 1px solid var(--ag-line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 40px 80px -30px rgba(79, 70, 229, 0.45);
}
.ppc-ad-card {
  position: relative;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #c7cdfb;
  border-radius: 16px;
  background: linear-gradient(135deg, #f5f6ff, #f3efff);
}
.ec-motion .ppc-ad-card {
  animation: seoRise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.8s both;
}
.ppc-sponsored {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.ppc-ad-card small {
  display: block;
  color: #047857;
  font-size: 12px;
}
.ppc-ad-card strong {
  display: block;
  margin-top: 2px;
  color: #3730a3;
  font-size: 15.5px;
  line-height: 1.3;
}
.ppc-ad-card p {
  margin-top: 4px;
  color: var(--ag-muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.ppc-sitelinks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.ppc-sitelinks b {
  padding: 4px 10px;
  border: 1px solid #dfe3fb;
  border-radius: 999px;
  background: #fff;
  color: #3730a3;
  font-size: 11.5px;
}
.ppc-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, #111735, #0b1026);
  color: #fff;
  box-shadow: 0 24px 50px -24px rgba(11, 16, 38, 0.6);
}
.ppc-kpis > small {
  grid-column: 1 / -1;
  color: #a5b4fc;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ppc-kpi {
  position: relative;
  padding: 10px 10px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}
.ppc-kpi span {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
}
.ppc-kpi > svg:first-of-type {
  display: block;
  width: 100%;
  height: 36px;
  margin-top: 6px;
  overflow: visible;
}
.ppc-kpi path {
  fill: none;
  stroke: #34d399;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 140;
  stroke-dashoffset: 140;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) calc(0.8s + var(--d, 0ms));
}
.ppc-visual.is-in .ppc-kpi path,
.ag-main:not(.ec-motion) .ppc-kpi path {
  stroke-dashoffset: 0;
}
.ppc-kpi > svg:last-child {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 14px;
  height: 14px;
  color: #34d399;
}
.ppc-budget {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
}
.ppc-budget i {
  position: relative;
  height: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.ppc-budget i::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 68%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #a78bfa, #38bdf8);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) 1.2s;
}
.ppc-visual.is-in .ppc-budget i::after,
.ag-main:not(.ec-motion) .ppc-budget i::after {
  transform: scaleX(1);
}
.ppc-float--neg {
  left: -30px;
  bottom: -12px;
  align-items: flex-start;
  animation-delay: -1.5s;
}
.ppc-float--neg > svg {
  padding: 6px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #fee2e2;
  color: #dc2626;
}
.ppc-float--neg strong {
  display: block;
  font-size: 13.5px;
}
.ppc-float--neg small {
  color: var(--ag-muted);
  font-size: 11.5px;
  font-weight: 500;
}

/* ── Business models ─────────────────────────────────── */
.ppc-models {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.ppc-model {
  padding: 24px;
}
.ppc-model h3 {
  font-size: 17.5px;
}
.ppc-model p {
  font-size: 14px;
}
.ppc-model--wide {
  grid-column: span 2;
  border-color: #dcdcfb;
  background: linear-gradient(135deg, #f5f3ff, #eef2ff);
}

/* ── Split sections (CRO + tracking) ─────────────────── */
.ppc-split {
  align-items: center;
}
.ppc-split .qa-checks {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ── Why choose disclaimer ───────────────────────────── */
.ppc-disclaimer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 26px !important;
  color: #cbd5e1;
  font-size: 14.5px;
  text-align: center;
}
.ppc-disclaimer svg {
  flex: none;
  color: #a5b4fc;
}

/* ── Metrics glossary ────────────────────────────────── */
.ppc-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.ppc-metric {
  padding: 20px;
  border: 1px solid var(--ag-line);
  border-radius: 18px;
  background: #fff;
  transition:
    border-color 0.3s,
    box-shadow 0.3s,
    transform 0.3s;
}
.ppc-metric:hover {
  border-color: #c7cdfb;
  box-shadow: var(--ag-shadow);
  transform: translateY(-4px);
}
.ppc-metric dt {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ag-ink);
  font: 700 15.5px/1.3 var(--font-primary, sans-serif);
}
.ppc-metric dd {
  margin-top: 10px !important;
  color: var(--ag-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1100px) {
  .ppc-models,
  .ppc-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .ppc-split--flip > :first-child {
    order: 2;
  }
  .ppc-float--neg {
    left: 0;
  }
}

@media (max-width: 640px) {
  .ppc-visual {
    padding-bottom: 92px;
  }
  .ppc-float--neg {
    bottom: 8px;
  }
  .ppc-kpis {
    grid-template-columns: minmax(0, 1fr);
  }
  .ppc-models,
  .ppc-metrics,
  .ppc-split .qa-checks {
    grid-template-columns: minmax(0, 1fr);
  }
  .ppc-model--wide {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ppc-ad-card {
    animation: none !important;
  }
  .ppc-kpi path {
    stroke-dashoffset: 0 !important;
  }
  .ppc-budget i::after {
    transform: scaleX(1) !important;
  }
}

/* ============================================================
   AI-assisted PPC: image + 3-step review pipeline
   ============================================================ */
.ppc-ai-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
.ppc-page .ppc-ai-media {
  position: sticky;
  top: 96px;
  overflow: hidden;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7);
}
.ppc-page .ppc-ai-media img {
  display: block;
  width: 100%;
  aspect-ratio: 10 / 8;
  object-fit: cover;
  animation: agImg 14s ease-in-out infinite alternate;
}
.ppc-ai-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(129, 140, 248, 0.22), transparent);
  pointer-events: none;
  animation: ppcScan 4.5s ease-in-out infinite;
}
.ppc-ai-badge {
  position: absolute;
  left: 16px;
  top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ag-ink);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3);
}
.ppc-ai-badge svg {
  color: var(--ag-indigo);
}
.ppc-ai-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(11, 16, 38, 0.82);
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  animation: agBob 5s ease-in-out infinite;
}
.ppc-ai-chip svg {
  color: #a5b4fc;
}
.ppc-ai-chip--1 {
  left: 16px;
  bottom: 18px;
}
.ppc-ai-chip--2 {
  right: 16px;
  bottom: 62px;
  animation-delay: -2.5s;
}
.ppc-ai-chip--2 svg {
  color: #34d399;
}

/* Pipeline */
.ppc-ai-flow .dm-ai-label {
  margin: 0 0 18px !important;
}
.ppc-ai-steps {
  position: relative;
  display: grid;
  gap: 18px;
}
.ppc-ai-steps::before {
  content: "";
  position: absolute;
  left: 23px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: linear-gradient(180deg, #818cf8, #a78bfa 60%, #34d399);
  opacity: 0.55;
}
.ppc-ai-steps::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 24px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(129, 140, 248, 0.35),
    0 0 16px #a5b4fc;
  animation: ppcFlow 5s ease-in-out infinite;
}
.ppc-ai-step {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.ppc-ai-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--ag-grad);
  color: #fff;
  box-shadow:
    0 0 0 6px rgba(129, 140, 248, 0.12),
    0 12px 26px -10px rgba(79, 70, 229, 0.8);
}
.ppc-ai-body {
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  transition:
    border-color 0.3s,
    background 0.3s,
    transform 0.3s;
}
.ppc-ai-step:hover .ppc-ai-body {
  border-color: rgba(165, 180, 252, 0.45);
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(4px);
}
.ppc-ai-body small {
  color: #a5b4fc;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ppc-ai-body h3 {
  margin-top: 4px;
  color: #fff;
  font-size: 19px;
  font-weight: 700;
}
.ppc-ai-body > p:not(.ppc-ai-review) {
  margin-top: 4px;
  color: #b4bfd6;
  font-size: 14px;
}
.ppc-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px !important;
}
.ppc-ai-chips li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(129, 140, 248, 0.1);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
}
.ppc-ai-chips svg {
  flex: none;
  color: #a5b4fc;
}
.ppc-ai-step--review .ppc-ai-node {
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow:
    0 0 0 6px rgba(52, 211, 153, 0.14),
    0 12px 26px -10px rgba(5, 150, 105, 0.8);
}
.ppc-ai-step--review .ppc-ai-body {
  border-color: rgba(52, 211, 153, 0.35);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(255, 255, 255, 0.03));
}
.ppc-ai-step--review small {
  color: #6ee7b7;
}
.ppc-ai-review {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px !important;
  color: #d1fae5;
  font-size: 14.5px;
  line-height: 1.6;
}
.ppc-ai-review svg {
  flex: none;
  margin-top: 3px;
  color: #6ee7b7;
}

@keyframes ppcScan {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(340%);
  }
}
@keyframes ppcFlow {
  0% {
    top: 24px;
    opacity: 0;
  }
  10%,
  85% {
    opacity: 1;
  }
  100% {
    top: calc(100% - 34px);
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .ppc-ai-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ppc-page .ppc-ai-media {
    position: relative;
    top: auto;
    width: min(100%, 640px);
    justify-self: center;
  }
}

@media (max-width: 640px) {
  .ppc-ai-step {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
  }
  .ppc-ai-node {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .ppc-ai-steps::before {
    left: 19px;
  }
  .ppc-ai-steps::after {
    left: 15px;
  }
  .ppc-ai-body {
    padding: 16px;
  }
  .ppc-ai-chip--2 {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ppc-ai-scan,
  .ppc-ai-chip,
  .ppc-ai-steps::after,
  .ppc-page .ppc-ai-media img {
    animation: none !important;
  }
}
