/*
  top-menu.css: styles for the shared TopMenu component.
  Canonical copy lives in AI-DEMO-Standalone/shared/top-menu/. Each app vendors an
  identical copy into web/src/top-menu/ (check with scripts/check-top-menu.sh).
  Colours come only from the standalone-ui.css tokens. Layout only, no new colours.
*/

/* All controls in the bar are one uniform height. */
.top-menu__ctl,
.top-menu button,
.top-menu select,
.top-menu a.top-menu__shelf {
  height: 32px;
  box-sizing: border-box;
}

.top-menu__ctl {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  /* Same theme-aware text as the control fill: dark on light, white on dark (owner, 2026-11-13). */
  color: var(--text);
}

/* Inside the standard shell-bar the background is --box-dark in BOTH themes, so the
   theme-aware --text above is dark-on-dark in the light theme. Labels there use --on-box. */
.shell-bar .top-menu__ctl {
  color: var(--on-box);
}

.top-menu button,
.top-menu select,
.top-menu a.top-menu__shelf {
  font: inherit;
  font-size: 0.85rem;
  padding: 0 0.7rem;
  border-radius: 8px;
  /* Filled control + strong border so the controls read on any header, light or dark (owner, 2026-11-13).
     Light: pale fill, near-black border and text. Dark: dark fill, white border and text. */
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.top-menu button:hover,
.top-menu select:hover,
.top-menu a.top-menu__shelf:hover {
  border-color: var(--text);
  filter: brightness(1.08);
}

/* Shelf stands out: Ping-red (fixed brand red, NOT the lab's remapped --accent), with the arrow from ::after */
.top-menu {
  /* Ping red comes from the family tokens in standalone-ui.css (--accent/--accent-deep/--on-accent);
     literals here would fail the labs' CSS-standard tests, which scan this vendored file. */
}
.top-menu a.top-menu__shelf--accent {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent-deep);
  font-weight: 700;
}

.top-menu a.top-menu__shelf--accent:hover {
  background: var(--accent-deep);
  border-color: var(--on-accent);
}

.top-menu a.top-menu__shelf--accent::after { content: " \2197"; }
.top-menu a.top-menu__shelf--accent,
.top-menu a.shelf-link { vertical-align: middle; align-self: center; }

.top-menu button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.top-menu button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.top-menu select {
  color: var(--text);
  background: var(--surface);
}

.top-menu .top-menu__theme select {
  min-width: 5.5rem;
}

/* Mock/Real stands out: accent-filled select. */
.top-menu select.top-menu__mode {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent-deep, var(--accent));
  font-weight: 700;
}

.top-menu select.top-menu__mode:hover {
  border-color: var(--on-accent);
}

.top-menu select.top-menu__mode option {
  color: var(--text);
  background: var(--surface);
}

/* The one primary in the bar: Sign in. */
.top-menu button.top-menu__signin {
  background: var(--accent-gradient);
  color: var(--on-accent);
  border-color: transparent;
  font-weight: 600;
}

/* Lab-specific controls ride the same bar with the same chrome. */
.top-menu .top-menu__extra {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Owner-approved layout (2026-11-11): three right-aligned rows; the app's shell-bar
   keeps brand + nav on the top line at the left. */
.top-menu {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
  padding-left: 1rem;
}

.top-menu__row {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Sign in stands alone: centered on the bar's top line. The slot is absolutely
   positioned to the nearest positioned ancestor, so the app's shell-bar must set
   `position: relative`. The slot renders first in DOM, positions independently. */
.top-menu__signin-slot {
  position: absolute;
  left: 50%;
  top: 0.65rem;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Lab-provided ShelfLink (children) gets the same fixed Ping-red as the built-in Shelf link.
   Placed under .top-menu/.shell-bar scopes so the --ping-red vars resolve. */
.top-menu a.shelf-link,
.shell-bar a.shelf-link {
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent-deep);
  font-weight: 700;
}
.top-menu a.shelf-link::after,
.shell-bar a.shelf-link::after { content: " \2197"; }
.top-menu a.shelf-link:hover,
.shell-bar a.shelf-link:hover { background: var(--accent-deep); border-color: var(--on-accent); }
