/* ══════════════════════════════════════════
   VOUCH STEP POPOVERS
   Interactive hover panels for "Cómo funciona"
══════════════════════════════════════════ */

/* ── Wrapper ── */
.vp {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: 320px;
  height: 380px;
  background: #111;
  border: 1px solid rgba(118,244,6,.18);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(118,244,6,.06),
    0 24px 48px rgba(0,0,0,.65),
    0 0 40px rgba(118,244,6,.05);
  opacity: 0;
  pointer-events: none;
  z-index: 500;
  transition: opacity .22s ease, transform .22s cubic-bezier(.16,1,.3,1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Arrow caret points UP (toward the step above) */
.vp::after {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px;
  background: #111;
  border-left: 1px solid rgba(118,244,6,.18);
  border-top: 1px solid rgba(118,244,6,.18);
}

.vp.vp-visible {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

/* Smart edge clipping – step 1 pops right, step 4 pops left */
.steps-row .step:first-child .vp { left: 0; transform: translateX(0) translateY(-8px); }
.steps-row .step:first-child .vp::after { left: 50px; }
.steps-row .step:first-child .vp.vp-visible { transform: translateX(0) translateY(0); }

.steps-row .step:last-child .vp { left: auto; right: 0; transform: translateX(0) translateY(-8px); }
.steps-row .step:last-child .vp::after { left: auto; right: 50px; }
.steps-row .step:last-child .vp.vp-visible { transform: translateX(0) translateY(0); }

/* ── Window Bar ── */
.vp-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
}

.vp-dots {
  display: flex;
  gap: 5px;
}

.vp-dots span {
  display: block;
  width: 9px; height: 9px;
  border-radius: 50%;
}

.vp-dots span:nth-child(1) { background: #ff5f57; }
.vp-dots span:nth-child(2) { background: #febc2e; }
.vp-dots span:nth-child(3) { background: #28c840; }

.vp-label {
  font-size: 10px;
  color: rgba(255,255,255,.35);
  letter-spacing: .06em;
}

/* ── Body ── */
.vp-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}

.vp-section-label {
  font-size: 10px;
  color: rgba(255,255,255,.3);
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* ─────────────────────────────
   POPOVER 1 – RECEPCIÓN
───────────────────────────── */

.vp-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  gap: 8px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  padding: 12px;
  flex: 1;
}

.vp-file {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(118,244,6,.06);
  border: 1px solid rgba(118,244,6,.18);
  border-radius: 8px;
  padding: 8px 12px;
  width: 100%;
  transition: opacity .3s ease, transform .3s ease;
}

.vp-file-info {
  display: flex;
  flex-direction: column;
}

.vp-file-info strong {
  font-size: 11px;
  color: #fff;
}

.vp-file-info span {
  font-size: 10px;
  color: rgba(255,255,255,.35);
  margin-top: 1px;
}

.vp-arrow-down {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.vp-arrow-shaft {
  width: 1px;
  height: 14px;
  background: rgba(118,244,6,.4);
}

.vp-arrow-head {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid rgba(118,244,6,.5);
}

.vp-api-box {
  font-size: 11px;
  color: rgba(255,255,255,.5);
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  padding: 7px 10px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.vp-method {
  background: rgba(118,244,6,.15);
  color: #76f406;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
}

.vp-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-size: 10px;
  color: rgba(255,255,255,.4);
}

.vp-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #76f406;
  animation: pop-blink 1s ease-in-out infinite;
}

@keyframes pop-blink {
  0%,100% { opacity: 1; }
  50% { opacity: .2; }
}

.vp-prog-wrap {
  height: 3px;
  background: rgba(255,255,255,.07);
  border-radius: 99px;
  overflow: hidden;
}

.vp-prog {
  height: 100%;
  background: #76f406;
  border-radius: 99px;
  width: 0%;
  transition: width .4s ease;
  box-shadow: 0 0 6px rgba(118,244,6,.5);
}

.vp-confirm {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: #76f406;
  transition: opacity .4s ease;
}

/* ─────────────────────────────
   POPOVER 2 – ANÁLISIS IA
───────────────────────────── */

.vp-scan-wrap {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  background: #000;
  border: 1px solid rgba(255,255,255,.08);
}

.vp-scan-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .75;
  display: block;
}

.vp-scan-line {
  position: absolute;
  left: 0; right: 0;
  top: 0%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #76f406 40%, #76f406 60%, transparent);
  box-shadow: 0 0 12px rgba(118,244,6,.8), 0 0 24px rgba(118,244,6,.4);
  z-index: 5;
  transition: top 2s linear, opacity .3s;
  pointer-events: none;
}

.vp-scan-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(118,244,6,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118,244,6,.03) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.vp-scan-corners {
  position: absolute;
  inset: 6px;
  pointer-events: none;
}

.vp-corner {
  position: absolute;
  width: 14px; height: 14px;
  border-color: #76f406;
  border-style: solid;
  opacity: .7;
}

.vp-corner.tl { top: 0; left: 0; border-width: 2px 0 0 2px; }
.vp-corner.tr { top: 0; right: 0; border-width: 2px 2px 0 0; }
.vp-corner.bl { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.vp-corner.br { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.vp-checks {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.vp-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(255,255,255,.45);
  transition: opacity .3s ease, color .3s ease;
}

.vp-check.vp-check-done {
  color: rgba(255,255,255,.75);
}

.vp-check-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  flex-shrink: 0;
  transition: background .3s ease;
}

.vp-check.vp-check-done .vp-check-dot {
  background: #76f406;
  box-shadow: 0 0 6px rgba(118,244,6,.6);
}

.vp-check-bad {
  background: #ff5555 !important;
  box-shadow: 0 0 6px rgba(255,85,85,.6) !important;
}

/* ─────────────────────────────
   POPOVER 3 – BÚSQUEDA WEB
───────────────────────────── */

/* Compact top header row */
.vp-web-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.vp-submitted-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.vp-submitted-img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(118,244,6,.25);
  display: block;
}

.vp-web-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.vp-search-anim {
  opacity: .8;
  animation: search-pulse 1.5s ease-in-out infinite;
}

@keyframes search-pulse {
  0%,100% { opacity: .5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

.vp-coin-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.vp-count-big {
  font-size: 32px;
  font-weight: 800;
  color: #76f406;
  line-height: 1;
  letter-spacing: -1px;
}

/* Grid fills all remaining height */
.vp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
  flex: 1;
  min-height: 0;
}

.vp-grid-item {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  transition: opacity .25s ease, transform .25s ease;
  cursor: default;
  min-height: 0;
}

.vp-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(.85);
}

.vp-match-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.72);
  color: #76f406;
  font-size: 9px;
  font-weight: 600;
  text-align: center;
  padding: 2px 0;
  letter-spacing: .04em;
}

.vp-match-label.match-high {
  color: #76f406;
  background: rgba(118,244,6,.18);
}

.vp-match-label.match-mid {
  color: #febc2e;
  background: rgba(254,188,46,.14);
}

/* Source tag – "Red social X · Internet" */
.vp-source-tag {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  padding: 5px 10px;
  flex-shrink: 0;
  letter-spacing: .03em;
}

.vp-source-tag svg { flex-shrink: 0; }

.vp-found {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: #ff5555;
  transition: opacity .4s ease;
  padding: 6px 8px;
  background: rgba(255,85,85,.07);
  border: 1px solid rgba(255,85,85,.15);
  border-radius: 7px;
  flex-shrink: 0;
}

/* ─────────────────────────────
   POPOVER 4 – RESULTADO
───────────────────────────── */

.vp-score-center {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  min-height: 0;
}

.vp-gauge-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.vp-gauge-svg {
  width: 180px;
  height: 110px;
}

.vp-score-num {
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
  color: #76f406;
  transition: color .1s;
  margin-top: -10px;
  letter-spacing: -2px;
}

.vp-score-lbl {
  font-size: 10px;
  color: rgba(255,255,255,.4);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 2px;
}

.vp-risk-bar {
  position: relative;
  height: 6px;
  border-radius: 99px;
  overflow: visible;
  display: flex;
  gap: 2px;
  margin: 4px 0 24px;
}

.vp-risk-seg {
  flex: 1;
  border-radius: 99px;
  height: 100%;
  opacity: .6;
}

.vp-risk-needle {
  position: absolute;
  top: -5px;
  width: 3px; height: 16px;
  background: #fff;
  border-radius: 99px;
  box-shadow: 0 0 8px rgba(255,255,255,.5);
  transform: translateX(-50%);
  transition: left .1s linear;
}

.vp-risk-labels {
  position: absolute;
  bottom: -18px;
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: rgba(255,255,255,.25);
  font-family: 'JetBrains Mono', monospace;
}

.vp-rec {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(255,255,255,.6);
  background: rgba(255,85,85,.07);
  border: 1px solid rgba(255,85,85,.15);
  border-radius: 7px;
  padding: 8px 10px;
  transition: opacity .4s ease;
}

.vp-rec span:first-child {
  color: #ff5555;
  font-size: 14px;
  flex-shrink: 0;
}

/* ── Hide on mobile/tablet (popovers not useful on touch) ── */
@media (max-width: 900px) {
  .vp { display: none !important; }
}
