/* Tree Structure Styles for Product BOM */

/* Summary Tree Container */
.tree-container {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.tree-node {
  margin-bottom: 0.25rem;
}

.tree-item {
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.tree-item:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

/* Level specific styles for summary tree */
.tree-item.level-1 {
  background-color: #f3f4f6;
  border-left: 4px solid #8B1538;
  font-size: 0.95rem;
}

.tree-item.level-2 {
  background-color: #f9fafb;
  border-left: 3px solid #3b82f6;
  font-size: 0.9rem;
}

.tree-item.level-3 {
  background-color: #fafafa;
  border-left: 3px solid #10b981;
  font-size: 0.85rem;
}

.tree-item.level-4 {
  background-color: #fcfcfc;
  border-left: 2px solid #f59e0b;
  font-size: 0.8rem;
}

.tree-item.level-5 {
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.tree-children {
  margin-top: 0.25rem;
  transition: all 0.3s ease;
}

.tree-children.hidden {
  display: none;
}

.toggle-icon {
  transition: transform 0.2s ease;
  color: #6b7280;
}

/* Detail Tree Container */
.tree-container-detail {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.tree-node-detail {
  margin-bottom: 0.5rem;
}

.tree-item-detail {
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.tree-item-detail:hover:not(.level-1) {
  opacity: 0.95;
  transform: translateX(2px);
}

.tree-children-detail {
  transition: all 0.3s ease;
}

.tree-children-detail.hidden {
  display: none;
}

.toggle-icon-detail {
  transition: transform 0.2s ease;
}

/* Expand/Collapse Animation */
@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 1000px;
  }
}

@keyframes slideUp {
  from {
    opacity: 1;
    max-height: 1000px;
  }
  to {
    opacity: 0;
    max-height: 0;
  }
}

/* Connector Lines (optional) */
.tree-children::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: #e5e7eb;
}

/* Scrollbar Styles */
.tree-container::-webkit-scrollbar,
.tree-container-detail::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.tree-container::-webkit-scrollbar-track,
.tree-container-detail::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.tree-container::-webkit-scrollbar-thumb,
.tree-container-detail::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.tree-container::-webkit-scrollbar-thumb:hover,
.tree-container-detail::-webkit-scrollbar-thumb:hover {
  background: #555;
}
