/*
 * Omni Brzy — global tokens + pre-React shell (Uber Base light theme).
 * White surfaces, near-black ink, one blue accent. These tokens also colour
 * the loader before React/MUI mounts, so there is no theme flash.
 * (Class names keep the legacy cop- prefix because components reference them;
 * the visuals are the calm light language of DESIGN.md.)
 */
:root {
  --omni-accent: #276ef1;
  --omni-ink: #000000;
  --omni-bg: #ffffff;
  --omni-panel: #ffffff;
  --omni-subtle: #f6f6f6;
  --omni-border: #e2e2e2;
  --omni-text: #141414;
  --omni-muted: #6b6b6b;
  --omni-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  /* White from the first paint — light-only theme, no dark flash. */
  background: var(--omni-bg);
  color: var(--omni-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.root {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Light scrollbars for the document shell (MUI CssBaseline themes in-app ones). */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--omni-border);
  border-radius: 8px;
  border: 2px solid var(--omni-bg);
}

/* Device-callout (StatusCard) motion — calm 150–250ms fades only. */
@keyframes omni-pop {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.cop-pop { animation: omni-pop 180ms ease-out both; }
/* Legacy breathe/pulse hooks — the light theme does not pulse or glow. */
.cop-breathe { animation: none; }
.cop-live { animation: none; }

/* ============================================================
   Sign-in reveal — a plain white cover that fades out (no shockwave,
   no ring). Mounted by LoginReveal; self-removes on animation end.
   ============================================================ */
.cop-reveal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  background-color: var(--omni-bg);
  animation: omni-reveal-fade 250ms ease-out 100ms forwards;
}
.cop-reveal-ring {
  display: none;
}
@keyframes omni-reveal-fade {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cop-pop, .cop-breathe, .cop-live { animation: none !important; }
  .cop-reveal { animation: omni-reveal-fade 150ms linear forwards; }
}

/* Legacy notched-corner hooks — notches are dead in this theme; the classes
   remain only so existing markup renders as plain (rounded-by-component)
   boxes. Do not add new uses. */
.cop-notch,
.cop-notch-sm,
.cop-notch-xs {
  clip-path: none;
}

@media print {
  * {
    height: auto !important;
    overflow: visible !important;
  }
}

/* ============================================================
   Map controls (MapLibre): white groups, soft shadow, dark glyphs,
   blue focus — Uber-style floating controls on a light map.
   ============================================================ */
/* Floating map controls at the mobile app's scale: white circles / vertical
   pills (a stacked zoom group reads as a pill), 44px targets, soft shadow. */
.maplibregl-map .maplibregl-ctrl-group {
  background: var(--omni-panel);
  border: none;
  border-radius: 22px;
  box-shadow: var(--omni-shadow);
  overflow: hidden;
}
.maplibregl-map .maplibregl-ctrl-group button {
  width: 44px;
  height: 44px;
}
/* Desktop: the notification bell is fixed in the viewport's top-right corner, so
   push the map's top-right controls (zoom/compass) down to clear it. */
@media (min-width: 900px) {
  .maplibregl-map .maplibregl-ctrl-top-right {
    margin-top: 44px;
  }
}

.maplibregl-map .maplibregl-ctrl-group button {
  background-color: transparent;
  color: var(--omni-text);
}
.maplibregl-map .maplibregl-ctrl-group button + button {
  border-top: 1px solid var(--omni-border);
}
.maplibregl-map .maplibregl-ctrl-group button:not(:disabled):hover {
  background-color: var(--omni-subtle);
}
.maplibregl-map .maplibregl-ctrl-group button:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--omni-accent);
}
.maplibregl-map .maplibregl-ctrl-group button:disabled {
  opacity: 0.4;
}

/* mapbox-gl-draw on MapLibre: the plugin's stock cursor rules target
   mapboxgl-* classes that never exist here, so re-scope them; and the draw
   plugin's (button-less, toolbar-driven) control group must not render
   as a stray empty box. */
.maplibregl-map.mouse-add .maplibregl-canvas-container {
  cursor: crosshair;
}
.maplibregl-map.mouse-pointer .maplibregl-canvas-container {
  cursor: pointer;
}
.maplibregl-map.mouse-move .maplibregl-canvas-container {
  cursor: move;
}
.maplibregl-map .maplibregl-ctrl-group:empty {
  display: none;
}

/* Attribution pill + scale bar → white, muted text. */
.maplibregl-map .maplibregl-ctrl-attrib.maplibregl-ctrl-attrib {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 0 8px;
}
.maplibregl-map .maplibregl-ctrl-attrib a,
.maplibregl-map .maplibregl-ctrl-attrib {
  color: var(--omni-muted);
}
.maplibregl-map .maplibregl-ctrl-scale {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--omni-border);
  border-top: none;
  color: var(--omni-text);
}

/* Geofence name popup — revealed on click or after a search fly-to.
   Plain white card, soft shadow, sentence case. */
.maplibregl-map .geofence-name-popup .maplibregl-popup-content {
  background: var(--omni-panel);
  border: none;
  border-radius: 8px;
  padding: 6px 26px 6px 12px;
  color: var(--omni-text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--omni-shadow);
}
.maplibregl-map .geofence-name-popup .maplibregl-popup-tip {
  display: none;
}
.maplibregl-map .geofence-name-popup .maplibregl-popup-close-button {
  color: var(--omni-muted);
  font-size: 15px;
  padding: 0 6px;
}
.maplibregl-map .geofence-name-popup .maplibregl-popup-close-button:hover {
  background: transparent;
  color: var(--omni-text);
}
