/**
 * Workspace Files Tree - Base Styles
 * Container and tree item base styles
 */

/* Container */
.workspace-files-tree {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  overflow: hidden; /* Children handle scrolling */
  height: 100%;
  user-select: none;
  background-color: var(--workspace-bg-monaco);
  border-bottom: 1px solid var(--workspace-border-default);
  position: relative; /* For absolute positioning of git gutter */
  display: flex;
  flex-direction: column;
}

/* Content wrapper - takes remaining space below search box */
.wft-content {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

/* Prevent flash during tree updates by using content-visibility */
.wft-tree {
  contain: layout style;
  position: relative;
  /* Add padding at bottom for right-click on empty space */
  padding-bottom: 100px;
}

/* Tree Item Base */
.wft-item {
  display: flex;
  align-items: center;
  padding: 1px 8px 1px 4px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.1s ease;
  gap: 4px;
  min-height: 20px;
  position: relative; /* Needed for action buttons positioning */
}

/* Hide project root - show children directly */
.wft-item.wft-root {
  display: none;
}

.wft-item.wft-root + .wft-children {
  margin-left: 0 !important;
  padding-left: 0 !important;
  border-left: none !important;
}

.wft-item:hover {
  background-color: var(--color-canvas-subtle, rgba(127, 127, 127, 0.1));
}

/* Folder styles — blue like Emacs dired */
.wft-folder {
  font-weight: 500;
}

.wft-folder > .wft-name {
  color: #6cb6ff;
}

.wft-folder.expanded > .wft-folder-toggle .wft-chevron {
  transform: rotate(90deg);
}

/* File styles */
.wft-file {
  cursor: pointer;
}

/* Folder toggle button */
.wft-folder-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

/* Chevron (expand/collapse indicator) */
.wft-chevron {
  display: inline-block;
  width: 12px;
  height: 12px;
  font-size: 10px;
  line-height: 12px;
  text-align: center;
  transition: transform 0.15s ease;
  color: var(--color-fg-muted);
}

.wft-chevron::before {
  content: "\25B8";
}

.wft-chevron.expanded {
  transform: rotate(90deg);
}

/* Spacer (for files without chevron) */
.wft-spacer {
  display: inline-block;
  width: 12px;
  height: 12px;
}

/* Icon - temporarily hidden for simplified look */
.wft-icon {
  display: none;
}

/* Name */
.wft-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-fg-default);
  font-weight: 400;
}

/* Symlink indicator */
.wft-symlink {
  color: var(--color-fg-muted);
  font-size: 11px;
  margin-left: 4px;
}
