body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 10px;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
}

td {
  font-size: 0.8rem;
}

#controls {
  width: 250px;
  padding: 1rem;
  background-color: #f8f9fa;
  border-right: 1px solid #dee2e6;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  overflow-y: auto; /* Adiciona scroll vertical */
  max-height: 100vh; /* Garante altura máxima */
}

#controls input,
#controls button,
#controls select {
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background-color: #fff;
    box-sizing: border-box;
    margin-bottom: 0.5rem;
}

  #controls .control-title {
    width: 90%;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    align-self: flex-start;
    margin-left: 5%;
  }
  #controls .control-footer {
    margin-top: auto;
    padding: 1rem 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    position: sticky; /* Mantém o footer visível */
    bottom: 0;
    background: #f8f9fa; /* Mantém o fundo consistente */
  }
  .brand {
    padding: 1rem 0.5rem 1.5rem 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
  }
  .logo {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
    color: #2c3e50;
  }
  .brand-subtitle {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    letter-spacing: 0.5px;
  }
  #controls button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  .material-icons {
    font-size: 18px;
  }
  #controls button {
    font-size: 0.65rem;
    margin-bottom: 0.5rem;
    transition: all 0.15s ease-in-out;
  }
  #controls button:last-child {
    margin-bottom: 0;
  }
  #controls .btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
  }
  #controls .btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
  }
  #controls .btn-danger {
    width: 90%;
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
  }
  #controls .btn-danger:hover {
    background-color: #bb2d3b;
    border-color: #b02a37;
  }
  #controls input:focus,
  #controls button:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    border-color: #86b7fe;
  }
  #canvas {
    flex: 1;
    position: relative;
    overflow: auto;
    min-height: 100vh;
    margin-left: 250px;
    background-color: #f8f9fa;
    background-image: radial-gradient(rgba(130, 130, 130, 0.2) 1px, transparent 1px);
    background-size: 20px 20px;
  }
  #canvas-content {
    position: absolute;
    min-width: 100%;
    min-height: 100%;
  }
  .model {
    position: absolute;
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 4px;
    cursor: move;
    font-size: 13px;
    min-width: 220px;
    z-index: 1001;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
  }

  .model:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
  }

  .model .title {
    font-weight: 600;
    color: #2c3e50;
    padding: 4px 8px;
    margin: 4px 0 4px 0;
    cursor: default;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .model .fields {
    list-style-type: none;
    padding: 4px;
    margin: 0;
  }

  .model select {
    margin-left: 8px;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background-color: white;
    font-size: 13px;
    transition: all 0.2s ease;
  }

  .model select:hover {
    border-color: #cbd5e0;
  }

  .model select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
  }

  .model.selected {
    outline: 2px solid #4299e1;
    box-shadow: 0 0 0 4px rgba(66, 153, 225, 0.1);
  }
  .multi-select .model:hover {
    outline: 2px solid #0d6efd50;
  }
  .relationship {
    position: absolute;
    border-top: 1px dashed #ccc;
    height: 0;
    transform-origin: 0 0;
    pointer-events: auto; /* Alterado de 'none' para 'auto' */
  }
  .relationship::before {
    content: "";
    position: absolute;
    left: -4px;
    top: -4px;
    width: 8px;
    height: 8px;
    background: #29aded;
    border-radius: 50%;
  }
  .relationship::after {
    content: "";
    position: absolute;
    right: -8px;
    top: -6px;
    width: 0;
    height: 0;
    border-left: 8px solid #000;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
  }

.relationship-info {
  font-size: 0.5rem;
  font-style: italic;
}

.on-delete-cascade {
    color: red;
}

.on-delete-restrict {
    color: blue;
}

.on-delete-setnull {
    color: yellow;
}

.on-update-cascade {
    color: blue;
}

.on-update-restrict {
    color:red;
}

