:root {
  --primary-color: #25d366;
  --primary-dark: #128c7e;
  --secondary-color: #34b7f1;
  --accent-color: #075e54;
  --text-color: #333;
  --light-text: #777;
  --light-bg: #f5f5f5;
  --border-color: #ddd;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --node-trigger-color: #e9f7ef;
  --node-response-color: #eaf2f8;
  --node-fallback-color: #fcf3cf;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  background-color: var(--light-bg);
  line-height: 1.6;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background-color: var(--accent-color);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px var(--shadow-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo i {
  font-size: 2rem;
  color: var(--primary-color);
}

.actions {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  transition: all 0.2s;
}

.btn:hover {
  filter: brightness(1.1);
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--light-text);
  transition: color 0.2s;
}

.btn-icon:hover {
  color: var(--accent-color);
}

.primary {
  background-color: var(--primary-color);
  color: white;
}

.secondary {
  background-color: white;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
}

.success {
  background-color: #2ecc71;
  color: white;
}

.info {
  background-color: var(--secondary-color);
  color: white;
}

main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 250px;
  background-color: white;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 1rem;
}

.components {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.component-group h3 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--light-text);
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border-color);
}

.component {
  padding: 0.75rem;
  background-color: var(--light-bg);
  border-radius: 4px;
  cursor: move;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.component:hover {
  background-color: var(--border-color);
}

.component i {
  color: var(--accent-color);
}

.workspace {
  flex: 1;
  background-color: var(--light-bg);
  overflow: auto;
  position: relative;
}
.flow-canvas {
  width: 8000px;
  height: 8000px;
  position: relative;
  background-color: #f9f9f9;
  background-image: radial-gradient(circle, #e0e0e0 1px, transparent 1px);
  background-size: 20px 20px;
  transform-origin: 0 0;
}

.workspace {
  overflow: auto;
  position: relative;
}
/* Adicione esta classe para o contêiner do canvas */
.workspace {
  overflow: hidden !important; /* Modificar de auto para hidden */
  position: relative;
}
.flow-start {
  background-color: white;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px var(--shadow-color);
  position: absolute;
  top: 50px;
  left: 50px;
}

.flow-start i {
  font-size: 2rem;
  color: var(--primary-color);
}

.flow-start span {
  font-size: 0.8rem;
  color: var(--light-text);
  text-align: center;
  margin-top: 4px;
}

.properties-panel {
  width: 300px;
  background-color: white;
  border-left: 1px solid var(--border-color);
  padding: 1rem;
  overflow-y: auto;
}

.properties-panel h2 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.no-selection {
  color: var(--light-text);
  font-style: italic;
}

/* Nodes */
.flow-node {
  position: absolute;
  min-width: 200px;
  max-width: 300px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 2px 8px var(--shadow-color);
  z-index: 10;
  cursor: grab;
}

.flow-node.trigger {
  background-color: var(--node-trigger-color);
  border-left: 4px solid #27ae60;
}

.flow-node.response {
  background-color: var(--node-response-color);
  border-left: 4px solid #3498db;
}

.flow-node.fallback {
  background-color: var(--node-fallback-color);
  border-left: 4px solid #f1c40f;
}

.node-header {
  padding: 0.75rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  gap: 8px;
}

.node-header i {
  font-size: 1rem;
}

.node-header span {
  flex: 1;
  font-weight: 500;
}

.node-actions {
  display: flex;
  gap: 6px;
}

.node-content {
  padding: 0.75rem;
}

.node-property {
  margin-bottom: 0.75rem;
}

.node-property label {
  display: block;
  font-size: 0.8rem;
  color: var(--light-text);
  margin-bottom: 3px;
}

.property-value {
  font-size: 0.9rem;
  color: var(--text-color);
  word-break: break-word;
}

.buttons-list, .options-list {
  font-size: 0.9rem;
}

.buttons-list div, .options-list div {
  margin-bottom: 5px;
  background-color: rgba(0, 0, 0, 0.05);
  padding: 3px 6px;
  border-radius: 3px;
}

.node-connector {
  position: relative;
  height: 20px;
}

.connector-out, .connector-in {
  position: absolute;
  width: 12px;
  height: 12px;
  background-color: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
}

.connector-out {
  bottom: 4px;
  right: -6px;
}

.connector-in {
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
}

/* Conexões jsPlumb */
.jtk-connector {
  z-index: 9;
}

.jtk-endpoint {
  z-index: 10;
}

.jtk-overlay {
  color: rgb(7 94 84) !important;
  background-color: var(--accent-color);
  padding: 2px 5px;
  border-radius: 3px;
  z-index: 11;
}

/* Seleção de nó */
.flow-node.selected {
  box-shadow: 0 0 0 2px var(--primary-color);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 3% auto;
  padding: 0;
  border-radius: 8px;
  width: 600px;
  max-width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
  padding-bottom: 70px; /* Espaço adicional para compensar os controles */
}
/* Botões mais visíveis */
.modal-footer .btn {
  padding: 0.6rem 1.2rem;
  font-weight: 500;
  font-size: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.modal-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: relative;
  z-index: 2000; /* Garantir que fique acima de outros elementos */
  background: white; /* Adicionar fundo para cobrir outros elementos */
  border-radius: 0 0 8px 8px; /* Arredondar cantos inferiores */
}

.close {
  color: var(--light-text);
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: var(--text-color);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.button-rows {
  margin-top: 0.5rem;
}

.button-row {
  display: flex;
  gap: 10px;
  margin-bottom: 0.5rem;
  align-items: center;
}

.button-row input {
  flex: 1;
}

.button-row button {
  background: none;
  border: none;
  color: var(--light-text);
  cursor: pointer;
  font-size: 1rem;
}

.button-row button:hover {
  color: #e74c3c;
}

.add-button {
  margin-top: 0.5rem;
  padding: 0.25rem 0.5rem;
  background-color: var(--light-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.add-button:hover {
  background-color: var(--border-color);
}

/* Lista de fluxos */
.flows-list {
  max-height: 400px;
  overflow-y: auto;
}

.flow-item {
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.2s;
}

.flow-item:hover {
  background-color: var(--light-bg);
}

.flow-item:last-child {
  border-bottom: none;
}

/* Conexões jsPlumb */
.jtk-endpoint {
  z-index: 10;
}

/* Animações */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.flow-node {
  animation: fade-in 0.3s ease-out;
}

/* Adicionando estilos para as novas funcionalidades */

/* Melhoria nos conectores */
.connector-out, .connector-in {
  position: absolute;
  width: 14px;
  height: 14px;
  background-color: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}

.connector-out:hover, .connector-in:hover {
  transform: scale(1.3);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  background-color: var(--primary-color);
}

.connector-out::after {
  content: "\f061"; /* Ícone de seta */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 8px;
  color: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.connector-in::after {
  content: "\f063"; /* Ícone de seta para baixo */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 8px;
  color: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.connector-out {
  bottom: 4px;
  right: -7px;
}

.connector-in {
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
}

.connector-in:hover {
  transform: translateX(-50%) scale(1.3);
}

/* Destaque para conexões */
.connection-highlight {
  box-shadow: 0 0 0 3px var(--primary-color), 0 0 15px rgba(37, 211, 102, 0.6);
  animation: pulse 1.5s infinite;
  z-index: 20;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6), 0 0 0 3px var(--primary-color); }
  70% { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0), 0 0 0 3px var(--primary-color); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0), 0 0 0 3px var(--primary-color); }
}

/* Painel de propriedades melhorado */
.connection-actions {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.connections-list {
  margin-top: 0.5rem;
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.5rem;
}

.connections-list h5 {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--light-text);
}

.connections-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.connections-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px;
  border-bottom: 1px solid var(--border-color);
}

.connections-list li:last-child {
  border-bottom: none;
}

.delete-connection {
  color: #e74c3c;
}

.delete-connection:hover {
  color: #c0392b;
}

.danger {
  background-color: #e74c3c;
  color: white;
}

.danger:hover {
  background-color: #c0392b;
}

/* Caixa de dicas */
.tip-box {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.tip-content {
  background-color: white;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 500px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.tip-content h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tip-content ul {
  margin-bottom: 1.5rem;
}

.tip-content li {
  margin-bottom: 0.5rem;
}

.close-tip {
  width: 100%;
}

/* Melhorias visuais para nós */
.flow-node {
  position: absolute !important;
  /* Evitar animações durante arrastar que possam atrasar o posicionamento */
  transition: none !important;
  transition: all 0.2s ease;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}
/* Durante o arrasto */
.jtk-drag {
  /* Usar aceleração de hardware para melhor desempenho */
  transform: translateZ(0);
  /* Garantir posição absoluta */
  position: absolute !important;
  /* Remover qualquer transição que possa atrasar */
  transition: none !important;
  cursor: grabbing !important;
}
.flow-node:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.flow-node .node-header {
  cursor: move;
}

/* Tooltips para melhoria da usabilidade */
[title] {
  position: relative;
}

[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--accent-color);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
}

/* Feedback visual para ações */
.node-actions button:active {
  transform: scale(0.9);
}

/* Sequências visuais */
.sequence-indicator {
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  top: -10px;
  right: -10px;
  z-index: 15;
}

/* Melhoria visual para conexões automáticas */
.suggested-connection {
  stroke-dasharray: 5, 5;
  animation: dash 1s linear infinite;
}

@keyframes dash {
  to {
    stroke-dashoffset: 10;
  }
}

/* Mini-mapa para navegação em fluxos grandes */
.minimap {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 200px;
  height: 150px;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 2px 5px var(--shadow-color);
  overflow: hidden;
  z-index: 50;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.minimap:hover {
  opacity: 1;
}

.minimap-content {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
}

.minimap-viewport {
  position: absolute;
  border: 2px solid var(--primary-color);
  background-color: rgba(52, 152, 219, 0.1);
  cursor: move;
}

/* Melhorias para o modo mobile */
@media (max-width: 768px) {
  main {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    max-height: 200px;
    overflow-y: auto;
  }
  
  .properties-panel {
    width: 100%;
    height: auto;
    max-height: 300px;
  }
  
  .workspace {
    flex: 1;
    min-height: 300px;
  }
  
  .modal-content {
    margin: 5% auto; /* Reduzir a margem para subir o modal */
  max-height: 85vh; /* Aumentar altura máxima */
  }
}

/* Melhorias para acessibilidade */
.btn:focus, 
.btn-icon:focus, 
.flow-node:focus-within {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Botão para zoom */
.zoom-controls {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  gap: 5px;
  z-index: 20;
}

.zoom-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.zoom-btn:hover {
  background-color: var(--light-bg);
}

/* Navegação por teclado */
.keyboard-nav {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

body.keyboard-active .keyboard-nav {
  opacity: 1;
}
/* Estilos para o seletor de arquivos */
.file-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-input-group input[type="text"] {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
}

.file-selector-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--accent-color);
  color: white;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.file-selector-btn:hover {
  background-color: var(--primary-color);
  transform: scale(1.05);
}

.file-selector-btn i {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.file-preview {
  margin-top: 10px;
  padding: 10px;
  background-color: var(--light-bg);
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--border-color);
}

/* Animação de carregamento */
.file-loading {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
}

.file-loading::after {
  content: "";
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Ícones para tipos de arquivos */
.file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  margin-right: 10px;
  color: white;
  font-size: 1.2rem;
}

.file-icon.image {
  background-color: #3498db;
}

.file-icon.video {
  background-color: #e74c3c;
}

.file-icon.audio {
  background-color: #9b59b6;
}

/* Tamanho do arquivo */
.file-size {
  font-size: 0.85rem;
  color: var(--light-text);
  margin-top: 5px;
}

/* Botão para remover arquivo */
.remove-file {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.remove-file:hover {
  background-color: rgba(231, 76, 60, 0.8);
}

/* Mensagem de incompatibilidade de navegador */
.browser-warning {
  background-color: #fff3cd;
  border: 1px solid #ffeeba;
  color: #856404;
  padding: 10px;
  border-radius: 4px;
  margin-top: 10px;
  font-size: 0.9rem;
}

.browser-warning a {
  color: #856404;
  text-decoration: underline;
}

/* Suporte para arrastar e soltar arquivos */
.file-drop-zone {
  margin: 15px 0;
  border-radius: 8px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  background-color: #f0f9ff;
  transition: all 0.3s ease;
}

.file-drop-zone:hover {
  background-color: #e0f2fe;
  border-color: #38bdf8;
}

.file-drop-zone.drag-over {
  background-color: #bae6fd;
  border-color: #0ea5e9;
  transform: scale(1.02);
}

.file-drop-zone p {
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}

.file-drop-zone .drop-icon {
  font-size: 2rem;
  color: var(--accent-color);
  margin-bottom: 15px;
}

.file-drop-zone .drop-icon i {
  font-size: 2.5rem;
  color: #0ea5e9;
}
/* Múltiplos arquivos */
.multi-file-list {
  margin-top: 10px;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 5px;
  position: relative;
}

.file-item:last-child {
  margin-bottom: 0;
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

/* Tooltip para mostrar o caminho completo */
.file-name:hover::after {
  content: attr(title);
  position: absolute;
  left: 0;
  top: 100%;
  background-color: var(--accent-color);
  color: white;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  z-index: 100;
  max-width: 300px;
  word-break: break-all;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/** ZOOM ***/

#zoom-controls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 15px;
  border-radius: 30px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  z-index: 1000;
  transition: all 0.3s ease;
  z-index: 990; /* Reduzir z-index para ficar abaixo dos modais */
}

#zoom-controls button {
  background: none;
  border: none;
  color: #333;
  font-size: 18px;
  cursor: pointer;
  margin: 0 10px;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

#zoom-controls button:hover {
  color: #007bff;
  background-color: rgba(0, 123, 255, 0.1);
}

#zoom-controls button:active {
  transform: scale(0.95);
}

#zoom-level {
  font-size: 16px;
  color: #666;
  min-width: 50px;
  text-align: center;
}

/* Adicionar ao final do arquivo styles.css */

/* Estilos para o canvas com panning */
.flow-canvas {
  transform-origin: 0 0;
  transition: transform 0.1s ease-out; /* Suaviza o zoom, mas não o panning */
  will-change: transform; /* Optimiza o desempenho de transformações */
}

/* Cursor para indicar quando o canvas pode ser arrastado */
.flow-canvas:not(:has(.flow-node:hover)):not(:has(.flow-start:hover)) {
  cursor: grab;
}

/* Quando o canvas está sendo arrastado */
.flow-canvas.panning {
  cursor: grabbing !important;
}

/* Estilos para o botão de reset da posição do canvas */
#reset-pan-btn {
  background: none;
  border: none;
  color: #333;
  font-size: 18px;
  cursor: pointer;
  margin: 0 10px;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

#reset-pan-btn:hover {
  color: #007bff;
  background-color: rgba(0, 123, 255, 0.1);
}

#reset-pan-btn:active {
  transform: scale(0.95);
}

/* Estilos para a legenda de conexões */
.connection-legend {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 250px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
  z-index: 900;
  overflow: hidden;
  font-size: 0.9rem;
  transition: transform 0.3s ease;
}

.connection-legend.hidden {
  transform: translateX(calc(100% + 20px));
}

.legend-title {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  background-color: var(--accent-color);
  color: white;
  gap: 8px;
}

.legend-title i {
  font-size: 1rem;
}

.legend-title span {
  flex: 1;
  font-weight: 500;
}

.close-legend {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

.legend-content {
  padding: 15px;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
}

.legend-item:last-child {
  margin-bottom: 0;
}

.legend-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--accent-color);
}

.legend-dot.input {
  background-color: #3498db;
}

.legend-dot.output {
  background-color: #25d366;
}

.legend-line {
  width: 30px;
  height: 2px;
  background-color: var(--primary-dark);
  position: relative;
}

.legend-line::before,
.legend-line::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary-dark);
}

