/**
 * Workspace Files Tree - Git Status Styles
 * Git gutter, status indicators, and icon colors
 */

/* ========== Element-based git gutter (.wft-git-gutter span) ========== */
.wft-git-gutter {
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 3px;
  border-radius: 1px;
  z-index: 2;
  pointer-events: none;
  font-size: 0; /* Hide text content, show only colored bar */
  overflow: hidden;
}

/* Modified files - yellow/orange bar */
.wft-git-gutter.git-modified {
  background-color: var(--color-attention-fg, #d29922);
}

/* Added files - green bar */
.wft-git-gutter.git-added {
  background-color: var(--color-success-fg, #3fb950);
}

/* Deleted files - red bar */
.wft-git-gutter.git-deleted {
  background-color: var(--color-danger-fg, #f85149);
}

/* Untracked files - gray dashed bar */
.wft-git-gutter.git-untracked {
  background: repeating-linear-gradient(
    180deg,
    var(--color-fg-muted, #768390) 0,
    var(--color-fg-muted, #768390) 3px,
    transparent 3px,
    transparent 6px
  );
}

/* Hide git gutter on expanded folders - only show on collapsed folders */
.wft-folder.expanded .wft-git-gutter {
  display: none;
}

/* ========== CSS pseudo-element based git gutter (data-git-status attribute) ========== */
/* Base git gutter - uses ::after to avoid conflict with tree connectors */
.wft-item[data-git-status]::after {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 3px;
  border-radius: 1px;
  z-index: 2;
  pointer-events: none;
}

/* Modified files - yellow/orange bar */
.wft-item[data-git-status="M"]::after {
  background-color: var(--color-attention-fg, #d29922);
}

/* Added files - green bar */
.wft-item[data-git-status="A"]::after {
  background-color: var(--color-success-fg, #3fb950);
}

/* Deleted files - red bar + strike-through text */
.wft-item[data-git-status="D"]::after {
  background-color: var(--color-danger-fg, #f85149);
}

.wft-item[data-git-status="D"] .wft-name {
  text-decoration: line-through;
  opacity: 0.7;
  color: var(--color-danger-fg, #f85149);
}

/* Renamed files - purple bar */
.wft-item[data-git-status="R"]::after {
  background-color: var(--color-done-fg, #a371f7);
}

/* Copied files - purple bar */
.wft-item[data-git-status="C"]::after {
  background-color: var(--color-done-fg, #a371f7);
}

/* Untracked files - gray dashed bar */
.wft-item[data-git-status="??"]::after {
  background: repeating-linear-gradient(
    180deg,
    var(--color-fg-muted, #768390) 0,
    var(--color-fg-muted, #768390) 3px,
    transparent 3px,
    transparent 6px
  );
}

/* Staged indicator - brighter version with slight glow */
.wft-item[data-git-staged="true"]::after {
  box-shadow: 0 0 4px currentColor;
}

/* Hide git gutter on expanded folders - only show on collapsed folders and files */
.wft-folder.expanded[data-git-status]::after {
  display: none;
}

/* Git Status - Icon color only (no underline, using git gutter vertical bar instead) */
.wft-icon.wft-icon-modified {
  color: var(--color-attention-fg, #d29922) !important;
}

.wft-icon.wft-icon-added {
  color: var(--color-success-fg, #3fb950) !important;
}

.wft-icon.wft-icon-deleted {
  color: var(--color-danger-fg, #f85149) !important;
}

/* Deleted files - strikethrough name (fallback via icon class) */
.wft-item:has(.wft-icon-deleted) .wft-name {
  text-decoration: line-through;
  opacity: 0.7;
  color: var(--color-danger-fg, #f85149);
}

.wft-icon.wft-icon-untracked {
  color: var(--color-fg-muted, #768390) !important;
}

/* ========== Toggle: hide all git visuals when .wft-no-git on container ========== */
.wft-no-git .wft-git-gutter,
.wft-no-git .wft-git-panel {
  display: none !important;
}
.wft-no-git .wft-item[data-git-status]::after {
  display: none !important;
}
.wft-no-git .wft-icon.wft-icon-modified,
.wft-no-git .wft-icon.wft-icon-added,
.wft-no-git .wft-icon.wft-icon-deleted,
.wft-no-git .wft-icon.wft-icon-untracked {
  color: inherit !important;
}
.wft-no-git .wft-item:has(.wft-icon-deleted) .wft-name {
  text-decoration: none;
  opacity: 1;
  color: inherit;
}
.wft-no-git .wft-item[data-git-status="D"] .wft-name {
  text-decoration: none;
  opacity: 1;
  color: inherit;
}
