body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
  color: white;
  padding: 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.content {
  padding: 30px;
}

.upload-area {
  border: 3px dashed #ddd;
  border-radius: 10px;
  padding: 40px;
  text-align: center;
  margin-bottom: 30px;
  transition: all 0.3s ease;
}

.upload-area:hover {
  border-color: #0066cc;
  background-color: #f8f9ff;
}

.upload-area.dragover {
  border-color: #0066cc;
  background-color: #e6f2ff;
}

input[type="file"] {
  display: none;
}

.upload-btn {
  background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

.upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 102, 204, 0.3);
}

.download-btn {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.results {
  margin-top: 20px;
}

.result-section {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin: 15px 0;
  border-left: 4px solid #0066cc;
}

.result-title {
  font-weight: bold;
  color: #0066cc;
  margin-bottom: 10px;
  font-size: 18px;
}

.code-block {
  background: #2d3748;
  color: #e2e8f0;
  padding: 15px;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
  font-size: 14px;
}

.json-viewer {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
}

.error {
  color: #e53e3e;
}

.success {
  color: #38a169;
}

.info-box {
  background: #bee3f8;
  border: 1px solid #90cdf4;
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
}

.script-list {
  list-style: none;
  padding: 0;
}

.script-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  margin: 10px 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.script-item:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.script-name {
  font-weight: bold;
  color: #2d3748;
}

.script-type {
  color: #718096;
  font-size: 14px;
}

/* Monaco Editor Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: white;
  margin: 2% auto;
  width: 95%;
  height: 90%;
  border-radius: 12px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
  color: white;
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  flex-grow: 1;
}

.modal-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 14px;
}

.file-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 14px;
  display: none;
}

.language-select option {
  background: #0066cc;
  color: white;
}

.file-select option {
  background: #0066cc;
  color: white;
}

.control-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 5px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 24px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.monaco-container {
  flex: 1;
  min-height: 0;
  border-radius: 0 0 12px 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .modal-content {
    margin: 5% auto;
    width: 98%;
    height: 85%;
  }
  
  .modal-header {
    padding: 10px 15px;
    flex-wrap: wrap;
  }
  
  .modal-header h3 {
    font-size: 16px;
    margin-bottom: 10px;
    width: 100%;
  }
  
  .modal-controls {
    gap: 5px;
  }
  
  .control-btn, .language-select, .file-select {
    font-size: 14px;
    padding: 6px 8px;
  }
}

/* Animation for modal */
.modal.show {
  display: block;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content.show {
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.rendered-container {
  flex: 1;
  overflow: auto;
  padding: 10px;
}

/* BPMN Viewer frame inside rendered container */
#renderedView iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.tree-view ul {
  list-style: none;
  padding-left: 20px;
}

.tree-view li {
  margin: 2px 0;
}

.table-view {
  width: 100%;
  border-collapse: collapse;
}

.table-view td, .table-view th {
  border: 1px solid #e2e8f0;
  padding: 4px 8px;
}

.table-view tr:nth-child(even) {
  background: #f8f9fa;
}
.metadata-table,
.resources-table {
  width: 100%;
  border-collapse: collapse;
}

.metadata-table th,
.metadata-table td,
.resources-table th,
.resources-table td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid #ddd;
}

.metadata-table tr:nth-child(even),
.resources-table tr:nth-child(even) {
  background-color: #f2f2f2;
}

.resources-table tr:hover {
  background-color: #e9e9e9;
  cursor: pointer;
}

.selected-row {
  background-color: #d0d0d0;
}

.tree-panel {
  display: flex;
  gap: 20px;
}

.tree-panel > div {
  flex: 1;
}

.tree-panel ul {
  list-style-type: none;
  padding-left: 20px;
}

.tree-panel li {
  padding: 4px;
  cursor: pointer;
}

.tree-node-icon {
  margin-right: 5px;
}

.highlight {
  background-color: #ffffdd;
  font-weight: bold;
}
.lang-select {
  margin-top: 10px;
  padding: 5px;
  border-radius: 4px;
  border: none;
}

/* Container principal precisa de position: relative para o overlay funcionar */
/* Container principal precisa de position: relative para o overlay funcionar */
.mmap-container {
  position: relative;
  display: flex;
  gap: 20px; /* Aumenta um pouco o espaço entre os painéis */
  width: 100%;
  
  /* CHAVE PARA A CENTRALIZAÇÃO: Centraliza os painéis quando eles não ocupam 100% da largura */
  justify-content: center;
}

/* Overlay SVG para as linhas */
.mmap-svg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Painéis da árvore com largura auto-ajustável e máxima */
.tree-panel {
  /* flex: 1; << REMOVIDO para impedir a expansão automática e forçada */
  
  /* CHAVE PARA O AUTO-AJUSTE: */
  flex-grow: 1;      /* Permite que o painel cresça se houver espaço livre... */
  flex-shrink: 1;    /* Permite que o painel encolha se não houver espaço */
  max-width: 45%;    /* ...mas NUNCA mais largo que 45% do container. */
  min-width: 300px;  /* Garante que o painel não fique muito estreito. */

  border: 1px solid #ccc;
  padding: 10px;
  overflow: auto;
  max-height: 75vh;
  z-index: 0;
}

/* O restante do seu CSS para .tree-panel ul, li, .highlight, etc. continua o mesmo */

.tree-panel ul { list-style-type: none; padding-left: 15px; }
.tree-panel li { padding: 2px 0; cursor: pointer; }
.tree-panel li > span:hover { background-color: #f0f0f0; }

.tree-panel li.highlight > span {
  background-color: #cce5ff;
  border: 1px solid #99caff;
  border-radius: 3px;
  font-weight: bold;
}

.tree-node-icon {
  cursor: pointer;
  margin-right: 5px;
  user-select: none;
  display: inline-block;
  width: 12px;
}

.mapping-line {
  stroke: #b0b0b0;
  stroke-width: 1.5;
  fill: none;
  transition: all 0.2s ease;
}

.mapping-line.highlight {
  stroke: #007bff;
  stroke-width: 2.5;
}

/* Container principal da visão de pacote */
.package-view-container {
    padding: 10px;
}

/* Estilo para os títulos das seções (h2) */
.package-view-container h2 {
    font-size: 18px;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
    margin-top: 25px;
    margin-bottom: 15px;
}
.package-view-container h2:first-of-type {
    margin-top: 0;
}

/* Pequeno ajuste na tabela de relações para melhor espaçamento */
.relations-table td {
    font-style: italic;
    color: #444;
}

/* Tabela para a nova seção de Endpoints */
.endpoints-table td {
    vertical-align: middle;
}
.endpoints-table td[rowspan] {
    font-weight: bold;
    color: #333;
    background-color: #f9f9f9;
}