/* ═══════════════════════════════════════════════════════════
   construye-atomo-widget.css — Estilos para el widget y overlay
   del simulador Construye un Átomo (Elemental W)
═══════════════════════════════════════════════════════════ */

.simc-widget--construye-atomo {
  --atomo-p-color: #ef4444;
  --atomo-n-color: #94a3b8;
  --atomo-e-color: #22d3ee;
}

.simc-widget--construye-atomo .simc-widget__lienzo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--ew-color-surface-soft, rgba(0, 0, 0, 0.04));
  border-radius: var(--ew-radius-md);
  padding: var(--ew-space-3);
  overflow: hidden;
}

.atomo-widget-svg {
  width: 100%;
  max-width: 340px;
  height: auto;
  display: block;
}

.atomo-widget-leyenda {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ew-space-3);
  justify-content: center;
  margin-top: var(--ew-space-2);
  font-size: var(--ew-text-xs);
  color: var(--ew-color-text-muted);
}

.atomo-widget-leyenda__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.atomo-widget-leyenda__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Stepper controls ─────────────────────────────────────── */
.atomo-widget-steppers {
  display: flex;
  flex-direction: column;
  gap: var(--ew-space-2);
  width: 100%;
}

.atomo-stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--ew-color-surface-soft, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--ew-color-border);
  border-radius: var(--ew-radius-md);
  transition: border-color 0.2s ease;
}

.atomo-stepper-row:focus-within {
  border-color: var(--ew-color-primary);
}

.atomo-stepper__header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--ew-text-sm);
  font-weight: 600;
  color: var(--ew-color-text);
}

.atomo-stepper__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.atomo-stepper__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.atomo-stepper__value {
  font-family: var(--ew-font-heading, monospace);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ew-color-text);
  min-width: 2.2rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.atomo-stepper__btn {
  width: 32px;
  height: 32px;
  border-radius: var(--ew-radius-full, 50%);
  border: 1px solid var(--ew-color-border);
  background: var(--ew-color-surface);
  color: var(--ew-color-text);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 0.1s, border-color 0.15s, background-color 0.15s;
}

.atomo-stepper__btn:hover:not(:disabled) {
  border-color: var(--ew-color-primary);
  background: var(--ew-color-primary-soft, rgba(167, 139, 250, 0.15));
  color: var(--ew-color-primary);
}

.atomo-stepper__btn:active:not(:disabled) {
  transform: scale(0.92);
}

.atomo-stepper__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.atomo-stepper__btn--mas {
  color: #22c55e;
}
.atomo-stepper__btn--menos {
  color: #ef4444;
}

