/* ide-project-editor.css — project-editor screen chrome and support surfaces.
 *
 * Tokens: CSS variables only. All colors via theme vars. No hardcoded hex.
 * Derived from mockup 03-top-bar-plus-compact-rail.html (project bar + sidebar ribbon)
 * and mockup 01-soft-frame.html (attach/missing/error cards).
 */

/* ── Project bar (64px above the IDE shell) ─────────────────────────────── */

.proj-editor-bar {
  height: var(--project-bar-height, 64px);
  background: color-mix(in srgb, var(--bg-secondary) 75%, var(--bg-elevated) 25%);
  border-bottom: 1px solid var(--border-strong, rgba(255,255,255,0.14));
  display: flex;
  align-items: center;
  padding: 0 24px;
  flex-shrink: 0;
  position: relative;
}

/* Left cluster: eyebrow + name + gold rule stacked vertically */
.pbar-identity {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  margin-right: 20px;
  flex-shrink: 0;
}

.pbar-eyebrow {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1;
}

.pbar-name {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

.pbar-rule {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
  opacity: 0.6;
}

/* Vertical divider between identity and chips */
.pbar-vdiv {
  width: 1px;
  height: 32px;
  background: var(--border-strong, rgba(255,255,255,0.14));
  margin-right: 20px;
  flex-shrink: 0;
}

/* Chip row */
.pbar-chips {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.pbar-chip {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.pbar-chip--branch {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  text-transform: none;
}

.pbar-chip--vis {
  color: var(--success, #4a8a5a);
  background: var(--success-subtle, rgba(74,138,90,0.12));
  border-color: color-mix(in srgb, var(--success, #4a8a5a) 40%, transparent);
}

.vis-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success, #4a8a5a);
  flex-shrink: 0;
}

/* Right cluster: action buttons + bridge pill */
.pbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pbar-btn {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.pbar-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.pbar-btn--accent {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  font-weight: 700;
}

.pbar-btn--accent:hover {
  background: var(--accent-hover);
}

.pbar-btn--ghost {
  background: transparent;
  border-color: var(--border);
}

/* Bridge status pill */
.bridge-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--success, #4a8a5a);
  padding: 3px 8px;
  background: var(--success-subtle, rgba(74,138,90,0.12));
  border: 1px solid color-mix(in srgb, var(--success, #4a8a5a) 35%, transparent);
  border-radius: 20px;
}

.bridge-pill--offline {
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-color: var(--border);
}

.bridge-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success, #4a8a5a);
}

.bridge-pill-dot--offline {
  background: var(--text-muted);
}

/* ── Sidebar: compact identity ribbon ───────────────────────────────────── */

.identity-ribbon {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-secondary) 60%, var(--bg-elevated) 40%);
}

.ribbon-cover-swatch {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent) 25%, var(--bg-elevated)) 0%,
    color-mix(in srgb, var(--success, #4a8a5a) 20%, var(--bg-secondary)) 100%
  );
  flex-shrink: 0;
  border: 1px solid var(--border-strong, rgba(255,255,255,0.14));
}

.ribbon-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ribbon-name {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}

.ribbon-branch-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ribbon-branch-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.ribbon-vis-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success, #4a8a5a);
  flex-shrink: 0;
}

/* Files section header in sidebar */
.sidebar-files-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 4px;
  flex-shrink: 0;
}

.files-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.files-rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Editor / sidebar placeholders (Tier 3 only) ────────────────────────── */

.proj-editor-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.proj-editor-placeholder--files {
  flex: 1;
  padding: 16px 12px;
  justify-content: flex-start;
  align-items: flex-start;
}

.proj-editor-placeholder--editor {
  flex: 1;
  height: 100%;
}

/* ── Support surfaces (attach / missing / error cards) ──────────────────── */

/* Outer wrapper: centres the card and limits width */
.proj-editor-support-wrap {
  width: 100%;
  max-width: 720px;
  margin: 48px auto 0;
  padding: 0 32px;
}

/* Soft card: bg-surface fill, bg-elevated border (not border-strong), no shadow */
.soft-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 28px 32px 24px;
  position: relative;
}

