body {
  margin: 0;
  background-color: #f5f5f5;
  overflow: hidden;
  font-family: Optima, sans-serif;
}

#tree-container {
  width: 100vw;
  height: 100vh;
}

.link {
  stroke: #555;
  stroke-width: 2;
  fill: none;
}

.node rect:hover {
  fill: #dfe6e9;
  cursor: pointer;
}

#profile-container {
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  height: 100%;
  background: white;
  box-shadow: -3px 0 10px rgba(0, 0, 0, 0.2);
  display: none;
  padding: 20px;
  overflow-y: auto;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-photo {
  width: 200px;
  height: 200px;
  border-radius: 10px;
  object-fit: cover;
  margin-bottom: 15px;
}

.profile-text {
  width: 100%;
  font-size: 16px;
  line-height: 1.6;
}

#back-btn {
  position: relative;
  top: 60px;          /* move upward, increase the negative value to go higher */
  background-color: #ddd;
  color: #333;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
  display: block;
  margin: 10px auto 0 auto; /* centers the button horizontally */
}

#back-btn:hover {
  background-color: #bbb;
}

@media (max-width: 768px) {
  #tree-container {
    width: 100vw;
    height: 100vh;
    overflow: auto;
  }

  .profile-card {
    width: 90%;
    margin: 0 auto;
    position: fixed;
    bottom: 10px;
    left: 5%;
    border-radius: 16px;
    background: white;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.25);
  }

  .profile-photo {
    width: 100%;
    border-radius: 16px 16px 0 0;
  }

  #back-arrow {
    bottom: 80px;
    left: 20px;
    font-size: 36px;
  }
}
