/* ==========================================================================
   Estilos de Accesibilidad WCAG 2.1 AA, Diff Viewer y Modo Grid (Mejoras #22, #23, #25)
   ========================================================================== */

/* Skip to content link para lectores de pantalla */
.skip-to-content {
  position: absolute;
  top: -999px;
  left: 1rem;
  background: var(--color-primary, #6366f1);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: top 0.2s ease-in-out;
}

.skip-to-content:focus {
  top: 1rem;
}

/* Oculto visualmente pero accesible para lectores de pantalla */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Indicadores de foco visibles y de alto contraste (WCAG 2.1) */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-primary, #6366f1);
  outline-offset: 2px;
}

/* ==========================================================================
   Visor de Diferencias (Diff Viewer)
   ========================================================================== */
.diff-legends {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.legend-color-box {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.legend-color-box.del {
  background: rgba(239, 68, 68, 0.3);
  border: 1px solid #ef4444;
}

.legend-color-box.add {
  background: rgba(34, 197, 94, 0.3);
  border: 1px solid #22c55e;
}

.diff-split-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.diff-panel-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-secondary, #94a3b8);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.diff-content {
  background:var(--bg-panel);
  padding: 1rem;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--color-border, #334155);
}

.diff-unified-box {
  background:var(--bg-panel);
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid var(--color-border, #334155);
}

.diff-unified-content {
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.6;
}

ins.diff-add {
  background-color: rgba(34, 197, 94, 0.25);
  color: #4ade80;
  text-decoration: none;
  padding: 0.1rem 0.25rem;
  border-radius: 2px;
}

del.diff-del {
  background-color: rgba(239, 68, 68, 0.25);
  color:var(--text-error);
  text-decoration: line-through;
  padding: 0.1rem 0.25rem;
  border-radius: 2px;
}

.modal-badge-diff {
  font-size: 0.7rem;
  background: var(--color-primary, #6366f1);
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  margin-right: 0.5rem;
}

.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
}

.shortcuts-table td {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border, #334155);
}

.shortcuts-table kbd {
  background:var(--bg-soft);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: monospace;
  font-weight: bold;
}
