/* ============================================================
   mobile-nav.css — app-style bottom tab bar + "More" sheet
   Shown only on mobile / small tablets (< 992px). Hidden on
   desktop and when printing. Injected on every page by
   mobile-nav.js. Colours use theme tokens with safe fallbacks.
   ============================================================ */

.mobile-tabbar,
.mobile-sheet,
.mobile-sheet-backdrop { display: none; }

@media (max-width: 991.98px) {

  /* ---- Bottom tab bar ---- */
  .mobile-tabbar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1080;
    background: var(--nav-bg, rgba(11, 16, 32, 0.94));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -6px 24px var(--shadow-color, rgba(0, 0, 0, 0.35));
  }
  .mobile-tabbar a,
  .mobile-tabbar button {
    flex: 1 1 0;
    min-width: 0;
    background: none;
    border: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    color: var(--text-muted, #aab2c5);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    border-radius: 12px;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease, background 0.15s ease;
  }
  .mobile-tabbar a i,
  .mobile-tabbar button i { font-size: 1.3rem; line-height: 1; }
  .mobile-tabbar a.active { color: var(--cyan-accent, #22d3ee); }
  .mobile-tabbar a:active,
  .mobile-tabbar button:active { background: var(--glass-medium, rgba(255, 255, 255, 0.08)); }

  /* Keep page content / footer clear of the fixed bar */
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)) !important; }

  /* Float the homepage CTA above the tab bar */
  .floating-register-btn {
    bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ---- "More" bottom sheet ---- */
  .mobile-sheet-backdrop {
    display: block;
    position: fixed; inset: 0;
    z-index: 1085;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
  .mobile-sheet-backdrop.open { opacity: 1; visibility: visible; }

  .mobile-sheet {
    display: block;
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 1090;
    background: var(--card-bg-solid, #141a2e);
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-bottom: 0;
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    max-height: 82vh;
    overflow-y: auto;
    transform: translateY(101%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  }
  .mobile-sheet.open { transform: translateY(0); }

  .mobile-sheet .grip {
    width: 42px; height: 4px;
    border-radius: 4px;
    background: var(--border-strong, rgba(255, 255, 255, 0.22));
    margin: 8px auto 12px;
  }
  .mobile-sheet .sheet-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-faint, #808a9e);
    font-weight: 700;
    margin: 12px 6px 4px;
  }
  .mobile-sheet a.sheet-link {
    display: flex; align-items: center; gap: 13px;
    padding: 14px 12px;
    border-radius: 12px;
    color: var(--text-main, #e7ebf3);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.98rem;
  }
  .mobile-sheet a.sheet-link i {
    font-size: 1.2rem;
    color: var(--cyan-accent, #22d3ee);
    width: 24px; text-align: center;
  }
  .mobile-sheet a.sheet-link:active { background: var(--glass-medium, rgba(255, 255, 255, 0.08)); }

  .mobile-sheet .sheet-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 4px;
  }
  .mobile-sheet .sheet-row > span {
    color: var(--text-muted, #aab2c5);
    font-weight: 600; font-size: 0.9rem;
  }
}

/* Never show any of this on desktop or in print */
@media (min-width: 992px) {
  .mobile-tabbar, .mobile-sheet, .mobile-sheet-backdrop { display: none !important; }
}
@media print {
  .mobile-tabbar, .mobile-sheet, .mobile-sheet-backdrop { display: none !important; }
  body { padding-bottom: 0 !important; }
}
