/* File Tree Sidebar - Navigation Menu */
.file-tree-sidebar {
  position: fixed;
  left: 0;
  top: 64px;
  bottom: 0;
  width: 280px;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.file-tree-sidebar.open {
  transform: translateX(0);
}

.file-tree-toggle {
  display: none;
  position: fixed;
  left: 1rem;
  top: 80px;
  z-index: 60;
  width: 44px;
  height: 44px;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.file-tree-toggle:active {
  background: var(--bg-card);
}

@media (max-width: 1024px) {
  .file-tree-toggle {
    display: flex;
  }
}

.file-tree-section {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.file-tree-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
}

.file-tree-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.file-tree-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.file-tree-item.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.file-tree-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.file-tree-children {
  padding-left: 1.25rem;
  margin-top: 0.25rem;
}

.file-tree-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.file-tree-child:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.02);
}

.file-tree-child.active {
  color: var(--text-primary);
}

/* Folder expand/collapse */
.file-tree-folder {
  position: relative;
}

.file-tree-folder > .file-tree-item::after {
  content: '>';
  position: absolute;
  right: 0.75rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.file-tree-folder.expanded > .file-tree-item::after {
  transform: rotate(90deg);
}

.file-tree-folder .file-tree-children {
  display: none;
}

.file-tree-folder.expanded .file-tree-children {
  display: block;
}

/* Close button for mobile */
.file-tree-close {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .file-tree-close {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Overlay for mobile */
.file-tree-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 45;
}

@media (max-width: 1024px) {
  .file-tree-overlay.display {
    display: block;
  }
}