/* ── Resumen en modo compacto ─────────────────────────────── */
.atomo-widget-summary {
  margin-top: var(--ew-space-2);
  padding: 12px 14px;
  background: var(--ew-color-surface);
  border: 1px solid var(--ew-color-border);
  border-radius: var(--ew-radius-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.atomo-summary__header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.atomo-summary__symbol {
  width: 38px;
  height: 38px;
  border-radius: var(--ew-radius-sm);
  background: var(--ew-color-surface-soft);
  border: 1.5px solid var(--ew-color-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ew-font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ew-color-text);
  flex-shrink: 0;
}

.atomo-summary__symbol.has-element {
  border-color: var(--ew-color-primary, #a855f7);
  background: color-mix(in srgb, var(--ew-color-primary, #a855f7) 12%, transparent);
  color: var(--ew-color-primary, #a855f7);
}

.atomo-summary__details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.atomo-summary__name {
  font-size: var(--ew-text-sm);
  font-weight: 700;
  color: var(--ew-color-text);
}

.atomo-summary__numbers {
  font-size: var(--ew-text-xs);
  color: var(--ew-color-text-muted);
}

.atomo-summary__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Badges ───────────────────────────────────────────────── */
.atomo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--ew-radius-full, 12px);
  font-size: var(--ew-text-xs);
  font-weight: 600;
  line-height: 1.2;
}

.atomo-badge--neutro {
  background: color-mix(in srgb, var(--ew-color-success, #22c55e) 15%, transparent);
  color: var(--ew-color-success, #16a34a);
  border: 1px solid color-mix(in srgb, var(--ew-color-success, #22c55e) 30%, transparent);
}

.atomo-badge--cation {
  background: color-mix(in srgb, #f59e0b 15%, transparent);
  color: #d97706;
  border: 1px solid color-mix(in srgb, #f59e0b 30%, transparent);
}

.atomo-badge--anion {
  background: color-mix(in srgb, #3b82f6 15%, transparent);
  color: #2563eb;
  border: 1px solid color-mix(in srgb, #3b82f6 30%, transparent);
}

.atomo-badge--estable {
  background: color-mix(in srgb, var(--ew-color-success, #22c55e) 12%, transparent);
  color: var(--ew-color-success, #16a34a);
  border: 1px solid color-mix(in srgb, var(--ew-color-success, #22c55e) 25%, transparent);
}

.atomo-badge--inestable {
  background: color-mix(in srgb, var(--ew-color-danger, #ef4444) 12%, transparent);
  color: var(--ew-color-danger, #dc2626);
  border: 1px solid color-mix(in srgb, var(--ew-color-danger, #ef4444) 25%, transparent);
}

.atomo-widget-actions {
  width: 100%;
  margin-top: var(--ew-space-2);
}

.atomo-widget-reset {
  width: 100%;
  min-height: 36px;
  font-size: var(--ew-text-sm);
}

/* ── Paneles de información en modo completo ─────────────── */
.atomo-avanzado-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--ew-space-3);
  margin-top: var(--ew-space-3);
  width: 100%;
}

.atomo-panel-seccion {
  background: var(--ew-color-surface-soft, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--ew-color-border);
  border-radius: var(--ew-radius-md);
  padding: var(--ew-space-3);
  display: flex;
  flex-direction: column;
  gap: var(--ew-space-2);
}

.atomo-panel-seccion__titulo {
  margin: 0;
  font-size: var(--ew-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--ew-color-text-muted);
}

.atomo-panel-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.atomo-casilla {
  width: 58px;
  height: 58px;
  border-radius: var(--ew-radius-sm);
  border: 2px solid var(--ew-color-primary, #a855f7);
  background: color-mix(in srgb, var(--ew-color-primary, #a855f7) 10%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex-shrink: 0;
  box-shadow: 0 0 8px color-mix(in srgb, var(--ew-color-primary, #a855f7) 18%, transparent);
}

.atomo-casilla__z {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--ew-color-text-muted);
  align-self: flex-start;
  padding-left: 4px;
}

.atomo-casilla__sim {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--ew-color-primary, #a855f7);
  line-height: 1;
}

.atomo-casilla__nom {
  font-size: 0.55rem;
  color: var(--ew-color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50px;
}

.atomo-casilla__masa {
  font-size: 0.52rem;
  color: var(--ew-color-text-muted);
}

.atomo-card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.atomo-card-info__title {
  margin: 0;
  font-size: var(--ew-text-sm);
  font-weight: 700;
  color: var(--ew-color-text);
}

.atomo-card-info__cat {
  margin: 0;
  font-size: var(--ew-text-xs);
  color: var(--ew-color-text-muted);
  text-transform: capitalize;
}

.atomo-card-info__config {
  margin: 0;
  font-size: var(--ew-text-xs);
  color: var(--ew-color-text-muted);
}

.atomo-card-info__desc {
  margin: 0;
  font-size: var(--ew-text-xs);
  color: var(--ew-color-text-muted);
  line-height: 1.4;
}

.atomo-ion-simbolo,
.atomo-iso-simbolo {
  font-family: var(--ew-font-heading);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--ew-color-text);
  min-width: 48px;
  text-align: center;
}

.atomo-panel-vacio {
  margin: 0;
  font-size: var(--ew-text-xs);
  color: var(--ew-color-text-muted);
  font-style: italic;
}

