/* ─── sidebar.css ─────────────────────────────────────────────────────────────
 * Left sidebar panel: section headers, sidebar tabs (Files/Assets), file tree,
 * user list, chat box, assets explorer grid.
 * ─────────────────────────────────────────────────────────────────────────── */

/* ── Sidebar outer container ─────────────────────────────────────────────── */
.left {
  background: linear-gradient(180deg,
    rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  min-height: 0; min-width: 0; overflow: hidden;
  position: relative;
}

/* ── Section block inside sidebar ───────────────────────────────────────── */
.section {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.section-title {
  color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
  font-size: 10px; margin-bottom: 8px; font-weight: 600;
}
.section-head {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 8px; gap: 6px;
}
.mini-actions { display: flex; gap: 4px; }
.mini-btn {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  border-radius: 4px; padding: 2px 7px;
  font-size: 10px; cursor: pointer;
  transition: background 0.15s;
}
.mini-btn:hover {
  background: rgba(255,255,255,0.12); color: var(--text);
}

/* ── Sidebar tab strip (Files / Assets) ─────────────────────────────────── */
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(255,255,255,0.03);
}
.sidebar-tab {
  flex: 1; border: none; background: transparent; color: var(--muted);
  font-size: 11px; font-weight: 600; padding: 9px 6px; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.12s, border-color 0.12s;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.sidebar-tab:hover { color: var(--text); }
.sidebar-tab.active { color: var(--fae-color2); border-bottom-color: var(--fae-color2); }

.sidebar-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.sidebar-panel.hidden { display: none; }

/* ── Assets explorer toolbar & grid ─────────────────────────────────────── */
.assets-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px 6px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.assets-search {
  flex: 1; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 5px;
  color: var(--text); font-size: 11px; padding: 5px 9px; outline: none;
}
.assets-search:focus { border-color: var(--accent); }
.assets-type-select {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 5px; font-size: 11px; padding: 5px 6px;
  cursor: pointer; outline: none;
}
.embed-tool {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.embed-input {
  width: 100%; resize: vertical; min-height: 54px; max-height: 130px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 5px;
  color: var(--text); font-size: 11px; line-height: 1.35; padding: 7px 9px;
  outline: none;
}
.embed-input:focus { border-color: var(--accent); }
.embed-insert-btn {
  align-self: stretch;
  justify-content: center;
}
.assets-grid {
  display: flex; flex-direction: column;
  gap: 12px; padding: 8px;
  overflow-y: auto; flex: 1; min-height: 0;
}
.asset-section {
  display: flex; flex-direction: column; gap: 6px;
}
.asset-section-head {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--text); font-size: 10px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0 2px;
}
.asset-section-count {
  color: var(--muted); font-size: 10px; font-weight: 600;
}
.asset-section-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.asset-card {
  border: 1px solid var(--border); border-radius: 6px;
  background: rgba(255,255,255,0.04); overflow: hidden;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
  display: flex; flex-direction: column;
}
.asset-card:hover { border-color: var(--accent2); background: rgba(180,255,0,0.06); }
.asset-card-no-embed {
  cursor: default;
  opacity: 0.72;
}
.asset-card-no-embed:hover {
  border-color: var(--border);
  background: rgba(255,255,255,0.04);
}
.asset-thumb {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  background: var(--surface3); display: block;
  background-size: cover; background-position: center;
}
.asset-thumb-icon {
  width: 100%; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface3); font-size: 16px; font-weight: 800;
  color: var(--muted); letter-spacing: 0.05em;
}
.asset-name {
  font-size: 10px; color: var(--muted); padding: 4px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.asset-meta {
  font-size: 9px; color: rgba(255,255,255,0.35); padding: 0 6px 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.asset-insert-btn {
  margin: 0 6px 6px;
  border: 1px solid rgba(180,255,0,0.32);
  border-radius: 5px;
  background: rgba(180,255,0,0.08);
  color: var(--fae-color2);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 6px;
  cursor: pointer;
}
.asset-insert-btn:hover {
  background: rgba(180,255,0,0.14);
}
.assets-empty,
.assets-loading {
  text-align: center; color: var(--muted); font-size: 12px;
  padding: 32px 12px; width: 100%;
}

/* ── File tree rows ──────────────────────────────────────────────────────── */
.files-list { display: flex; flex-direction: column; gap: 4px; }

.tree-row {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid transparent; border-radius: 2px;
  background: transparent;
  padding: 4px 8px; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: default;
}
.tree-row:hover { background: rgba(255,255,255,0.06); }

.tree-row.file-row { cursor: pointer; }
.tree-row.file-row.active {
  background: rgba(180,255,0,0.08);
  border-color: rgba(180,255,0,0.3);
}
.tree-row.folder-row { cursor: pointer; font-weight: 600; }

.tree-chevron { width: 10px; text-align: center; color: var(--muted); flex-shrink: 0; }
.tree-icon    { opacity: 0.85; width: 14px; text-align: center; }
.tree-name    { overflow: hidden; text-overflow: ellipsis; }

/* ── User list ───────────────────────────────────────────────────────────── */
.users-list { display: flex; flex-direction: column; gap: 4px; }
.user-item {
  border: 1px solid var(--border); border-radius: 6px;
  background: rgba(255,255,255,0.04); backdrop-filter: blur(8px);
  padding: 6px 10px; font-size: 12px;
  cursor: default; display: flex; align-items: center; gap: 7px;
}
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ── Chat section ────────────────────────────────────────────────────────── */
.chat {
  display: flex; flex-direction: column;
  min-height: 0; flex: 1; padding: 12px;
}
.chat-box {
  flex: 1; min-height: 0; overflow: auto;
  display: flex; flex-direction: column; gap: 6px; padding-right: 4px;
}
.chat-line {
  border-left: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04); backdrop-filter: blur(8px);
  border-radius: 6px; padding: 6px 10px;
  font-size: 11px; line-height: 1.35; word-break: break-word;
}
.chat-system { color: var(--muted); font-size: 11px; }
.chat-row { display: flex; gap: 6px; margin-top: 8px; }
.chat-input {
  flex: 1; border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px;
  background: rgba(255,255,255,0.05); backdrop-filter: blur(8px);
  color: var(--text); font-size: 12px; outline: none;
  transition: border-color 0.15s;
}
.chat-input:focus { border-color: rgba(180,255,0,0.4); }

/* ── Console panel (inside preview pane) ─────────────────────────────────── */
.console-panel {
  background: #18181a; color: #e0e0e0;
  font-family: 'Cascadia Code', Consolas, monospace;
  font-size: 12px;
  border-top: 1px solid var(--border);
  max-height: 180px; min-height: 60px;
  overflow: hidden;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.console-panel-head {
  background: #23232a; color: #b6b6b6;
  font-size: 12px; padding: 4px 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.console-panel-body {
  flex: 1; overflow-y: auto;
  padding: 7px 10px; background: #18181a;
}
.console-log   { color: #b6e3a6; }
.console-error { color: #ffb3b3; }
.console-warn  { color: #ffe9a6; }
.console-info  { color: #a6d6ff; }
.console-debug { color: #b3a6ff; }
