/**
 * Dev / Local Environment Indicator
 * ==================================
 * Only loaded when envMode is 'local' or 'dev'.
 * Provides a fixed top banner, body offset, and nav pill to distinguish
 * non-production environments from production.
 *
 * Two modes:
 *   .local-mode — gray palette, "Local Environment"
 *   .dev-mode   — amber palette, "Development Environment"
 */

/* ── Banner (shared structure) ────────────────── */
.env-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  z-index: 9999; /* Above page content, below modals (10000) and toasts (10001) */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  font-family: var(--font-family-body, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

.env-banner__icon {
  display: flex;
  align-items: center;
  opacity: 0.9;
}

.env-banner__icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.env-banner__text {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.8px;
}

/* ── Banner colors per mode ───────────────────── */
.dev-mode .env-banner {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-bottom: 1px solid #b45309;
}

.local-mode .env-banner {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  border-bottom: 1px solid #374151;
}

/* ── Body offset (shared) ─────────────────────── */
body.dev-mode,
body.local-mode {
  padding-top: 32px;
}

/* Adjust fixed sidebar */
body.dev-mode .sidebar,
body.local-mode .sidebar {
  top: 32px;
}

/* Adjust sticky header */
body.dev-mode .header,
body.local-mode .header {
  top: 32px;
}

/* Adjust ghost-mode overlays when both are active */
body.dev-mode .ghost-mode-frame,
body.local-mode .ghost-mode-frame {
  top: 32px;
}

body.dev-mode .ghost-mode-indicator,
body.local-mode .ghost-mode-indicator {
  top: 32px;
}

/* Shift toast container below the env banner */
body.dev-mode .toast-container,
body.local-mode .toast-container,
body.dev-mode #toast-container,
body.local-mode #toast-container {
  top: calc(var(--toast-container-top, var(--space-4, 16px)) + 32px);
}

/* ── Nav pill (shared structure) ──────────────── */
.env-nav-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

/* When sidebar is collapsed, shrink the pill */
html.sidebar-collapsed .env-nav-pill {
  padding: 2px 4px;
  font-size: 8px;
}

/* ── Nav pill colors per mode ─────────────────── */
.env-nav-pill--dev {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-amber-600, #d97706);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.env-nav-pill--local {
  background: rgba(107, 114, 128, 0.15);
  color: var(--color-gray-600, #4b5563);
  border: 1px solid rgba(107, 114, 128, 0.3);
}
