/*
  Global CSS contract:
  - Keep only tokens, reset, base element rules, and true app-wide primitives here.
  - Do not add page-specific or feature-specific selectors to this file.
  - Owning layout, shared component, or page component styles belong in `.razor.css`.
  - See `docs/architecture/frontend-css-ownership-plan.md`.
*/

:root {
  color-scheme: dark;
  --app-page-bg: #0f0f11;
  --app-header-height: 40px;
  --sidebar-width: 260px;
  --sidebar-resizer-width: 4px;
  --details-sidebar-width: 316px;
  --radius: 3px;
  --radius-circle: 999px;
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-border-soft: rgba(255, 255, 255, 0.05);
  --text: rgba(255, 255, 255, 0.95);
  --muted: rgba(255, 255, 255, 0.68);
  --muted-soft: rgba(255, 255, 255, 0.48);
  --header-gray: #b81d1d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  overflow: hidden;
  background: var(--app-page-bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

code,
pre {
  font-family: var(--font-mono);
}

.u-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.workspace-surface-view {
  min-height: 0;
  flex: 1;
  overflow: auto;
  background: var(--app-page-bg);
}

.workspace-empty-state {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 280px;
  padding: 32px 24px;
  text-align: center;
}

.workspace-empty-state h2,
.workspace-empty-state p {
  margin: 0;
}

.workspace-empty-state h2 {
  color: rgba(255, 255, 255, 0.88);
  font-size: 19px;
  font-weight: 600;
}

.workspace-empty-state p {
  max-width: 420px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 14px;
  line-height: 1.5;
}

.workspace-empty-state-error p {
  color: #f0a2a2;
}

.workspace-empty-state-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: #b81d1d;
  color: #fff4f4;
  font-size: 13px;
  font-weight: 600;
}

.workspace-loading-state {
  display: flex !important;
  flex: 1 1 auto;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 14px !important;
  width: 100%;
  min-height: max(100%, 280px);
  text-align: center !important;
  align-self: stretch;
  justify-self: stretch;
}

.workspace-loading-state::before {
  content: "";
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(255, 255, 255, 0.92);
  border-right-color: rgba(255, 255, 255, 0.42);
  border-radius: var(--radius-circle);
  animation: workspace-loading-spin 0.8s linear infinite;
}

.workspace-loading-state p {
  max-width: 420px;
}

@keyframes workspace-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }
}
