/* ============================================================================
   VISION ENGLISH — ESTILOS DEL CORRECTOR DE ESCRITURA
   Usa las variables de la app (paleta y modo oscuro heredados).
   ========================================================================= */

.vc-widget {
  position: relative;
  max-width: 100%;
}

.vc-caja {
  min-height: 130px;
  padding: 16px 18px;
  border: 1.5px solid var(--line, rgba(111, 122, 157, .2));
  border-radius: 16px;
  background: var(--bg, #fbfaff);
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.75;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.vc-caja:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(116, 57, 246, .14);
}

.vc-caja:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}

/* El error: subrayado rojo ondulado, como un corrector ortográfico. */
.vc-error {
  cursor: pointer;
  border-radius: 3px;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: hsl(354, 82%, 58%);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: background .15s;
}

.vc-error:hover,
.vc-error:focus-visible {
  background: hsla(354, 82%, 58%, .12);
  outline: none;
}

/* Un matiz de color por tipo, sutil, sin perder la legibilidad del texto. */
.vc-error-ortografia { text-decoration-color: hsl(354, 82%, 58%); }
.vc-error-gramatica  { text-decoration-color: hsl(28, 90%, 54%); }
.vc-error-vocabulario { text-decoration-color: hsl(268, 70%, 60%); }

.vc-barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.vc-contador {
  font-size: .82rem;
  color: var(--muted);
}

.vc-boton-revisar {
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  color: #fff;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(116, 57, 246, .28);
  transition: transform .15s, box-shadow .15s, opacity .15s;
}

.vc-boton-revisar:hover:not(:disabled) { transform: translateY(-1px); }
.vc-boton-revisar:disabled { opacity: .65; cursor: progress; }

.vc-resumen {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(116, 57, 246, .08);
  color: var(--text-secondary, var(--muted));
  font-size: .9rem;
  line-height: 1.55;
}

.vc-resumen-error {
  background: hsla(354, 82%, 58%, .1);
  color: hsl(354, 70%, 42%);
}

/* ── Tarjeta emergente ────────────────────────────────────────────────── */

.vc-popover {
  position: absolute;
  z-index: 20;
  width: min(320px, calc(100% - 16px));
  padding: 16px;
  border-radius: 14px;
  background: var(--surface-strong, #fff);
  border: 1px solid var(--line, rgba(111, 122, 157, .18));
  box-shadow: var(--shadow, 0 18px 50px rgba(45, 54, 88, .18));
  animation: vcAsomar .18s ease;
}

@keyframes vcAsomar {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.vc-pop-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.vc-pop-tipo {
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--purple);
}

.vc-pop-cerrar {
  width: 24px; height: 24px;
  border: 0;
  border-radius: 7px;
  background: rgba(111, 122, 157, .12);
  color: var(--muted);
  font-size: .8rem;
  cursor: pointer;
}

.vc-pop-fila {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
}

.vc-pop-mal {
  color: hsl(354, 70%, 48%);
  text-decoration: line-through;
  font-size: .92rem;
}

.vc-pop-flecha { color: var(--muted); }

.vc-pop-bien {
  font-weight: 700;
  color: var(--green);
  font-size: .98rem;
}

.vc-pop-oir {
  margin-left: auto;
  width: 30px; height: 30px;
  border: 1px solid var(--line, rgba(111, 122, 157, .2));
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  font-size: .9rem;
}

.vc-pop-oir:hover { background: rgba(116, 57, 246, .08); }
.vc-pop-oir.sonando { animation: vcPulso 1.1s ease-in-out infinite; }

@keyframes vcPulso {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.12); }
}

.vc-pop-explica, .vc-pop-significa {
  margin: 0 0 6px;
  font-size: .87rem;
  line-height: 1.5;
  color: var(--text-secondary, var(--muted));
}

.vc-pop-explica strong, .vc-pop-significa strong { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .vc-popover { animation: none; }
  .vc-pop-oir.sonando { animation: none; }
}
