/* File browser panel styles — Phase 10: FILE-01, FILE-02 */
/* Uses CSS variables from dashboard.css — do NOT add rules there */

/* Backdrop overlay — darkens the page behind the panel */
.files-backdrop {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 199; background: rgba(0, 0, 0, 0.6); display: none;
}
.files-backdrop.visible { display: block; }

.files-panel {
  position: fixed; top: 0; right: 0; width: 380px; height: 100vh;
  z-index: 200; background: #161b22;
  border-left: 2px solid var(--color-border);
  display: none; flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.files-inner {
  padding: 16px; flex: 1; overflow-y: auto;
}

.files-header {
  display: flex; flex-direction: row; justify-content: space-between;
  align-items: center; border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px; margin-bottom: 12px;
}
.files-header span { font-weight: 600; font-size: 0.95rem; }
.files-header button {
  background: none; border: none; color: var(--color-text-muted);
  cursor: pointer; font-size: 1.2rem;
}
.files-header button:hover { color: #fff; }

/* Folder input */
.files-folder-bar {
  display: flex; gap: 6px; margin-bottom: 12px;
}
.files-folder-input {
  flex: 1; background: #0d1117; border: 1px solid var(--color-border);
  color: var(--color-text); padding: 5px 8px; font-size: 0.8rem;
  border-radius: 4px; font-family: monospace;
}
.files-folder-input::placeholder { color: var(--color-text-muted); }
.files-folder-btn {
  background: var(--color-border); border: none; color: var(--color-text);
  padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 0.8rem;
}
.files-folder-btn:hover { background: #30363d; }

.file-tree { list-style: none; padding: 0; margin: 0; }
.file-tree ul { list-style: none; padding: 0; margin: 0; }

.tree-node {
  padding: 4px 0 4px 12px; cursor: pointer; font-size: 0.82rem;
  color: var(--color-text-muted); border-radius: 3px;
}
.tree-node:hover { background: rgba(255,255,255,0.07); }

.tree-node.is-dir { color: var(--color-text); font-weight: 500; cursor: pointer; }
.tree-node.is-dir::before { content: "▶ "; font-size: 0.7rem; }
.tree-node.is-dir.open::before { content: "▼ "; font-size: 0.7rem; }

.tree-node.is-file::before { content: "📄 "; }
.tree-node.is-file:hover { color: var(--color-accent-claude); }

.files-attach-toast {
  position: fixed; bottom: 80px; right: 20px;
  background: #2ea043; color: #fff; padding: 6px 12px;
  border-radius: 4px; font-size: 0.8rem; display: none;
  z-index: 250;
}
.files-attach-toast.visible { display: block; }

/* Folder navigator */
.folder-nav {
  border: 1px solid var(--color-border); border-radius: 4px;
  background: #0d1117; margin-bottom: 12px; max-height: 50vh; overflow-y: auto;
}
.folder-current {
  padding: 6px 10px; font-size: 0.78rem; color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border); font-family: monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.folder-list { list-style: none; padding: 0; margin: 0; }
.folder-item {
  padding: 5px 12px; font-size: 0.84rem; cursor: pointer;
  color: var(--color-text); border-bottom: 1px solid rgba(255,255,255,0.04);
}
.folder-item:hover { background: rgba(255,255,255,0.07); }
.folder-item::before { content: "📁 "; }
.folder-back { color: var(--color-text-muted); font-style: italic; }
.folder-back::before { content: "⬆ "; }
.folder-select {
  color: #2ea043; font-weight: 600; background: rgba(46,160,67,0.08);
}
.folder-select::before { content: "✓ "; }
.folder-select:hover { background: rgba(46,160,67,0.15); }

/* Empty state */
.files-empty {
  color: var(--color-text-muted); font-size: 0.85rem;
  text-align: center; padding: 24px 12px; list-style: none;
}
