/* css/bottom-nav.css — the floating glass bottom nav: Lixa | Workspace.
   A rounded glass pill with the same 10px margin and radius as the top navbar, floating over the page
   (no bar behind it): pages keep room for it with body padding, so their last line never hides under it. */

:root {
  --bottom-nav-pill: 60px;                                     /* the pill itself */
  --bottom-nav-gap: 10px;                                      /* its margin, like the top navbar */
  --bottom-nav-h: calc(var(--bottom-nav-pill) + var(--bottom-nav-gap) * 2 + env(safe-area-inset-bottom));
}

body.has-bottom-nav {
  padding-bottom: var(--bottom-nav-h);
}

/* The class selector below beats the UA [hidden] default (author styles
   always win over UA styles regardless of source order), so nav.hidden alone
   wouldn't actually hide it — this reasserts it explicitly. */
.app-bottom-nav[hidden] { display: none !important; }

.back-btn[hidden] { display: none !important; }

/* (2026-11-06) No bottom bar while the Lixa Agent screen is showing; it returns when she is minimised or closed */
body.lxa-open .app-bottom-nav { display: none !important; }

.app-bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  /* a compact pill, narrower than the top navbar */
  width: min(272px, calc(100% - var(--bottom-nav-gap) * 2));
  bottom: calc(var(--bottom-nav-gap) + env(safe-area-inset-bottom));
  z-index: 900;
  display: flex;
  align-items: stretch;
  justify-content: center;
  height: var(--bottom-nav-pill);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.55);
  /* a clear lift, so the pill stays obvious over whatever scrolls beneath it */
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2), 0 3px 8px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.app-bottom-nav-inner {
  width: 100%;
  display: flex;
  align-items: stretch;
  padding: 5px;
  gap: 4px;
}

.bottom-nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  background: transparent;
  border: none;
  border-radius: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  transition: color 0.2s ease, background 0.2s ease;
  position: relative;
}

.bottom-nav-tab svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  transition: transform 0.2s ease;
}

.bottom-nav-tab:hover { color: var(--accent); }

.bottom-nav-tab.active {
  color: var(--accent);
  background: rgba(0, 150, 136, 0.12);
}

.bottom-nav-tab.active svg { transform: translateY(-1px); }

[data-theme="dark"] .app-bottom-nav {
  background: rgba(22, 30, 36, 0.62);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 3px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .bottom-nav-tab.active { background: rgba(77, 182, 172, 0.16); }

/* Lixa: the message box floats just above the nav, a little wider than it, on a clear background. */
/* Lixa: the message box keeps its own width (ask.css) and floats above the nav as glass, on a clear background */
body.has-bottom-nav[data-route="lixa"] .chat-input-area { background: transparent; }

/* (2026-11-06) Lixa: the message box and the nav truly float OVER the conversation.
   No strip is kept for them at the bottom: the chat runs to the screen's edge and
   scrolls beneath both; its last message can still scroll clear of them, because the
   chat keeps bottom room equal to the box (--composer-h, measured by js/bottom-nav.js)
   plus the nav. */
body.has-bottom-nav[data-route="lixa"] { padding-bottom: 0; }
body.has-bottom-nav[data-route="lixa"] .ask-container { position: relative; }
body.has-bottom-nav[data-route="lixa"] .chat-input-area {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--bottom-nav-h);
  margin: 0;
  padding: 0.15rem 0.6rem 0.2rem;      /* (2026-11-10) tight: the box itself, not a tall strip */
  z-index: 5;
  pointer-events: none;            /* the clear margin around the box lets taps reach the chat */
}
body.has-bottom-nav[data-route="lixa"] .chat-input-area > * { pointer-events: auto; }
/* (2026-11-09) one frosted-glass panel across the bottom of the screen, behind the message box and the bar: the
   chat sliding under them turns to frosted glass. It fades in over its top 28px (mask), so there is no hard edge. */
body.has-bottom-nav[data-route="lixa"] .ask-container::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--composer-h, 96px) + var(--bottom-nav-h) + 56px);
  z-index: 4;                       /* above the chat, below the message box (5) and the bar (900) */
  pointer-events: none;
  background: rgba(245, 247, 249, 0.14);                      /* (browsers without color-mix) */
  background: color-mix(in srgb, var(--bg-page) 14%, transparent);
  /* (2026-11-10) a light blur that fades as it rises: none at the top edge, full only at the bottom */
  backdrop-filter: blur(7px) saturate(120%);
  -webkit-backdrop-filter: blur(7px) saturate(120%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, rgba(0,0,0,0.35) 45%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0, rgba(0,0,0,0.35) 45%, #000 100%);
}
body.has-bottom-nav[data-route="lixa"] .chat-messages {
  padding-bottom: calc(var(--composer-h, 96px) + var(--bottom-nav-h) + 16px);
  scroll-padding-bottom: calc(var(--composer-h, 96px) + var(--bottom-nav-h) + 16px);
}
body.has-bottom-nav[data-route="lixa"] .composer {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.12);
}
[data-theme="dark"] body.has-bottom-nav[data-route="lixa"] .composer,
body.has-bottom-nav[data-route="lixa"][data-theme="dark"] .composer {
  background: rgba(30, 42, 50, 0.72);
  border-color: rgba(255, 255, 255, 0.08);
}
