/* /static/css/bottom-nav.css */
:root {
  --pb-bottom-nav-height: 64px;
}

.pb-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--pb-bottom-nav-height);
  padding-bottom: max(env(safe-area-inset-bottom), 0px);
  background: var(--theme-bg-base, #0a1628);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1200;
  display: none; /* hidden by default; JS will toggle */
  align-items: stretch;
}

body:not(.cover-active) .pb-bottom-nav {
  display: flex; /* show when not on cover */
}

.pb-bottom-nav .pb-nav-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
}

.pb-nav-btn {
  appearance: none;
  background: transparent;
  border: none;
  padding: 8px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  color: #E6EDF3;
}

.pb-nav-btn .pb-icon {
  font-size: 20px;
  line-height: 1;
}

.pb-nav-btn .pb-label {
  line-height: 1.1;
  user-select: none;
}

.pb-nav-btn[aria-current="page"] {
  color: var(--theme-accent, #00D3BD);
}

.pb-nav-btn:disabled,
.pb-nav-btn[aria-disabled="true"] {
  opacity: .85;
  cursor: default;
}

.pb-nav-btn:focus-visible {
  outline: 2px solid var(--theme-accent, #00D3BD);
  outline-offset: -2px;
  border-radius: 8px;
}

/* Keep content clear of the fixed bar when visible */
body.has-bottom-nav #main-app-wrapper {
  padding-bottom: calc(var(--pb-bottom-nav-height) + max(env(safe-area-inset-bottom), 12px));
}

/* Light theme adjustments */
[data-theme="light"] .pb-bottom-nav {
  background: rgba(255, 255, 255, 0.9);
  border-top-color: rgba(0,0,0,.06);
}
[data-theme="light"] .pb-nav-btn {
  color: #111;
}

/* Fallback when backdrop-filter not supported */
@supports not (backdrop-filter: blur(12px)) {
  .pb-bottom-nav { background: #0F1214; }
  [data-theme="light"] .pb-bottom-nav { background: #FFFFFF; }
}

/* Slightly taller on small touch devices */
@media (max-width: 1000px) {
  :root { --pb-bottom-nav-height: 124px; }
  .pb-nav-btn .pb-icon { font-size: 42px; }
  .pb-nav-btn .pb-label {
    font-size: 24px;
  }
  .pb-nav-btn .pb-icon {
    display: block;
    margin-bottom: 8px; 
  }
}
