/* VSCode-style shell */

.hecate-shell {
  position: relative;
  display: grid;
  grid-template-rows: 1fr 24px;
  height: 100vh;
  overflow: hidden;
  background: var(--bg0);
}

/* The overlay-titlebar strip is macOS-only. Linux/Windows render
   the UpdateBanner inside .hecate-content instead — see
   AppShell.tsx's hasOverlayTitlebar gate — so we don't reserve the
   28-px top inset on those platforms. */
html[data-tauri-os="macos"] .hecate-shell {
  padding-top: 28px;
}

.hecate-titlebar {
  display: flex;
  align-items: center;
  position: absolute;
  inset: 0 0 auto 0;
  height: 28px;
  z-index: 1000;
  /* Leave room for the native traffic-light cluster on the left. */
  padding: 0 12px 0 76px;
  /* Native titlebars don't select-on-drag; matching that prevents
     the cursor from leaving a highlight smear while dragging the
     window from over text content. */
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

/* Compact the update banner so it lives in the 28-px overlay
   titlebar instead of stealing a row below it. The base .page-banner
   styling assumes a full-width below-titlebar slot; here we strip
   the border/background and shrink to fit. */
.hecate-titlebar .page-banner {
  flex: 1;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 11px;
  font-family: var(--font-sans);
}

.hecate-titlebar .page-banner--update {
  color: var(--t1);
}

.hecate-titlebar .page-banner .btn {
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.2;
}

.hecate-workarea {
  display: grid;
  grid-template-columns: 48px 1fr;
  overflow: hidden;
  min-height: 0;
}

/* Activity bar */
.hecate-activitybar {
  background: var(--bg1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8px;
  gap: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.hecate-activitybtn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--t3);
  cursor: pointer;
  transition:
    color 0.1s,
    background 0.1s;
  padding: 0;
}

.hecate-activitybtn:hover {
  color: var(--t1);
  background: var(--bg3);
}

.hecate-activitybtn--active {
  color: var(--teal);
  background: var(--teal-bg);
}

/* Main content area */
.hecate-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: var(--bg0);
}

.console-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.console-content--bare {
  padding: 0;
  overflow: hidden;
}

.workspace-fallback {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.workspace-fallback__label {
  color: var(--t3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Status bar dots — use -lo variants for contrast against --teal background */
.hecate-statusbar .dot-green {
  background: var(--green-lo);
  box-shadow: 0 0 5px var(--green-lo);
}
.hecate-statusbar .dot-red {
  background: var(--red-lo);
  box-shadow: 0 0 5px var(--red-lo);
}
.hecate-statusbar .dot-amber {
  background: var(--amber-lo);
  box-shadow: 0 0 5px var(--amber-lo);
}
.hecate-statusbar .dot-muted {
  background: var(--teal-lo);
}

/* Status bar */
.hecate-statusbar {
  background: var(--teal);
  color: var(--accent-fg);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 14px;
  font-size: 11px;
  font-family: var(--font-mono);
  flex-shrink: 0;
  /* user-select left at the default `text` so the version,
     workspace path, model count, etc. can be copied — these
     are the values a user typically pastes into a bug report. */
  min-width: 0;
}

.hecate-statusbar__brand {
  font-weight: 600;
}

.hecate-statusbar__sep {
  opacity: 0.5;
}

.hecate-statusbar__path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Persistent error banner (fatal/connection errors only) */
.page-banner {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 6px 12px;
  border-bottom: 1px solid;
  font-size: 12px;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.page-banner--error {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red);
}

.page-banner--update {
  border-color: var(--border);
  background: var(--bg2);
  color: var(--t1);
  align-items: center;
}

.page-banner--update .page-banner__actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.page-banner__progress-text {
  color: var(--t2);
  margin-left: 4px;
}

.page-banner__progress {
  width: 120px;
  height: 4px;
  appearance: none;
  border: none;
  border-radius: 2px;
  overflow: hidden;
  background: var(--bg3);
}

.page-banner__progress::-webkit-progress-bar {
  background: var(--bg3);
}

.page-banner__progress::-webkit-progress-value {
  background: var(--teal);
  transition: width 100ms linear;
}

.page-banner__progress::-moz-progress-bar {
  background: var(--teal);
}

/* Toast notifications */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid;
  font-size: 12px;
  font-family: var(--font-mono);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: all;
  animation: toast-in 0.15s ease;
}

.toast--success {
  border-color: var(--green-border);
  background: var(--bg1);
  color: var(--green);
}

.toast--error {
  border-color: var(--red-border);
  background: var(--bg1);
  color: var(--red);
}

.toast__dismiss {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  opacity: 0.6;
  font-size: 10px;
  line-height: 1;
}

.toast__dismiss:hover {
  opacity: 1;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Error boundary */
.error-boundary__surface {
  margin-top: 2rem;
  padding: 2rem;
  color: var(--t0);
}
