/* ============================================================
   LABS EXTRA · Estilos compartidos para los laboratorios de
   Ciberseguridad, Linux y Redes/Fibra Óptica
   Academia de Robótica de La Manguita
   ============================================================ */

/* ---------- Genéricos ---------- */
.acciones-demo {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.btn-demo {
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: none;
  background-color: var(--azul);
  color: var(--blanco);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn-demo:hover:not(:disabled) {
  background-color: var(--azul-claro);
  transform: translateY(-2px);
}

.btn-demo:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-demo.secundario {
  background-color: #e2e8f0;
  color: var(--gris-oscuro);
}

.btn-demo.secundario:hover:not(:disabled) {
  background-color: #cbd5e1;
}

.modo-frutas {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chip {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  background-color: var(--blanco);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gris-oscuro);
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--azul-claro);
  background-color: #eff6ff;
  transform: translateY(-1px);
}

.conclusion-sesion {
  margin-top: 0.8rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.6;
}

.conclusion-sesion.buena {
  background-color: #ecfdf5;
  border: 2px solid var(--verde);
}

.conclusion-sesion.mala {
  background-color: #fef2f2;
  border: 2px solid #ef4444;
}

.fila-slider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.fila-slider label {
  flex: 1;
  font-size: 0.82rem;
  color: var(--gris-oscuro);
  font-weight: 600;
}

.fila-slider input[type="range"] {
  flex: 1.4;
}

.valor-slider {
  min-width: 3rem;
  text-align: center;
  font-weight: 700;
  color: var(--azul);
  font-size: 0.85rem;
}

.resultado-caja {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  background-color: #f1f5f9;
  border-radius: 12px;
  border: 2px dashed #cbd5e1;
  font-size: 0.88rem;
  line-height: 1.55;
}

.rejilla-demo {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.7rem;
}

.btn-opcion {
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  border: 2px solid #cbd5e1;
  background-color: var(--blanco);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.btn-opcion:hover:not(:disabled) {
  border-color: var(--azul-claro);
  transform: translateY(-2px);
}

.btn-opcion:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-opcion.correcta { border-color: var(--verde); background-color: #ecfdf5; }
.btn-opcion.incorrecta { border-color: #ef4444; background-color: #fef2f2; }
.btn-opcion.elegida { border-color: var(--azul); background-color: #eff6ff; }

.contador-demo {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gris);
  margin-top: 0.6rem;
}

/* ---------- Terminal (Linux) ---------- */
.terminal-lab {
  background-color: #0f172a;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4);
}

.term-barra {
  background-color: #1e293b;
  padding: 0.5rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.term-punto {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.term-titulo {
  margin-left: auto;
  color: #94a3b8;
  font-size: 0.72rem;
  font-family: monospace;
}

.term-salida {
  padding: 0.9rem;
  height: 260px;
  overflow-y: auto;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #4ade80;
  white-space: pre-wrap;
  word-break: break-word;
}

.term-salida .term-error { color: #f87171; }
.term-salida .term-info { color: #60a5fa; }
.term-salida .term-amarillo { color: #facc15; }

.term-linea {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.9rem 0.9rem;
  font-family: "Consolas", "Courier New", monospace;
}

.term-prompt {
  color: #22d3ee;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.term-input {
  flex: 1;
  background-color: transparent;
  border: none;
  outline: none;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.82rem;
}

.ayuda-comandos {
  margin-top: 0.7rem;
  font-size: 0.75rem;
  color: var(--gris);
  line-height: 1.7;
}

.ayuda-comandos code {
  background-color: #e2e8f0;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--azul);
  font-weight: 700;
}

/* ---------- Árbol de archivos ---------- */
.arbol-ls {
  background-color: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.9rem;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.84rem;
  max-height: 300px;
  overflow-y: auto;
}

.arbol-nodo {
  list-style: none;
  padding-left: 1.2rem;
}

.arbol-fila {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
}

.arbol-fila:hover { background-color: #e0f2fe; }

.arbol-carpeta { color: var(--azul); font-weight: 700; }
.arbol-archivo { color: var(--gris-oscuro); }
.arbol-oculto { color: #a855f7; font-style: italic; }
.oculto-arbol { display: none; }
.mostrar-ocultos .oculto-arbol { display: flex; }

.migaja {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.78rem;
  background-color: #1e293b;
  color: #4ade80;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  margin-bottom: 0.7rem;
  word-break: break-all;
}

/* ---------- Permisos chmod ---------- */
.tabla-permisos {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.tabla-permisos th,
.tabla-permisos td {
  padding: 0.5rem 0.4rem;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
}

.tabla-permisos th:first-child,
.tabla-permisos td:first-child {
  text-align: left;
  font-weight: 700;
  color: var(--azul);
}

.permiso-check {
  width: 18px;
  height: 18px;
  accent-color: var(--azul);
  cursor: pointer;
}

.cadena-permisos {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.15rem;
  background-color: #0f172a;
  color: #4ade80;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  text-align: center;
  margin-top: 0.8rem;
}

.octal-permisos {
  text-align: center;
  font-size: 0.85rem;
  color: var(--gris);
  margin-top: 0.4rem;
}

.octal-permisos strong { color: var(--azul); font-size: 1.05rem; }

/* ---------- Juego de parejas ---------- */
.parejas-contenedor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.pareja-btn {
  padding: 0.6rem 0.5rem;
  border-radius: 10px;
  border: 2px solid #cbd5e1;
  background-color: var(--blanco);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.15s ease;
  text-align: center;
}

.pareja-btn:hover:not(:disabled) { border-color: var(--azul-claro); }

.pareja-btn.sel { border-color: var(--amarillo); background-color: #fefce8; }
.pareja-btn.ok { border-color: var(--verde); background-color: #ecfdf5; opacity: 0.75; cursor: default; }
.pareja-btn.mal { border-color: #ef4444; animation: sacudir 0.35s ease; }

@keyframes sacudir {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ---------- Tarjetas que voltean ---------- */
.volteables {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.7rem;
}

.tarjeta-flip {
  perspective: 800px;
  height: 110px;
  cursor: pointer;
}

.flip-interno {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s;
  transform-style: preserve-3d;
}

.tarjeta-flip.volteada .flip-interno { transform: rotateY(180deg); }

.flip-cara {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.4;
}

.flip-frontal {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: var(--blanco);
  font-size: 1.9rem;
}

.flip-trasera {
  background-color: #ecfdf5;
  border: 2px solid var(--verde);
  transform: rotateY(180deg);
  color: var(--gris-oscuro);
  font-weight: 600;
}

/* ---------- Wizard distros ---------- */
.paso-wizard {
  margin-bottom: 0.8rem;
}

.paso-wizard p {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--azul);
  margin-bottom: 0.5rem;
}

.tarjeta-distro {
  background: linear-gradient(135deg, #777bb3, #4f46e5);
  color: var(--blanco);
  border-radius: 16px;
  padding: 1.2rem;
  text-align: center;
  margin-top: 0.9rem;
}

.tarjeta-distro .logo-distro { font-size: 2.4rem; }
.tarjeta-distro h4 { font-size: 1.15rem; margin: 0.3rem 0; }

/* ---------- Ciberseguridad: clasificador de info ---------- */
.tarjeta-info {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.7rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  background-color: var(--blanco);
}

.tarjeta-info .emoji-info { font-size: 1.5rem; display: block; margin-bottom: 0.3rem; }

.tarjeta-info .botones-info {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.tarjeta-info button {
  border: none;
  border-radius: 8px;
  padding: 0.32rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-privado { background-color: #ede9fe; color: #6d28d9; }
.btn-publico { background-color: #dcfce7; color: #15803d; }

.tarjeta-info.bien { border-color: var(--verde); background-color: #ecfdf5; }
.tarjeta-info.mal { border-color: #ef4444; background-color: #fef2f2; }

/* ---------- Medidor de contraseñas ---------- */
.medidor-envoltura {
  height: 16px;
  background-color: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin: 0.7rem 0 0.4rem;
}

.medidor-barra {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.35s ease, background-color 0.35s ease;
}

.lista-requisitos {
  list-style: none;
  font-size: 0.76rem;
  color: var(--gris);
  columns: 2;
  gap: 1rem;
  margin-top: 0.6rem;
}

.lista-requisitos li::before { content: "◻ "; }
.lista-requisitos li.cumplido { color: var(--verde); font-weight: 700; }
.lista-requisitos li.cumplido::before { content: "✅ "; }

.tiempo-crack {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--azul);
  margin-top: 0.5rem;
}

/* ---------- Mensajes de phishing ---------- */
.mensaje-phish {
  background-color: var(--blanco);
  border: 2px solid #e2e8f0;
  border-left: 6px solid var(--azul-claro);
  border-radius: 12px;
  padding: 1rem;
  font-size: 0.85rem;
  line-height: 1.6;
}

.mensaje-phish .cabecera-msg {
  font-size: 0.74rem;
  color: var(--gris);
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 0.45rem;
  margin-bottom: 0.6rem;
}

.banderas-phish {
  margin-top: 0.8rem;
  font-size: 0.8rem;
  background-color: #fff7ed;
  border: 2px dashed #fb923c;
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  line-height: 1.65;
}

/* ---------- Simulador de brote (malware) ---------- */
.rejilla-pcs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.45rem;
  max-width: 340px;
  margin: 0 auto;
}

.pc-celda {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 2px solid #cbd5e1;
  background-color: var(--blanco);
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.pc-celda.protegida { border-color: var(--verde); background-color: #ecfdf5; }
.pc-celda.infectada { border-color: #ef4444; background-color: #fee2e2; animation: pulso-rojo 0.9s infinite; }

@keyframes pulso-rojo {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.stats-brote {
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 0.7rem;
}

/* ---------- Huella digital ---------- */
.timeline-huella {
  margin-top: 0.8rem;
  max-height: 190px;
  overflow-y: auto;
  padding-right: 0.3rem;
}

.huella-item {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.5rem 0.7rem;
  border-left: 4px solid #a855f7;
  background-color: #faf5ff;
  border-radius: 0 10px 10px 0;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  line-height: 1.5;
}

.huella-item .cuando {
  font-weight: 700;
  color: #7c3aed;
  white-space: nowrap;
}

/* ---------- Cifrador César ---------- */
.caja-cesar textarea {
  width: 100%;
  min-height: 64px;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.6rem;
  font-family: "Consolas", monospace;
  font-size: 0.88rem;
  resize: vertical;
}

.salida-cesar {
  font-family: "Consolas", monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.12rem;
  background-color: #0f172a;
  color: #facc15;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  min-height: 3.2rem;
  word-break: break-all;
  margin-top: 0.8rem;
}

.modo-cesar {
  display: flex;
  gap: 0.5rem;
  margin: 0.7rem 0;
}

/* ---------- Redes: constructor SVG ---------- */
.svg-red {
  width: 100%;
  max-width: 380px;
  display: block;
  margin: 0 auto;
  background-color: #f8fafc;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
}

.nodo-red { cursor: pointer; }

.consola-ping {
  background-color: #0f172a;
  color: #4ade80;
  font-family: "Consolas", monospace;
  font-size: 0.78rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  min-height: 120px;
  max-height: 180px;
  overflow-y: auto;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ---------- Carrera de medios ---------- */
.pistas-carrera { margin-top: 0.6rem; }

.pista-carrera {
  margin-bottom: 0.9rem;
}

.pista-carrera .rotulo-pista {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.barra-pista {
  height: 18px;
  background-color: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.corredor {
  height: 100%;
  width: 0;
  border-radius: 999px;
}

/* ---------- Fibra óptica SVG ---------- */
.fibra-wrap svg {
  width: 100%;
  display: block;
}

.rayo-luz {
  stroke-dasharray: 6 5;
  animation: flujo-luz 1s linear infinite;
}

@keyframes flujo-luz {
  to { stroke-dashoffset: -11; }
}

.estado-angulo {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 0.4rem;
}

/* ---------- Stepper viaje del mensaje ---------- */
.stepper-red {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 1rem 0 0.6rem;
}

.paso-stepper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: 16%;
  text-align: center;
}

.paso-stepper .bola {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: #e2e8f0;
  border: 3px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.paso-stepper .etq {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--gris);
  line-height: 1.25;
}

.paso-stepper.hecho .bola {
  background-color: #dcfce7;
  border-color: var(--verde);
}

.paso-stepper.actual .bola {
  background-color: #fef9c3;
  border-color: var(--amarillo);
  transform: scale(1.15);
}

.latencia-counter {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--azul);
}

.info-salto {
  margin-top: 0.7rem;
}

/* ---------- Certificado ---------- */
.certificado-caja {
  border: 6px double var(--azul);
  border-radius: 18px;
  padding: 1.6rem 1.2rem;
  text-align: center;
  background:
    radial-gradient(circle at top left, rgba(250, 204, 21, 0.15), transparent 55%),
    radial-gradient(circle at bottom right, rgba(125, 211, 252, 0.2), transparent 55%),
    var(--blanco);
}

.certificado-caja .medalla-cert { font-size: 3rem; }

.certificado-caja h3 {
  font-size: 1.3rem;
  color: var(--azul);
  margin: 0.4rem 0;
}

.nombre-cert {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gris-oscuro);
  border-bottom: 3px solid var(--amarillo);
  display: inline-block;
  padding: 0 1.2rem 0.2rem;
  margin: 0.6rem 0;
}

.sello-cert {
  display: inline-block;
  margin-top: 0.7rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background-color: #eff6ff;
  border: 2px solid var(--azul-claro);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--azul);
}
