/* Simuladores interactivos */

.sim-word {
  background: #1a1a2e;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #334155;
  margin: 12px 0;
}

/* Tarea */
.sim-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: #8b5cf622;
  border-bottom: 1px solid #8b5cf644;
  font-weight: 700;
  font-size: 0.95rem;
  color: #c4b5fd;
}
.sim-task-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #8b5cf6;
  flex-shrink: 0;
  animation: simPulse 1.5s ease-in-out infinite;
}
@keyframes simPulse {
  0%, 100% { box-shadow: 0 0 0 0 #8b5cf644; }
  50% { box-shadow: 0 0 0 8px #8b5cf600; }
}

/* Barra de titulo */
.sim-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  font-size: 0.78rem;
  color: #64748b;
}
.sim-titlebar-dots {
  display: flex;
  gap: 5px;
}
.sim-titlebar-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.sim-titlebar-dots i:nth-child(1) { background: #ef4444; }
.sim-titlebar-dots i:nth-child(2) { background: #f59e0b; }
.sim-titlebar-dots i:nth-child(3) { background: #22c55e; }
.sim-titlebar-text { flex: 1; text-align: center; }

/* Quick access bar */
.sim-quickbar {
  display: flex;
  gap: 2px;
  padding: 4px 10px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
}
.sim-quick-btn {
  font-size: 0.75rem;
  padding: 3px 6px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 4px;
}
.sim-quick-btn:hover { background: #1e293b; }

/* Pestanas */
.sim-tabs {
  display: flex;
  gap: 0;
  padding: 0 8px;
  background: #0f172a;
  border-bottom: 2px solid #334155;
  overflow-x: auto;
}
.sim-tab, .sim-tab-archivo {
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}
.sim-tab:hover { color: #e2e8f0; }
.sim-tab--active { color: #ffffff; border-bottom-color: #3b82f6; }
.sim-tab-archivo { color: #60a5fa; }

/* Ribbon */
.sim-ribbon {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  background: #111827;
  border-bottom: 1px solid #1e293b;
  overflow-x: auto;
  align-items: flex-end;
}
.sim-grupo {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-right: 10px;
  border-right: 1px solid #1e293b;
  margin-right: 6px;
  align-items: center;
  position: relative;
  padding-bottom: 18px;
}
.sim-grupo-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.6rem;
  color: #475569;
  white-space: nowrap;
}

.sim-ribbon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: none;
  color: #e2e8f0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  min-width: 36px;
}
.sim-ribbon-btn:hover { background: #1e293b; border-color: #334155; }
.sim-ribbon-btn--grande {
  padding: 8px 12px;
  font-size: 0.72rem;
}
.sim-ribbon-btn--grande .sim-btn-icono { font-size: 1.3rem; }

.sim-btn-formato {
  font-size: 1rem;
  min-width: 32px;
  min-height: 32px;
  display: grid;
  place-items: center;
  padding: 4px;
}
.sim-btn-icono { font-size: 1rem; line-height: 1; }
.sim-btn-label { font-size: 0.65rem; color: #94a3b8; line-height: 1; }

.sim-select {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.78rem;
  cursor: pointer;
  min-width: 80px;
}
.sim-select--num { min-width: 36px; text-align: center; }

/* Target highlight */
.sim-ribbon-btn--target, .sim-select.sim-ribbon-btn--target {
  animation: simTarget 1s ease-in-out infinite;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px #f59e0b44;
}
@keyframes simTarget {
  0%, 100% { box-shadow: 0 0 0 3px #f59e0b44; }
  50% { box-shadow: 0 0 0 6px #f59e0b22; }
}

.sim-ribbon-btn--wrong {
  background: #ef444433 !important;
  border-color: #ef4444 !important;
  animation: simShake 0.4s ease-out;
}
@keyframes simShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Documento simulado */
.sim-doc {
  padding: 24px 32px;
  background: #0f172a;
  min-height: 120px;
  position: relative;
}
.sim-doc--editable { cursor: text; }
.sim-doc-cursor {
  position: absolute;
  top: 24px;
  left: 32px;
  color: #60a5fa;
  animation: simBlink 1s step-end infinite;
  font-size: 1.1rem;
}
@keyframes simBlink { 50% { opacity: 0; } }
.sim-doc-text { color: #64748b; font-size: 0.95rem; margin: 0; }
.sim-doc-para { color: #cbd5e1; font-size: 0.95rem; margin: 0 0 10px; line-height: 1.6; }
.sim-doc-selectable { cursor: pointer; padding: 2px 4px; border-radius: 4px; border: 1px dashed #64748b; }
.sim-doc-selectable:hover { border-color: #8b5cf6; background: #8b5cf611; }
.sim-doc-selected { background: #3b82f633; border-color: #3b82f6; border-style: solid; }

/* Mini ribbon para formato */
.sim-mini-ribbon {
  display: flex;
  gap: 4px;
  padding: 8px 14px;
  background: #111827;
  border-bottom: 1px solid #1e293b;
  align-items: center;
}
.sim-mini-btn {
  min-width: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid #334155;
  background: none;
  color: #e2e8f0;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
}
.sim-mini-btn:hover { background: #1e293b; border-color: #60a5fa; }
.sim-mini-btn--active { background: #3b82f633; border-color: #3b82f6; }
.sim-mini-sep { width: 1px; height: 24px; background: #334155; margin: 0 6px; }

/* Teclado */
.sim-keyboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}
.sim-key {
  display: grid;
  place-items: center;
  min-width: 48px;
  min-height: 48px;
  border-radius: 10px;
  border: 2px solid #334155;
  border-bottom: 4px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  font-weight: 800;
  font-size: 1.1rem;
  font-family: inherit;
}
.sim-key--wide { min-width: 72px; font-size: 0.85rem; }
.sim-key-plus { color: #64748b; font-size: 1.2rem; font-weight: 700; }
.sim-key--pressed {
  background: #22c55e;
  border-color: #16a34a;
  color: #0f172a;
  border-bottom-width: 2px;
  margin-top: 2px;
}

/* Feedback */
.sim-feedback-ok {
  padding: 14px 18px;
  background: #14532d;
  border-top: 2px solid #22c55e;
  color: #4ade80;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
}
.sim-hint {
  padding: 10px 18px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.88rem;
  text-align: center;
}
.sim-hint--warn { color: #fbbf24; background: #451a0366; }

/* Guia visual paso a paso */
.sim-guia {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: 16px;
  overflow: hidden;
  margin: 12px 0;
}
.sim-guia-counter {
  padding: 10px 18px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--texto-3);
  border-bottom: 1px solid var(--borde);
}
.sim-guia-contenido { padding: 20px; }
.sim-guia-img-wrap {
  position: relative;
  margin-bottom: 16px;
  border-radius: 10px;
  overflow: hidden;
  background: #0f172a;
}
.sim-guia-img {
  font-size: 0.85rem;
  color: #94a3b8;
  padding: 20px;
}
.sim-guia-indicator {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-weight: 900;
  font-size: 0.82rem;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px #ef444444;
  animation: simPulse2 1.5s ease-in-out infinite;
}
@keyframes simPulse2 {
  0%, 100% { box-shadow: 0 0 0 3px #ef444444; }
  50% { box-shadow: 0 0 0 8px #ef444422; }
}
.sim-guia-instruccion { font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; }
.sim-guia-detalle { color: var(--texto-2); font-size: 0.9rem; }
.sim-guia-nav {
  display: flex;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--borde);
}

/* Responsive */
@media (max-width: 600px) {
  .sim-ribbon { flex-wrap: nowrap; overflow-x: scroll; }
  .sim-tabs { overflow-x: scroll; }
  .sim-doc { padding: 16px; }
}
