/* Estilos customizados para o simulador */
body {
  font-family: "Inter", sans-serif;
}

/* Animações dos elementos */
.task {
  transition: all 0.5s ease-in-out;
  border: 2px solid transparent;
}

.processing-out {
  opacity: 0;
  transform: scale(0.9);
}

.highlight-op {
  animation: highlight-op 1.5s ease;
  border-color: #6366f1;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

@keyframes highlight-op {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
    background-color: #e0e7ff;
  }
  100% {
    transform: scale(1);
  }
}

/* Scrollbar customizado para o log */
#log-container::-webkit-scrollbar {
  width: 8px;
}

#log-container::-webkit-scrollbar-track {
  background: #f1f5f9;
}

#log-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

#log-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Estilo para blocos de código com botão copiar */
pre {
  position: relative;
}

.copy-btn {
  position: absolute;
  right: 8px;
  top: 8px;
  background: #0f172a; /* slate-900 */
  color: #fff;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0.9;
}

.copy-btn:hover {
  opacity: 1;
}

.copy-btn.copied {
  background: #059669; /* emerald-600 */
}

/* Pequena responsividade para o botão copiar */
@media (max-width: 640px) {
  .copy-btn {
    right: 6px;
    top: 6px;
    padding: 3px 6px;
    font-size: 0.7rem;
  }
}

/* Responsividade adicional */
@media (max-width: 768px) {
  .task {
    padding: 0.5rem;
  }

  .task span {
    font-size: 0.9rem;
  }
}

/* Estilo dos nós / caixas usados na visualização */
.node-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 6rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(15, 23, 42, 0.06); /* slate-900/6 */
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  transition: transform 300ms ease, box-shadow 300ms ease, background 300ms ease;
}

.node-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.08);
}

/* Seta entre nós */
.arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b; /* slate-500 */
  padding: 0 0.25rem;
  user-select: none;
}

/* Rótulo de topo para pilha */
.top-label {
  background: #ecfdf5; /* emerald-50 */
  color: #065f46; /* emerald-800 */
  padding: 0.125rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.8rem;
}

/* Animações simples para empilhar/desempilhar */
@keyframes pushIn {
  0% {
    transform: translateY(-20px) scale(0.98);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes popOut {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-20px) scale(0.9);
    opacity: 0;
  }
}

.push-anim {
  animation: pushIn 400ms ease forwards;
}

.pop-anim {
  animation: popOut 400ms ease forwards;
}

/* Ajustes para container horizontal com overflow */
#task-container.flex,
.task-container.flex {
  display: flex;
  align-items: center;
}