.on-update-setnull {
    color: yellow;
}


  .field-row {
    display: grid;
    grid-template-columns: 150px 120px 100px 120px 150px;
    gap: 8px;
    align-items: center;
    margin: 5px 0;
    font-size: 11px;
  }

  .field-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .field-row select,
  .field-row input[type="text"] {
    width: 100%;
    padding: 2px 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
  }

  .not-null-div {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .not-null-div label {
    font-size: 10px;
  }

  .field-comment {
    font-size: 10px;
    color: #666;
    font-style: italic;
  }

  .field-row .remove-field {
    cursor: pointer;
    color: #ff4444;
    margin-left: 5px;
    font-weight: bold;
    font-size: 14px;
    display: inline;
  }

  .add-field-btn {
    width: 110px;
    background: transparent;
    border: 1px dashed #dee2e6;
    cursor: pointer;
    font-size: 0.75rem;
    text-align: center;
    color: #6c757d;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .add-field-btn:hover {
    background: #f8f9fa;
    border-color: #0d6efd;
    color: #0d6efd;
  }

  .add-field-btn i {
    font-size: 14px;
  }

  .field-row span {
    display: flex;
    align-items: center;
  }

  #searchBox {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: white;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  #searchInput {
    /* padding: 4px; */
    max-width: 200px;
    /* border: 1px solid #ddd;
    font-size: 12px; */
  }

  #schemasViewFilter {
    min-width: 150px;
  }

  .hidden-filtered-by-schema {
    opacity: 0.3;
  }

  .destaque-filtered-by-schema {
    border: 2px solid #4caf50 !important;
  }

  .highlight-table {
    box-shadow: 0 0 15px #4caf50;
    border: 2px solid #4caf50 !important;
    transition: all 0.3s ease;
  }

  .table-controls {
    display: flex;
    gap: 4px;
  }

  .table-control-btn {
    cursor: pointer;
    padding: 0 4px;
    font-size: 12px;
    color: #666;
  }

  .table-control-btn:hover {
    color: #333;
  }

  .toast {
    position: fixed;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
    animation: fadeInOut 5s ease-in-out forwards;
  }

  @keyframes fadeInOut {
    0% {
      opacity: 0;
    }
    10% {
      opacity: 1;
    }
    90% {
      opacity: 1;
    }
    100% {
      opacity: 0;
    }
  }

  .modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
  }

  .modal-buttons button {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
  }

  .modal-buttons button:first-child {
    color: #fff;
    background-color: #007bff;
    border: 1px solid #007bff;
  }

  .modal-buttons button:first-child:hover {
    background-color: #0069d9;
    border-color: #0062cc;
  }

  .modal-buttons button:last-child {
    color: #6c757d;
    background-color: #fff;
    border: 1px solid #6c757d;
  }

  .modal-buttons button:last-child:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
  }

  .modal-content {
    margin: 1rem 0;
  } */

  .relationship-info {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
  }

  .relationship-info p {
    margin: 0.25rem 0;
    font-size: 0.8rem;
  }

  .relationship-info strong {
    color: #495057;
  }

  #sqlContent {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
    max-height: 60vh;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    border: 1px solid #dee2e6;
  }

  .relationship-active {
    animation: buttonPulse 1.5s infinite;
    background-color: #007bff !important;
    color: white !important;
  }

  @keyframes buttonPulse {
    0% {
      opacity: 1;
    }
    50% {
      opacity: 0.6;
    }
    100% {
      opacity: 1;
    }
  }

  .delete-btn {
    background-color: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
  }

  .delete-btn:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
  }

  #controls .control-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
  }

  .brand {
    padding: 0rem 0.5rem 0rem 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    text-align: left;
  }

  .logo {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
    color: #2c3e50;
  }

  .logo span {
    color: #0d6efd;
    font-weight: 400;
  }

  .brand-subtitle {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    letter-spacing: 0.5px;
  }

  .field-section {
    margin-bottom: 15px;
  }

  .field-section h6 {
    font-size: 11px;
    color: #666;
    margin: 5px 0;
    padding-bottom: 3px;
    border-bottom: 1px solid #eee;
    text-transform: uppercase;
  }

  .field-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .primary-key-field .field-row {
    background-color: #f8f9fa;
  }

  .foreign-key-field .field-row {
    background-color: #fff3e0;
  }

  /* Adicione estas novas regras aqui */
  .relationship:hover {
    border-top: 3px dashed #007bff;
  }

  .relationship:hover::before {
    background-color: #007bff;
  }

  .relationship:hover::after {
    border-left-color: #007bff;
  }

  #controls label {
    display: block;
    font-size: 0.75rem !important;
    color: #6c757d;
    margin-bottom: 0.25rem;
    font-weight: 100 !important;
    text-align: left;
  }


  .selection-box {
    position: absolute;
    border: 1px solid #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
    pointer-events: none;
    z-index: 1000;
  }

  .table.selected {
    outline: 2px solid #0d6efd;
  }

  .multi-select .table:hover {
    outline: 2px solid #0d6efd50;
  }

  /* Atualização dos estilos do modal */
  .table-modal {
    width: 80%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  }

  .table-modal .modal-content {
    padding: 20px;
  }

  .table-modal .model {
    position: static;
    width: 100%;
    margin: 0;
    box-shadow: none;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fff;
  }

  .table-modal h3 {
    margin: 0;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 18px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .table-modal .modal-buttons {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8f9fa;
  }

  .table-modal .modal-buttons button {
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
  }

  .table-modal .modal-buttons button:hover {
    background: #e9ecef;
  }

  .table-modal .field-row {
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
  }

  .table-modal .field-row:last-child {
    border-bottom: none;
  }

  .table-modal .add-field-btn {
    margin: 12px 8px;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
  }

  .table-modal .add-field-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
  }

  /* Estilos adicionais para campos */
  .field-section {
    margin-bottom: 15px;
  }

  .field-section h6 {
    font-size: 11px;
    color: #666;
    margin: 5px 0;
    padding-bottom: 3px;
    border-bottom: 1px solid #eee;
    text-transform: uppercase;
  }

  .field-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .primary-key-field .field-row {
    background-color: #f8f9fa;
  }

  .foreign-key-field .field-row {
    background-color: #fff3e0;
  }

  .field-section li {
    list-style: none;
    padding: 0;
    margin: 0;
  }