.legend-line::before {
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.legend-line::after {
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.legend-delete {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
  border-radius: 50%;
  color: #e74c3c;
  font-size: 0.8rem;
}

/* Botão de ajuda flutuante */
.floating-help-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: white;
  border: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 950;
}

.floating-help-btn:hover {
  background-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Estilos para o modal de ajuda */
.help-step {
  display: flex;
  margin-bottom: 20px;
  gap: 15px;
}

.step-number {
  width: 30px;
  height: 30px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.help-image {
  margin-top: 10px;
  padding: 5px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.help-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Tooltips de ajuda */
.helper-tooltip {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 0.8rem;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 1000;
  animation: fade-in 0.3s ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estilos para tornar os pontos de conexão mais visíveis */
.jtk-endpoint {
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.3));
}

/* Para mostrar uma linha guia ao conectar */
.jtk-drag-line {
  stroke-dasharray: 5, 5;
  animation: dash 1s linear infinite;
}

@keyframes dash {
  to {
    stroke-dashoffset: 10;
  }
}

/* Adicione ao seu arquivo styles.css */

/* Estilo para o endpoint de entrada (risquinho) */
.jtk-endpoint[data-jtk-endpoint-type="Rectangle"] {
  cursor: crosshair;
  transition: all 0.2s ease;
}

/* Estilo para o endpoint de saída (bolinha) */
.jtk-endpoint[data-jtk-endpoint-type="Dot"] {
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Destacar endpoints durante o arrastar de conexão */
.endpoint-highlight {
  transform: scale(1.3);
  filter: brightness(1.2);
}

/* Estado de arrastar conexão */
body.dragging-connection .flow-canvas {
  cursor: crosshair !important;
}

/* Melhorar a visualização da linha durante o arrastar */
.jtk-connector.jtk-dragging {
  stroke-dasharray: 5,3;
  animation: dash 0.5s linear infinite;
}

@keyframes dash {
  to {
    stroke-dashoffset: 8;
  }
}
/* Adicione ao seu arquivo styles.css */
.connection-help {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 15px;
  border-radius: 4px;
  z-index: 1000;
  animation: fade-in 0.5s ease;
}

.connection-help.fade-out {
  animation: fade-out 0.5s ease forwards;
}

.help-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.help-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.endpoint-example {
  width: 15px;
  height: 15px;
}

.endpoint-example.input {
  width: 15px;
  height: 4px;
  background-color: #3498db;
}

.endpoint-example.output {
  border-radius: 50%;
  background-color: #25d366;
}

@keyframes fade-in {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes fade-out {
  from { opacity: 1; transform: translate(-50%, 0); }
  to { opacity: 0; transform: translate(-50%, 20px); }
}

.canvas-boundary {
  opacity: 0.7;
  transition: opacity 0.3s;
  z-index: 900;
}

.canvas-boundary:hover {
  opacity: 1;
}

/* Estilo para o botão de ver todos os nós */
#view-all-btn {
  background: none;
  border: none;
  color: #333;
  font-size: 18px;
  cursor: pointer;
  margin: 0 10px;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

#view-all-btn:hover {
  color: #007bff;
  background-color: rgba(0, 123, 255, 0.1);
}

#view-all-btn:active {
  transform: scale(0.95);
}

.notification-toast {
  position: fixed;
  top: 20px; /* Movê-las para o topo em vez de baixo */
  right: 20px; /* Alinhá-las à direita */
  max-width: 300px;
  z-index: 1001; /* Garantir que fiquem acima de outros elementos */
}

/* Adicione estes estilos no seu arquivo styles.css */

/* Melhorar a visibilidade do botão de remoção de conexão */
.connection-delete-btn {
  background-color: #e74c3c;
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  opacity: 1 !important; /* Forçar visibilidade sempre */
  transition: transform 0.2s ease;
  z-index: 1000;
}

.connection-delete-btn:hover {
  background-color: #c0392b;
  transform: scale(1.4) !important;
}

/* Tornar a conexão mais visível ao passar o mouse */
.jtk-connector:hover {
  stroke-width: 3px !important;
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.3));
}
/* Adicionar um fundo para melhorar a visibilidade */

/* Adicione no final do arquivo styles.css */
.file-icon-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.file-icon-preview i {
  font-size: 2rem;
  color: #3498db;
  margin-bottom: 5px;
}

.file-icon-preview span {
  font-size: 0.8rem;
  color: #666;
  word-break: break-all;
  text-align: center;
}

/* Cores para diferentes tipos de arquivos */
.file-icon-preview.pdf i {
  color: #e74c3c;
}

.file-icon-preview.word i {
  color: #3498db;
}

.file-icon-preview.excel i {
  color: #2ecc71;
}

.file-icon-preview.powerpoint i {
  color: #e67e22;
}

.file-icon-preview.text i {
  color: #95a5a6;
}

.file-icon-preview.archive i {
  color: #8e44ad;
}

/* Adicione no final do arquivo styles.css */
.file-size-warning {
  background-color: #feecdc;
  border-left: 4px solid #f05252;
  color: #9b2c2c;
  padding: 12px;
  margin-top: 10px;
  margin-bottom: 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-size-warning i {
  color: #e02424;
  margin-right: 8px;
}

.file-size-warning p {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.8;
}

.file-info-display {
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.file-size-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.size-progress-bar {
  width: 100%;
  height: 4px;
  background-color: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
}

.size-progress {
  height: 100%;
  background-color: #10b981;
  border-radius: 2px;
}

.size-ok .size-progress {
  background-color: #10b981; /* Verde */
}

.size-warning .size-progress {
  background-color: #f59e0b; /* Laranja */
}

.size-error .size-progress {
  background-color: #ef4444; /* Vermelho */
}

.file-limit-info {
  display: flex;
  gap: 10px;
  background-color: #e0f2fe;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  color: #0369a1;
}

.file-limit-info i {
  font-size: 1.2rem;
  color: #0ea5e9;
}

.file-limit-info p {
  margin: 0 0 4px 0;
}

.file-limit-info small {
  display: block;
  opacity: 0.8;
  margin-top: 4px;
}

/* Estilos para a tela de autenticação - Versão isolada */
.auth-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 10vh;
  z-index: 9999;
  overflow: hidden;
}

.auth-box {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  width: 400px;
  max-width: 90%;
  margin: 0 auto;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.auth-logo i {
  font-size: 2.5rem;
  color: #25d366;
}

.auth-logo h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #075e54;
}

.auth-box h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: #333;
  font-size: 1.3rem;
}

.auth-form {
  margin-top: 1.5rem;
}

.auth-form .form-group {
  margin-bottom: 1.5rem;
}

.auth-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #444;
}