.soft-card-heading {
  margin-bottom: 16px;
}

.soft-card-heading h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.25;
}

/* Card body text */
.card-lede {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.72;
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: 0;
}

.card-lede code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

/* Missing-path chip: error-tinted monospace block */
.path-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: color-mix(in srgb, var(--error, #cc4444) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--error, #cc4444) 22%, transparent);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--error, #cc4444);
  margin: 18px 0;
}

/* Inline action row */
.card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

/* Footnote text below action row */
.card-footnote {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  font-family: var(--font-serif);
  font-style: italic;
}

/* Ghost button with error hover (Remove mapping) */
.btn-ghost-error {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-strong, rgba(255,255,255,0.14));
}

.btn-ghost-error:hover {
  color: var(--error, #cc4444);
  border-color: color-mix(in srgb, var(--error, #cc4444) 35%, transparent);
  background: color-mix(in srgb, var(--error, #cc4444) 10%, transparent);
}

/* ── Tier 4: files section fills sidebar below header ───────────────────── */

.proj-editor-files-section {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* ── Tier 5: tab dirty marker ────────────────────────────────────────────── */

/* Gold dot replacing the close × when a tab has unsaved changes */
.ide-tabs__dirty-dot {
  font-size: 14px;
  line-height: 1;
  color: var(--accent);
  margin-left: 5px;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity var(--transition);
}

.ide-tabs__dirty-dot:hover {
  opacity: 1;
}

/* Dirty tab: slightly desaturated label to complement the gold dot */
.ide-tabs__tab--dirty .ide-tabs__label {
  opacity: 0.85;
}

/* ── Tier 8: detail-page additions ──────────────────────────────────────── */

/* Actions row inside the detail inner frame */
.proj-detail-actions-row {
  padding: 14px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.07));
  margin-bottom: 20px;
}

/* Open-in-editor button: gold primary, disabled-look variant */
.proj-detail-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), opacity var(--transition);
  background: var(--accent);
  color: var(--bg-primary, #08080a);
}
.proj-detail-open-btn:hover { background: var(--accent-hover); }
.proj-detail-open-btn--unmapped {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border, rgba(255,255,255,0.07));
  cursor: pointer;
}
.proj-detail-open-btn--unmapped:hover {
  background: color-mix(in srgb, var(--bg-elevated) 80%, var(--bg-surface));
  color: var(--text-secondary);
}

/* Folder mapping status block */
.proj-detail-folder-block {
  background: var(--bg-surface);
  border: 1px solid var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 20px 24px 22px;
  margin-bottom: 0;
}

.proj-detail-folder-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.proj-detail-folder-rule {
  width: 28px;
  height: 1px;
  background: color-mix(in srgb, transparent 80%, var(--accent));
  margin-bottom: 14px;
}

/* Attached state */
.proj-detail-folder-attached {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.proj-detail-folder-path {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border, rgba(255,255,255,0.07));
  border-radius: var(--radius-sm);
  padding: 4px 10px;
}

.proj-detail-branch-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: 20px;
  padding: 2px 9px;
}

.proj-detail-branch-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.proj-detail-change-link {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  margin-left: auto;
  padding: 0;
  transition: color var(--transition);
}
.proj-detail-change-link:hover { color: var(--text-secondary); }

/* Detached state */
.proj-detail-folder-detached-text {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.proj-detail-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: var(--bg-primary, #08080a);
  transition: background var(--transition);
}
.proj-detail-attach-btn:hover { background: var(--accent-hover); }

/* ── Tier 6: external-change conflict banner ─────────────────────────────── */

.proj-editor-conflict-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-surface));
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.conflict-banner-msg {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conflict-banner-btn {
  flex-shrink: 0;
  font-size: 11px;
  padding: 3px 10px;
}