.table-editor {
  font-size: 1rem;;
}

.table-editor h6 {
  font-size: 0.9rem;
  color: #666;
  margin: 5px 0;
  padding-bottom: 3px;
  border-bottom: 1px solid #eee;
  text-transform: uppercase;
}

.mouseover-hand:hover {
  cursor: pointer;
}

/* Estilizacao dos formularios */
.form-control, 
.form-select {
  font-size: 0.8rem;
  padding: 2px 10px;
  border: none;
  border-bottom: 1px solid #dee2e6;
  border-radius: 0;
  background-color: transparent;
}

.form-control:focus {
  box-shadow: none;
  border-bottom: 2px solid #0d6efd;
}

.form-control::placeholder,
.form-select::placeholder {
  font-style: italic;
  color: #bbb;
  opacity: 0.6;
}
/* Labels styling */
label, 
table thead tr th {
  font-size: 0.75rem !important;
  font-weight: bold !important;
  color: #495057 !important;
}

label.required:after {
  content: "*";
  color: #dc3545;
  margin-left: 0.25rem;
}

label {
  display: block;
}

.table-editor-section {
  padding: 2px;
  margin-bottom: 10px;
}



/* Customização do Toast SweetAlert2 */
.swal2-toast {
  max-width: 300px !important;
  padding: 0.5rem !important;
  background-color: #3a3a3a !important;
  color: white !important;
}

.swal2-toast .swal2-title {
  font-size: 0.8rem !important;
  font-weight: 100 !important;
  margin: 0 !important;
}

.swal2-toast .swal2-html-container {
  font-size: 0.8rem !important;
  margin: 0 !important;
}

.swal2-toast .swal2-icon {
  width: 0.8em !important;
  /* height: 1em !important; */
  margin: 0 0.5em 0 0 !important;
}

.swal2-toast .swal2-icon .swal2-icon-content {
  font-size: 0.8em !important;
}

.modal-xl {
  max-width: 90vw !important;
}

/* Tabela de fields  */
#tableFieldsList th:nth-child(1) {
  width: 220px;
}
#tableFieldsList th:nth-child(2) {
  width: 160px;
}
#tableFieldsList th:nth-child(3) {
  width: 100px;
}
#tableFieldsList th:nth-child(4), 
#tableFieldsList td:nth-child(4) {
  text-align: center;
  width: 100px;
}
#tableFieldsList th:nth-child(5) {
  width: 300px;
}
#tableRelationshipsList th:nth-last-child(2) {
  width: 25%;
}
#tableConstraintsList th:nth-child(1) {
  width: 100px;
}
#tableConstraintsList th:nth-child(2) {
  width: 40%;
}


/* Auto Fill  Indexes, trigger and others name */
input.name-autofill {
  margin-right: 30px;
}

.name-autofill input {
  padding-right: 30px; /* Espaço para o ícone */
}

.name-autofill .refresh-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 1rem; /* Tamanho do ícone */
  color: #6c757d; /* Cor do ícone */
}

/* Estilização do select de projetos */
#savedProjects {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

#savedProjects option {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  font-size: 0.8rem;
  color: #495057;
  background: transparent;
}

#savedProjects option:hover {
  background-color: #f8f9fa;
}

#savedProjects option:checked {
  background-color: #e9ecef;
  color: #212529;
  font-weight: 500;
}

#savedProjects:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.cursor-move {
    cursor: move;
}

#annotationsModal .modal-dialog {
    margin: 1.75rem auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 1200px;
}

#annotationsModal.show {
    display: block;
    background: rgba(0, 0, 0, 0.2);
}

#annotationsModal textarea {
    min-height: 60vh;
    resize: vertical;
}

/* Annotations Sidebar */
.annotations-sidebar {
    position: fixed;
    top: 0;
    right: -500px; /* Começa fora da tela */
    width: 500px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1050;
    display: flex;
    flex-direction: column;
}

.annotations-sidebar.open {
    right: 0;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.sidebar-header h5 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.sidebar-body {
    flex: 1;
    padding: 1rem;
    overflow: hidden;
}

.sidebar-body textarea {
    width: 100%;
    height: 100%;
    border: none;
    resize: none;
    padding: 0;
}

.sidebar-body textarea:focus {
    outline: none;
    box-shadow: none;
}
