#toolbar {
  position: absolute;
  top: 4.6rem;
  left: 0;
  /* Adjusted width for both icon and text mode */
  height: calc(100% - 4rem);
  background-color: var(--default-bg);
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  transition: width 0.3s;
}

.toolbar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.toolbar-item {
  display: flex;
  align-items: center;
  /* Align text and icons horizontally */
  padding: 0.8rem;
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
  /* border-radius: 8px; */
}

.toolbar-item img {
  width: 24px;
  height: 24px;
  margin-right: 0.5rem;
  /* Add spacing between icon and text */
  transition: opacity 0.3s;
  display: none;
}

.toolbar-item span {
  font-size: 1rem;
  color: #333;
  transition: opacity 0.3s;
}

.toolbar-item:hover,
.toolbar-item:focus {
  background-color: rgba(0, 123, 255, 0.1);
  color: #007bff;
  outline: none;
  box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

.toolbar-item:active {
  background-color: rgba(0, 123, 255, 0.2);
}

.toolbar-item.selected {
  background-color: var(--theme-color-05);
  color: #007bff;
  font-weight: bold;
  /* box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3); */
}

.logout {
  margin-top: auto;
}

.logout img {
  width: 24px;
  height: 24px;
}

.logout span {
  font-size: 0.85rem;
}

/* Hide text when toolbar is collapsed */
#toolbar.collapsed {
  width: 4rem;
  /* Smaller width for icon-only mode */
}

#toolbar.collapsed .toolbar-item span {
  display: block;
  font-size: 1px;
  opacity: 0;
  /* Hide text */
  width: 0;
  transition: opacity 0.3s, width 0.3s;
}

#toolbar.collapsed .toolbar-item {
  justify-content: center;
}

#toolbar.collapsed .toolbar-item img {
  margin-right: 0;
  /* Remove margin when text is hidden */
}

/* Toggle button styles */
.toggle-button {
  margin-bottom: 1rem;
  cursor: pointer;
  width: 24px;
  height: 24px;
}

.toggle-button img {
  width: 24px;
  height: 24px;
}

.rotate-icon {
  display: inline-block;
  /* Ensure the element is treated as a block for rotation */
  transition: transform 0.3s ease;
  /* Smooth transition */
}

.rotate-icon.rotated {
  transform: rotate(0.5turn);
  /* Rotate 180 degrees */
}

#toolbar {
  transition: width 0.3s;
}

#toolbar.collapsed {
  width: 4rem; /* Icon-only mode width */
}

#toolbar.collapsed .toolbar-content {
  overflow: hidden;
}

#toolbar.collapsed .toolbar-item span {
  display: none; /* Hide text */
}

#toolbar.collapsed .missions-list {
  display: none; /* Hide submenu in collapsed mode */
}

.rotate-icon {
  transition: transform 0.3s ease;
}

.rotate-icon.rotated {
  transform: rotate(180deg); /* Rotate arrow icon */
}
