* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Inter", sans-serif;
  background: #fafafa;
  color: #0a0a0a;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Header */
.app-header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 100;
  flex-shrink: 0;
}

/* Main Layout Wrapper */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.app-sidebar {
  width: 260px;
  background: white;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

/* Content wrapper */
.content-wrapper {
  flex: 1;
  overflow-y: auto;
}

.header-container {
  margin-left: 260px;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.back-btn {
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
}

.back-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.header-title h1 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.header-subtitle {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.track-toggle {
  display: flex;
  gap: 6px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 4px;
}

.track-btn {
  padding: 10px 24px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.track-btn.active {
  background: #0a0a0a;
  color: white;
}

/* Main Layout */
.main-container {
  max-width: 1600px;
  margin: 0 auto;
  /* padding: 32px; */
  display: grid;
  grid-template-columns: 1fr 460px;
  /* gap: 32px; */
  height: 100%;
}

/* Left - Hierarchical Tree View */
.tree-section {
  background: white;
  /* border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06); */
  overflow: hidden;
}

.tree-header {
  padding: 24px 28px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.tree-header h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.tree-header p {
  font-size: 13px;
  color: #777;
}

/* Tree Container */
.tree-container {
  padding: 20px;
  height: calc(100vh);
  overflow-y: auto;
}

/* Tree Node Styles */
.tree-node {
  margin-bottom: 8px;
}

.node-header {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.node-header:hover {
  background: rgba(0, 0, 0, 0.03);
}

.node-header.selected {
  background: #0a0a0a;
  color: white;
}

.expand-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #999;
}

.node-header.selected .expand-icon {
  color: white;
}

.tree-node.expanded > .node-header .expand-icon {
  transform: rotate(90deg);
}

.node-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin-right: 12px;
  font-size: 16px;
}

/* Level-specific colors */
.node-icon.category {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e40af;
}

.node-icon.block {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: #15803d;
}

.node-icon.industry {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}

.node-icon.jobline {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
}

.node-header.selected .node-icon {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.node-info {
  flex: 1;
  min-width: 0;
}

.node-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-meta {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.node-header.selected .node-meta {
  color: rgba(255, 255, 255, 0.6);
}

.node-badge {
  padding: 4px 10px;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 1px solid #93c5fd;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  color: #1e40af;
  margin-left: 10px;
  transition: all 0.2s ease;
}

.node-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

.node-header.selected .node-badge {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Tree Children */
.node-children {
  display: none;
  margin-left: 20px;
  padding-left: 16px;
  border-left: 2px solid rgba(0, 0, 0, 0.06);
  margin-top: 8px;
}

.tree-node.expanded > .node-children {
  display: block;
  animation: expandDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Career Path Badge */
.career-path-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 1px solid #93c5fd;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #1e40af;
  margin-top: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.career-path-badge:hover {
  background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.career-path-badge .material-icons {
  font-size: 14px;
}

/* Right - Detail Panel */
.detail-panel {
  background: white;
  /* border-radius: 16px; */
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  /* border: 1px solid rgba(0, 0, 0, 0.06); */
  padding: 28px;
  position: sticky;
  height: fit-content;
  max-height: calc(100vh);
  overflow-y: auto;
}

.panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.panel-empty .material-icons {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.panel-empty h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #666;
}

.panel-empty p {
  font-size: 13px;
  line-height: 1.6;
}

.panel-content {
  display: none;
}

.panel-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.panel-header {
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.panel-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.panel-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex: 1;
  min-width: 200px;
  word-break: break-word;
}

.panel-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border: 1px solid #a5b4fc;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #3730a3;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.panel-type-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.panel-type-badge .material-icons {
  font-size: 14px;
}

.panel-meta {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #0c4a6e;
  white-space: nowrap;
  transition: all 0.3s ease;
  max-width: 100%;
}

.meta-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15);
}

.meta-badge .material-icons {
  font-size: 14px;
  flex-shrink: 0;
}

.meta-badge span:not(.material-icons) {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.panel-section {
  margin-bottom: 28px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
  margin-bottom: 12px;
}

.section-content {
  font-size: 14px;
  line-height: 1.7;
  color: #444;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #fafafa;
  border-radius: 8px;
  font-size: 13px;
}

.info-label {
  color: #777;
  font-weight: 500;
}

.info-value {
  font-weight: 600;
  color: #0a0a0a;
}

.career-paths-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.career-path-item {
  padding: 16px;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border: 1px solid #6ee7b7;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.career-path-item:hover {
  background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
  transform: translateX(6px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25);
}

.career-path-name {
  font-size: 14px;
  font-weight: 600;
  color: #065f46;
  margin-bottom: 6px;
}

.career-path-meta {
  font-size: 11px;
  color: #047857;
  font-weight: 500;
}

.action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn .material-icons {
  font-size: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  border: 1px solid #b91c1c;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: white;
  color: #3b82f6;
  border: 2px solid #3b82f6;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* Animations */
@keyframes expandDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 1200px) {
  .main-container {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: relative;
    top: 0;
    max-height: none;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b0b0b0;
}

/* Loading State */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: #999;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f0f0f0;
  border-top-color: #0a0a0a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
