/* ═══════════════════════════════════════════════════════════════════
   BUFO GUTENBERG BLOCKS — Front-end Styles
   8 blocks: alerta, terminal, ficha, testigo, evidencia,
             redactado, señal, comparativa
   ═══════════════════════════════════════════════════════════════════ */

/* ── Shared ── */
[class^="bb-"] { box-sizing: border-box; }

/* ═══════════════════════════════════════════════════════════════════
   1. ALERTA CLASIFICADA
   ═══════════════════════════════════════════════════════════════════ */
.bb-alerta {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 12px;
  margin: 2rem 0;
  overflow: hidden;
  border: 1px solid;
}
.bb-alerta__icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}
.bb-alerta__title {
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.bb-alerta__text { font-size: 0.9rem; line-height: 1.6; opacity: 0.85; }
.bb-alerta__scan {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(255,255,255,.006) 3px, rgba(255,255,255,.006) 4px);
  pointer-events: none;
}

/* Levels */
.bb-alerta--info      { background: rgba(59,130,246,.06); border-color: rgba(59,130,246,.2); }
.bb-alerta--info .bb-alerta__icon  { background: rgba(59,130,246,.1); }
.bb-alerta--info .bb-alerta__title { color: #3b82f6; }

.bb-alerta--warning      { background: rgba(251,191,36,.06); border-color: rgba(251,191,36,.2); }
.bb-alerta--warning .bb-alerta__icon  { background: rgba(251,191,36,.1); }
.bb-alerta--warning .bb-alerta__title { color: #fbbf24; }

.bb-alerta--danger      { background: rgba(239,68,68,.06); border-color: rgba(239,68,68,.2); }
.bb-alerta--danger .bb-alerta__icon  { background: rgba(239,68,68,.1); }
.bb-alerta--danger .bb-alerta__title { color: #ef4444; }

.bb-alerta--classified      { background: rgba(34,197,94,.04); border-color: rgba(34,197,94,.2); }
.bb-alerta--classified .bb-alerta__icon  { background: rgba(34,197,94,.1); }
.bb-alerta--classified .bb-alerta__title { color: #22c55e; }

/* ═══════════════════════════════════════════════════════════════════
   2. TERMINAL
   ═══════════════════════════════════════════════════════════════════ */
.bb-terminal {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin: 2rem 0;
  border: 1px solid rgba(34,197,94,.12);
  background: #0a0c0f;
}
.bb-term__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(34,197,94,.04);
  border-bottom: 1px solid rgba(34,197,94,.08);
}
.bb-term__dot { width: 10px; height: 10px; border-radius: 50%; }
.bb-term__dot--r { background: #ef4444; }
.bb-term__dot--y { background: #fbbf24; }
.bb-term__dot--g { background: #22c55e; }
.bb-term__bar-title {
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  color: rgba(255,255,255,.35);
  margin-left: auto;
}
.bb-term__body {
  padding: 18px 20px;
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  line-height: 1.8;
  color: rgba(34,197,94,.7);
}
.bb-term__line { white-space: pre-wrap; word-break: break-all; }
.bb-term__line--prompt { color: #22c55e; }
.bb-term__prompt { color: rgba(34,197,94,.5); margin-right: 6px; }
.bb-term__line--ok { color: #22c55e; }
.bb-term__line--err { color: #ef4444; }
.bb-term__cursor {
  display: inline-block;
  animation: bb-blink 1s step-end infinite;
  color: #22c55e;
}
@keyframes bb-blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
.bb-term__scan {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(255,255,255,.006) 3px, rgba(255,255,255,.006) 4px);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════
   3. FICHA TÉCNICA
   ═══════════════════════════════════════════════════════════════════ */
.bb-ficha {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin: 2rem 0;
  border: 1px solid rgba(34,197,94,.12);
  background: rgba(34,197,94,.02);
}
.bb-ficha__strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(34,197,94,.08);
  background: rgba(34,197,94,.04);
}
.bb-ficha__classif {
  font-family: var(--font-mono, monospace);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #22c55e;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.2);
}
.bb-ficha__ref {
  font-family: var(--font-mono, monospace);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,.3);
}
.bb-ficha__body { padding: 6px 0; }
.bb-ficha__row {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255,255,255,.03);
  font-size: 0.85rem;
}
.bb-ficha__row:last-child { border-bottom: none; }
.bb-ficha__key {
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
}
.bb-ficha__val { color: rgba(255,255,255,.8); font-weight: 500; }
.bb-ficha__scan {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(255,255,255,.006) 3px, rgba(255,255,255,.006) 4px);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════
   4. CITA DE TESTIGO
   ═══════════════════════════════════════════════════════════════════ */
.bb-testigo {
  border-radius: 12px;
  overflow: hidden;
  margin: 2rem 0;
  border: 1px solid rgba(34,197,94,.1);
  background: rgba(34,197,94,.02);
}
.bb-testigo__strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(34,197,94,.06);
  background: rgba(34,197,94,.03);
}
.bb-testigo__id {
  font-family: var(--font-mono, monospace);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(34,197,94,.5);
}
.bb-testigo__badge {
  font-family: var(--font-mono, monospace);
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 4px;
}
.bb-testigo__badge--alta       { background: rgba(34,197,94,.1); color: #22c55e; border: 1px solid rgba(34,197,94,.2); }
.bb-testigo__badge--media      { background: rgba(251,191,36,.1); color: #fbbf24; border: 1px solid rgba(251,191,36,.2); }
.bb-testigo__badge--baja       { background: rgba(239,68,68,.1); color: #ef4444; border: 1px solid rgba(239,68,68,.2); }
.bb-testigo__badge--sin_valorar { background: rgba(255,255,255,.05); color: rgba(255,255,255,.4); border: 1px solid rgba(255,255,255,.1); }

.bb-testigo__quote {
  padding: 20px 24px;
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255,255,255,.8);
  font-style: italic;
  border-left: 3px solid rgba(34,197,94,.2);
  background: rgba(34,197,94,.02);
}
.bb-testigo__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 24px;
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  color: rgba(255,255,255,.35);
  border-top: 1px solid rgba(255,255,255,.04);
}
.bb-testigo__name { color: rgba(255,255,255,.6); font-weight: 700; }
.bb-testigo__cred {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px 14px;
}
.bb-testigo__cred-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  flex-shrink: 0;
}
.bb-testigo__bar {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
}
.bb-testigo__fill {
  height: 100%;
  border-radius: 3px;
  transition: width .6s ease;
}

/* ═══════════════════════════════════════════════════════════════════
   5. EVIDENCIA
   ═══════════════════════════════════════════════════════════════════ */
.bb-evidencia {
  border-radius: 12px;
  overflow: hidden;
  margin: 2rem 0;
  border: 1px solid;
}
.bb-evidencia--alta  { border-color: rgba(34,197,94,.2); background: rgba(34,197,94,.03); }
.bb-evidencia--media { border-color: rgba(251,191,36,.2); background: rgba(251,191,36,.03); }
.bb-evidencia--baja  { border-color: rgba(239,68,68,.2); background: rgba(239,68,68,.03); }

.bb-evidencia__strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.bb-evidencia__code {
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,.6);
}
.bb-evidencia__rel {
  font-family: var(--font-mono, monospace);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bb-evidencia--alta .bb-evidencia__rel  { color: #22c55e; }
.bb-evidencia--media .bb-evidencia__rel { color: #fbbf24; }
.bb-evidencia--baja .bb-evidencia__rel  { color: #ef4444; }

.bb-evidencia__body {
  padding: 16px 20px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: rgba(255,255,255,.75);
}

/* ═══════════════════════════════════════════════════════════════════
   6. TEXTO REDACTADO
   ═══════════════════════════════════════════════════════════════════ */
.bb-redactado {
  position: relative;
  margin: 2rem 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(239,68,68,.15);
  background: rgba(0,0,0,.3);
}
.bb-redactado__content {
  padding: 20px 24px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255,255,255,.8);
  filter: blur(5px);
  user-select: none;
}
.bb-redactado__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0,
    transparent 8px,
    rgba(239,68,68,.03) 8px,
    rgba(239,68,68,.03) 16px
  );
}
.bb-redactado__stamp {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ef4444;
  padding: 8px 24px;
  border: 2px solid rgba(239,68,68,.4);
  border-radius: 4px;
  transform: rotate(-3deg);
  background: rgba(0,0,0,.7);
}

/* ═══════════════════════════════════════════════════════════════════
   7. SEÑAL INTERCEPTADA
   ═══════════════════════════════════════════════════════════════════ */
.bb-senal {
  border-radius: 12px;
  overflow: hidden;
  margin: 2rem 0;
  border: 1px solid rgba(34,197,94,.12);
  background: rgba(0,0,0,.25);
}
.bb-senal__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(34,197,94,.06);
  background: rgba(34,197,94,.03);
}
.bb-senal__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34,197,94,.5);
  animation: bb-senal-pulse 2s ease-in-out infinite;
}
@keyframes bb-senal-pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.bb-senal--noise .bb-senal__dot { background: #666; box-shadow: none; animation: none; }
.bb-senal--confirmed .bb-senal__dot { background: #22c55e; }

.bb-senal__label {
  font-family: var(--font-mono, monospace);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(34,197,94,.5);
}
.bb-senal__freq {
  margin-left: auto;
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  font-weight: 700;
  color: #22c55e;
}

.bb-senal__wave { padding: 0 20px; height: 50px; overflow: hidden; opacity: .6; }
.bb-senal__wave svg { width: 100%; height: 100%; }

.bb-senal__data { padding: 14px 20px; }
.bb-senal__row {
  display: flex;
  gap: 10px;
  padding: 5px 0;
  font-size: 0.8rem;
}
.bb-senal__row span { color: rgba(255,255,255,.35); font-family: var(--font-mono, monospace); font-size: 0.7rem; }
.bb-senal__row strong { color: rgba(255,255,255,.7); }
.bb-senal__st--analyzing { color: #fbbf24 !important; }
.bb-senal__st--confirmed { color: #22c55e !important; }
.bb-senal__st--noise     { color: #666 !important; }
.bb-senal__st--unknown   { color: #ef4444 !important; }

/* ═══════════════════════════════════════════════════════════════════
   8. COMPARATIVA
   ═══════════════════════════════════════════════════════════════════ */
.bb-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  margin: 2rem 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(34,197,94,.1);
}
.bb-compare__side {
  padding: 20px 24px;
}
.bb-compare__side--a { background: rgba(59,130,246,.04); }
.bb-compare__side--b { background: rgba(239,68,68,.04); }

.bb-compare__label {
  font-family: var(--font-mono, monospace);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.bb-compare__side--a .bb-compare__label { color: #3b82f6; }
.bb-compare__side--b .bb-compare__label { color: #ef4444; }

.bb-compare__text {
  font-size: 0.88rem;
  line-height: 1.65;
  color: rgba(255,255,255,.7);
}

.bb-compare__vs {
  display: flex;
  align-items: center;
  padding: 0 2px;
  background: rgba(0,0,0,.3);
  border-left: 1px solid rgba(255,255,255,.04);
  border-right: 1px solid rgba(255,255,255,.04);
}
.bb-compare__vs span {
  font-family: var(--font-mono, monospace);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,.25);
  writing-mode: vertical-lr;
  text-orientation: mixed;
}

@media (max-width: 640px) {
  .bb-compare { grid-template-columns: 1fr; }
  .bb-compare__vs {
    writing-mode: horizontal-tb;
    padding: 8px;
    justify-content: center;
    border-left: none; border-right: none;
    border-top: 1px solid rgba(255,255,255,.04);
    border-bottom: 1px solid rgba(255,255,255,.04);
  }
  .bb-compare__vs span { writing-mode: horizontal-tb; }
}

/* ═══════════════════════════════════════════════════════════════════
   PERF / REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .bb-term__cursor, .bb-senal__dot { animation: none; }
}
.perf-tier-3 .bb-term__cursor,
.perf-tier-3 .bb-senal__dot { animation: none; }
.perf-tier-3 .bb-alerta__scan,
.perf-tier-3 .bb-term__scan,
.perf-tier-3 .bb-ficha__scan { display: none; }
