/* Estilos para el bloque de cÃ³digo AB */
.ab-copy-block {
  position: relative;
  margin: 1rem 0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  background: #1f2937; /* gris oscuro suave por si no carga el theme de highlight */
  color: #e5e7eb;
  padding: 0.75rem;
}

.ab-copy-block .boton-copiar {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: #1d4ed8;
  color: #fff;
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.ab-copy-block pre.ab-code {
  margin: 0;
  white-space: pre;
  overflow: auto; /* scroll solo si es necesario */
  padding: 0.75rem;
  border-radius: 8px;
  background: transparent; /* lo pinta highlight.js */
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.45;
}

.ab-copy-block .mensaje-emergente {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(17, 24, 39, 0.95);
  color: #fff;
  padding: 10px 12px;
  border-radius: 6px;
  z-index: 9999;
  display: none;
}

/* Overlay no registrados */
.ab-copy-block .contenedor-imagen { position: relative; border-radius: 10px; overflow: hidden; }
.ab-copy-block .imagen-contenedor { width: 100%; height: auto; display: block; }
.ab-copy-block .capa-negra { position: absolute; inset:0; background: rgba(0,0,0,0.55); }
.ab-copy-block .mensaje-superpuesto {
  position: absolute; inset:0; display:flex; align-items:center; justify-content:center;
  color:#fff; text-align:center; font-weight:600; padding: 1rem;
}
.ab-copy-block .mensaje-superpuesto a { color:#60a5fa; text-decoration: underline; }
/* Editor-specific tweaks */
.ab-copy-block.ab-is-editor { position: relative; z-index: 0; }

/* Asegura que el wrapper reciba el foco/selecci¨®n en el editor */
.ab-copy-block.ab-is-editor {
  position: relative;
  z-index: 0;
}
.ab-copy-block.ab-is-editor * {
  pointer-events: auto;
}

/* ===== Overlay Mejorado ===== */
.ab-copy-block .mensaje-superpuesto {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  backdrop-filter: blur(6px);
  background: rgba(0, 0, 0, 0.55);
  border-radius: 10px;
  padding: 1.5rem;
}

.ab-overlay-box {
  max-width: 400px;
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

.ab-overlay-text {
  color: #f9fafb;
  font-size: 1rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.ab-overlay-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.ab-overlay-buttons a {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background 0.2s ease-in-out;
}

.ab-btn-acceder {
  background: #2563eb;
  color: #fff;
}

.ab-btn-acceder:hover {
  background: #1e40af;
}

.ab-btn-registrarse {
  background: #16a34a;
  color: #fff;
}

.ab-btn-registrarse:hover {
  background: #15803d;
}


/* Toast "Copiado" dentro del bloque */
.ab-copy-block {
  position: relative;
}

.ab-copy-block .ab-toast {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translate(-50%, -10px);
  background: #111827;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.ab-copy-block .ab-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