.auth-form input {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
}

.auth-form input:focus {
  outline: none;
  border-color: #25d366;
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.2);
}

.auth-error {
  color: #e74c3c;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  min-height: 20px;
}

.auth-box .btn {
  width: 100%;
  padding: 0.8rem;
  font-size: 1rem;
  background-color: #25d366;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.auth-box .btn:hover {
  background-color: #128c7e;
}

.auth-box .btn:disabled {
  background-color: #a0d4b7;
  cursor: not-allowed;
}

/* Animação do spinner durante validação */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.auth-container .fa-spin {
  animation: spin 1s linear infinite;
}

/* Melhorar desempenho visual durante o arrasto */
.node-dragging {
  opacity: 0.8;
  cursor: grabbing !important;
}

.dragging-component .flow-canvas {
  background-color: rgba(37, 211, 102, 0.05);
}

/* Usar GPU para aceleração */
.flow-node, .jtk-connector, .jtk-endpoint {
  transform: translateZ(0);
  will-change: transform;
}

/* Otimizar renderização */
.jtk-connector {
  transition: none !important;
}

/* Adicionar estilo para nós com conexões ativas */
.flow-node.has-connections {
  border-left-width: 6px;
}
body.dragging-connection * {
  animation: none !important;
  transition: none !important;
}