/*
  Anubis shared theme — used by Core and Edge (Master monorepo).

  Path: shared/theme/static/anubis_theme/css/theme.css
  Load with: {% static 'anubis_theme/css/theme.css' %}
  Prefer including templates/anubis_theme/theme_head.html for fonts + this file.

  Type is Inter for headings and body; accent stays Anubis cyan.
*/

/* Light theme (default for auto when device prefers light) */
:root {
  --bg-dark: #f5f5f5;
  --bg-card: #ffffff;
  --border: #dee2e6;
  --accent: #0891b2;
  --accent-dim: #0e7490;
  --text: #1a1a1a;
  --text-muted: #6c757d;
  --danger: #c75c5c;
  --warn: #ffc107;
  --ok: #198754;
  --font-display: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 6px;
}

/* Auto: follow device preference */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg-dark: #0d0d0d;
    --bg-card: #1a1a1a;
    --border: #2a2a2a;
    --accent: #22d3ee;
    --accent-dim: #0891b2;
    --text: #e8e6e3;
    --text-muted: #888;
  }
}

/* Explicit dark theme */
html[data-theme="dark"] {
  --bg-dark: #0d0d0d;
  --bg-card: #1a1a1a;
  --border: #2a2a2a;
  --accent: #22d3ee;
  --accent-dim: #0891b2;
  --text: #e8e6e3;
  --text-muted: #888;
}

/* Explicit light theme */
html[data-theme="light"] {
  --bg-dark: #f5f5f5;
  --bg-card: #ffffff;
  --border: #dee2e6;
  --accent: #0891b2;
  --accent-dim: #0e7490;
  --text: #1a1a1a;
  --text-muted: #6c757d;
}

html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
html[data-theme="auto"] { color-scheme: light dark; }

/* Theme toggle (browser-local preference) */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle-icon {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  box-shadow: inset -0.28rem 0 0 0 currentColor;
  flex-shrink: 0;
}

.theme-toggle[data-theme-current="light"] .theme-toggle-icon {
  box-shadow: none;
  background: currentColor;
}

.theme-toggle[data-theme-current="auto"] .theme-toggle-icon {
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
  box-shadow: none;
}

.theme-toggle-float {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1200;
}

/* Foundational type + links (apps may override layout) */
.anubis-theme-body,
body.anubis-theme {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-dark);
  color: var(--text);
  font-family: var(--font-body);
}

.anubis-theme-body h1,
.anubis-theme-body h2,
body.anubis-theme h1,
body.anubis-theme h2 {
  font-family: var(--font-display);
  font-weight: 600;
}

.anubis-theme-body a,
body.anubis-theme a {
  color: var(--accent);
  text-decoration: none;
}

.anubis-theme-body a:hover,
body.anubis-theme a:hover {
  color: var(--accent-dim);
  text-decoration: underline;
}

/* Shared surface helpers */
.anubis-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.anubis-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #0d0d0d;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: inherit;
  cursor: pointer;
  text-decoration: none;
}

.anubis-btn:hover {
  background: var(--accent-dim);
  color: var(--text);
  text-decoration: none;
}

.anubis-btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.anubis-btn-ghost:hover {
  background: var(--border);
  color: var(--text);
}

.anubis-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.anubis-badge.ready,
.anubis-badge.open {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(34, 211, 238, 0.1);
}

.anubis-badge.provisioning,
.anubis-badge.in_progress {
  color: var(--warn);
  border-color: var(--warn);
  background: rgba(255, 193, 7, 0.1);
}

.anubis-badge.disabled,
.anubis-badge.closed {
  color: var(--text-muted);
}

.anubis-alert {
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.anubis-alert-success {
  background: rgba(34, 211, 238, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.anubis-alert-error,
.anubis-alert-danger {
  background: rgba(199, 92, 92, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}

.anubis-alert-warning {
  background: rgba(255, 193, 7, 0.1);
  border-color: var(--warn);
  color: var(--warn);
}

.anubis-muted {
  color: var(--text-muted);
}

.anubis-mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  word-break: break-all;
}
