.chartContainer {
  width: 100%;
  overflow-x: auto;
  padding: 20px 0;
}

.emptyState {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 16px;
}

.orgChart {
  margin: 5px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: max-content;
}

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

.currentBox,
.childBox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  line-height: 28px;
  padding: 0 12px;
  background: rgb(40 120 255 / 7%);
  border-radius: 2px;
  border: 1px solid rgb(40 120 255 / 50%);
  text-align: center;
  box-sizing: border-box;
  width: auto;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

.currentBox {
  background: rgb(40 120 255 / 80%);
  box-shadow: 0 2px 8px rgb(40 120 255 / 30%);
}

.rootBox {
  background: rgb(40 120 255 / 100%);
  font-weight: bold;
  height: 32px;
  line-height: 32px;
  font-size: 16px;
}

.hasChildren {
  &:hover {
    background: rgb(40 120 255 / 90%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgb(40 120 255 / 40%);
  }
}

.highlightedParent {
  background: rgb(40 120 255 / 95%) !important;
  box-shadow: 0 4px 12px rgb(40 120 255 / 50%) !important;
  transform: scale(1.05);
  z-index: 10;
}

.highlightedChild {
  background: rgb(40 120 255 / 15%) !important;
  border-color: rgb(40 120 255 / 80%) !important;
  transform: scale(1.05);
  z-index: 10;
}

.currentTitle,
.childTitle {
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.currentTitle {
  color: #fff;
}

.expandIcon {
  font-size: 10px;
  transition: transform 0.3s ease;
  opacity: 0.8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: rgb(255 255 255 / 20%);
  border-radius: 50%;

  &.expanded {
    transform: rotate(180deg);
  }
}

.arrow {
  position: relative;
  height: 30px;
  margin: 0 0 3px;
}

.arrowChild {
  height: 14px;
}

.downArrowWithLine {
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    width: 1px;
    background: #2878ff;
  }

  &::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #2878ff;
  }
}

.line {
  position: relative;
  height: 16px;
  margin: 0;
}

.downWithLine {
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    width: 1px;
    background: #2878ff;
  }
}

.childrenContainer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  width: 100%;
}

.childrenScroll {
  width: 100%;
  overflow: auto visible;
  padding-bottom: 10px;
  position: relative;
}

.childrenWrapper {
  display: flex;
  align-items: flex-start;
  position: relative;
  width: max-content;
  padding: 0 4px;
  min-width: 80px;
}

.childWrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 8px;
  min-width: 100px;
  flex-shrink: 0;

  &::before,
  &::after {
    content: '';
    position: absolute;
    top: 0;
    height: 1px;
    background-color: #2878ff;
    width: 50%;
  }

  &::before {
    left: 0;
  }

  &::after {
    right: 0;
  }

  &:first-child::before {
    display: none;
  }

  &:last-child::after {
    display: none;
  }
}

.childBox {
  text-align: center;
}

.animated {
  animation: fade-in 0.5s ease-in-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile styles applied via root class `.is-mobile` */
:global(.is-mobile) .currentBox,
:global(.is-mobile) .childBox {
  padding: 0 8px;
  font-size: 12px;
  height: 24px;
  line-height: 24px;
}

:global(.is-mobile) .rootBox {
  height: 28px;
  line-height: 28px;
  font-size: 14px;
}

:global(.is-mobile) .childWrapper {
  padding: 0 4px;
  min-width: 80px;
}

:global(.is-mobile) .expandIcon {
  width: 14px;
  height: 14px;
  font-size: 8px;
}
