/* topbar.css — the top bar: site name, the four section tabs (Explore · Trips · Watching ·
   On board) and the Log in / Account button. Everything that used to sit at the top of the
   map moves down below it. Phone sizes are in mobile.css. */
:root { --bar-h: 56px; --topbar-h: var(--bar-h); } /* --topbar-h grows while the update banner shows (updates.css) */
.topbar {
  position: fixed; z-index: 1046; left: 0; right: 0; top: 0;
  height: calc(var(--bar-h) + env(safe-area-inset-top, 0px)); box-sizing: border-box;
  padding: env(safe-area-inset-top, 0px) 12px 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px;
  background: var(--panel); border-bottom: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
a.tb-brand, a.tb-brand:visited { color: var(--text); text-decoration: none; }
.tb-brand { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; font-size: 15px; white-space: nowrap; }
.tb-brand svg { width: 22px; height: 22px; flex: none; fill: var(--accent); }
.tb-brand span { overflow: hidden; text-overflow: ellipsis; }
.tb-right { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }

/* The section tabs sit in the bar instead of floating over the map */
.topbar .mode-tabs { position: static; transform: none; box-shadow: none; background: var(--night); -webkit-backdrop-filter: none; backdrop-filter: none; }
.topbar .mode-tabs button { padding: 8px 16px; font-size: 13.5px; }

/* Log in / Account: a pill in the bar */
.topbar .acct-btn { position: static; display: inline-flex; align-items: center; flex-direction: row; width: auto; height: 40px; padding: 0 14px 0 10px; gap: 7px; border-radius: 20px; box-shadow: none; }
.topbar .acct-btn svg { display: block; flex: none; width: 20px; height: 20px; }
.topbar .acct-btn span { font-size: 13px; line-height: 1; color: var(--text); }
.acct-pop { position: fixed; top: calc(var(--topbar-h) + 8px + env(safe-area-inset-top, 0px)); right: 12px; }

/* Hidden while a shared "Meet a flight" link or a window / cockpit view is open */
body.meet-mode .topbar, body.wv-open .topbar { display: none; }

/* Everything that was at the top of the map now starts below the bar */
#controls, .trips-panel, #onboard, .notam-panel { top: calc(var(--topbar-h) + 12px + env(safe-area-inset-top, 0px)); }
.map-toolbar { top: calc(var(--topbar-h) + 12px + env(safe-area-inset-top, 0px)); }
.topbar .acct-btn[aria-expanded="true"] span { color: var(--night); }
/* Trips tab count: unread flight updates + immigration forms to complete (js/trips/today.js) */
.tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: #FFB05C; color: var(--night); font-size: 11px; font-weight: 700; vertical-align: 1px; }
.tab-badge[hidden] { display: none; }

/* "Travel Calendar" becomes "Calendar" on narrow phones */
@media (max-width: 480px) { .tb-long { display: none; } }

/* On the plane's Wi-Fi (js/onboard/airline-wifi.js): airline logo + name in the bar */
.tb-wifi { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 6px; border-radius: 20px; text-decoration: none; color: var(--text);
  background: rgba(127, 224, 181, 0.12); border: 1px solid rgba(127, 224, 181, 0.55); white-space: nowrap; }
.tb-wifi:hover, .tb-wifi:focus-visible { background: rgba(127, 224, 181, 0.2); }
.tb-wifi-logo { display: inline-flex; align-items: center; justify-content: center; height: 28px; min-width: 28px; padding: 0 6px; border-radius: 14px; background: #fff; }
.tb-wifi-logo img { display: block; height: 18px; width: auto; }
.tb-wifi-txt { display: inline-flex; flex-direction: column; line-height: 1.1; }
.tb-wifi-txt b { font-size: 12.5px; }
.tb-wifi-txt small { font-size: 11px; color: var(--muted); }
.tb-wifi-ic { width: 18px; height: 18px; fill: none; stroke: #7FE0B5; stroke-width: 2; stroke-linecap: round; }
.tb-wifi-ic circle { fill: #7FE0B5; stroke: none; }
@media (max-width: 700px) { .tb-wifi-txt, .tb-wifi-ic { display: none; } .tb-wifi { padding: 0 6px; } }

/* Icons sit closer together (the hover circle stays round) */
.tb-right .tb-icon { width: 36px; height: 36px; }
.tb-right .tb-icon + .tb-icon { margin-left: -6px; }

/* Tooltips for the bar (js/core/tooltip.js): a small card under the item, with an arrow */
.tb-tip {
  position: fixed; z-index: 3000; max-width: 260px; padding: 7px 11px 8px; border-radius: 10px; pointer-events: none;
  background: #E8EEF7; color: #142235; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  font: 12px/1.4 var(--font); opacity: 0; transform: translateY(-3px); transition: opacity 0.12s ease, transform 0.12s ease;
}
.tb-tip.on { opacity: 1; transform: none; }
.tb-tip[hidden] { display: none; }
.tb-tip::before { content: ""; position: absolute; top: -5px; left: calc(var(--ax, 50%) - 5px); width: 10px; height: 10px; background: inherit; transform: rotate(45deg); border-radius: 2px; }
.tb-tip b { display: block; font-size: 12.5px; font-weight: 700; }
.tb-tip span { display: block; color: #4A5A70; }
.tb-tip.one span { color: inherit; }
@media (prefers-reduced-motion: reduce) { .tb-tip { transition: none; transform: none; } }

/* Eight sections: on narrower computer screens the tabs get shorter ("Calendar", "FAA"), the bar gives the site name
   only what's left (the tabs and the icons on the right always show), and the name becomes just the plane. */
@media (max-width: 1360px) { .topbar .tb-long { display: none; } }
@media (max-width: 1200px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto auto; }
  .topbar nav.mode-tabs a, .topbar nav.mode-tabs button { padding-left: 11px; padding-right: 11px; }
}
@media (min-width: 761px) and (max-width: 940px) {
  .topbar .tb-brand span { display: none; }
  .topbar nav.mode-tabs a, .topbar nav.mode-tabs button { padding-left: 8px; padding-right: 8px; font-size: 12.5px; }
  .topbar .tb-right { gap: 4px; }
  .topbar .tb-icon { width: 34px; }
}
