html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}
::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

textarea {
  resize: vertical;
}

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  margin: 0;
  padding: 0;
}

header, footer {
  background-color: #2c3e50;
  color: white;
  text-align: center;
  padding: 1rem 0;
}

main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.org-chart-wrapper {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  margin-bottom: 2rem;
  max-height: 80vh;
  overflow: hidden;
}

.org-chart-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem 0;

  min-height: 400px;
  max-height: calc(80vh - 60px);
  width: 100%;
  cursor: grab;
  overflow: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}

.org-chart-container::-webkit-scrollbar {
  display: none;
}
.org-chart-container.active {
  cursor: grabbing;
}

.card-container {
  position: relative;
  margin-bottom: 1em;
  display: flex;
  flex-direction: row;
  /*align-items: flex-start; Removido para deixar centralizar, mas pode ser que quebre com grandes quantidades  */
  align-items: center;
}

.person-card {
  display: flex;
  align-items: center;
  background-color: white;
  border-radius: 0.5em;
  border: 1px solid #ccc;
  box-shadow: 0 0.25em 0.375em rgba(0, 0, 0, 0.1);
  padding: 1em;
  width: 18.75em; /* 300px / 16px = 18.75em */
  position: relative;
  transition: all 0.3s ease;
  cursor: default;
}

.person-card:hover {
  box-shadow: 0 0.375em 0.75em rgba(0, 0, 0, 0.15); /* 6px 12px */
  transform: translateY(-0.125em); /* -2px */
}

.card-container:hover > .person-card {
  border-color: #999;
  box-shadow: 0 0.375em 0.75em rgba(0, 0, 0, 0.15);
}

.card-container:hover > .children-container > .card-container:hover > .person-card {
  border-color: #777;
  box-shadow: 0 0.375em 0.75em rgba(0, 0, 0, 0.2);
}

.card-container:hover > .children-container > .card-container:hover > .children-container > .card-container:hover > .person-card {
  border-color: #555;
  box-shadow: 0 0.375em 0.75em rgba(0, 0, 0, 0.25);
}

.card-container:hover > .children-container > .card-container:hover > .children-container > .card-container:hover > .children-container > .card-container:hover > .person-card {
  border-color: #333;
  box-shadow: 0 0.375em 0.75em rgba(0, 0, 0, 0.3);
}

.person-photo {
  width: 3.75em; /* 60px / 16px = 3.75em */
  height: 3.75em;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 1em;
  border: 0.125em solid #3498db; /* 2px / 16px = 0.125em */
}

.person-info {
  flex: 1;
}

.person-name {
  margin: 0 0 0.5em 0;
  font-size: 1.2em;
  color: #2c3e50;
}

.person-code {
  margin: 0 0 0.3em 0;
  font-size: 0.9em;
  color: #3498db;
  font-weight: bold;
}

.person-position {
  margin: 0;
  font-size: 0.9em;
  color: #7f8c8d;
}

.loading-indicator {
  padding: 1rem;
  text-align: center;
  color: #7f8c8d;
  font-style: italic;
  width: 100%;
}

.error-message {
  padding: 1rem;
  text-align: center;
  color: #e74c3c;
  background-color: #fadbd8;
  border-radius: 4px;
  margin: 0.5rem 0;
  width: 100%;
}

.no-children-message {
  padding: 1rem;
  text-align: center;
  color: #7f8c8d;
  background-color: #f8f9fa;
  border-radius: 4px;
  margin: 0.5rem 0;
  width: 100%;
}

.expand-button {
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 50%;
  width: 1.5em; /* 24px / 16px = 1.5em */
  height: 1.5em;
  font-size: 1em;
  line-height: 0;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
  position: absolute;
  right: -0.75em; /* -12px / 16px = -0.75em */
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

.expand-button:hover {
  background-color: #2980b9;
}

.children-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-left: 2em;
  position: relative;
  padding-left: 1em;
  width: auto;
}

.search-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-input {
  padding: 0.5rem 1rem;
  border: 1px solid #ccc;
  border-radius: 20px;
  font-size: 0.9rem;
  width: 200px;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
  width: 220px;
}

.search-button {
  background-color: #3498db;
}

.search-button:hover {
  background-color: #2980b9;
}

.action-controls {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 1000;
}

.action-button {
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.action-button:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.action-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
}

.online-button {
  background-color: #3498db;
}

.online-button:hover {
  background-color: #2980b9;
}

.online-button.active {
  background-color: #2980b9;
  box-shadow: 0 0 5px #2980b9;
}

.offline-button {
  background-color: #f39c12;
}

.offline-button:hover {
  background-color: #d35400;
}

.offline-button.active {
  background-color: #d35400;
  box-shadow: 0 0 5px #d35400;
}

.close-all-button {
  background-color: #e74c3c;
}

.close-all-button:hover {
  background-color: #c0392b;
}

/* API Testing Form Styles */
.api-test-wrapper {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  margin-bottom: 2rem;
}

#api-response {
  background-color: #f8f9fa;
  border-radius: 4px;
  padding: 1rem;
  max-height: 400px;
  overflow: auto;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}

#copy-response-btn {
  font-size: 0.8rem;
}

#copy-response-btn i {
  margin-right: 0.25rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .person-card {
    width: 220px;
  }

  .person-photo {
    width: 40px;
    height: 40px;
  }

  .person-name {
    font-size: 0.9rem;
  }

  .person-position {
    font-size: 0.75rem;
  }


  .children-container {
    margin-left: 1.5rem;
    padding-left: 0.5rem;
  }


  .children-container::before {
    width: 0.5rem;
  }

  .children-container .card-container::before {
    left: -0.5rem;
    width: 0.5rem;
  }


  .card-container:not(:last-child) {
    margin-bottom: 0.75rem;
  }
}

.hidden,
[hidden] {
  display: none !important;
}

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;

}

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

.invisible {
  visibility: hidden;
}

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}
