/* ── Mobile bottom navigation — ARKAN UI core ─────────────────────
   Fixed to the viewport bottom, safe-area-inset-aware. Only rendered
   below the 768px breakpoint — the same breakpoint main.css already uses
   to turn the sidebar into an overlay drawer, so the two stay in lockstep
   (see components/mobile-bottom-nav.js's initTabletAdaptiveNav() for what
   happens between 769–1024px instead). */

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    align-items: flex-end;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 210; /* above the sidebar drawer (200) so it's always reachable */
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding: 0 4px calc(env(safe-area-inset-bottom, 0px));
    background: var(--surface-elevated);
    border-top: 1px solid var(--border-default);
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.10);
  }

  /* Reserve space so page content never sits under the fixed nav. Applied
     by mobile-bottom-nav.js only once it has actually mounted. */
  body.has-mobile-bottom-nav #app-main {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }

  .mbn__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    padding: 6px 2px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mbn__icon {
    display: flex;
    line-height: 0;
  }

  .mbn__label {
    font-size: 10.5px;
    font-weight: var(--font-medium);
    letter-spacing: 0.01em;
    white-space: nowrap;
  }

  .mbn__item:active {
    color: var(--accent-primary);
  }

  .mbn__item--active {
    color: var(--accent-primary);
  }

  .mbn__item--active .mbn__label {
    font-weight: var(--font-semibold);
  }

  /* ── Center "Создать" button — visually emphasized, raised above the bar ── */
  .mbn__item--emphasized {
    position: relative;
    justify-content: flex-start;
    color: var(--text-inverse);
  }
  .mbn__item--emphasized .mbn__icon {
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-top: -22px;
    border-radius: var(--radius-full);
    background: var(--accent-primary);
    color: var(--text-inverse);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--accent-primary) 45%, transparent);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  }
  .mbn__item--emphasized .mbn__label {
    color: var(--text-secondary);
    margin-top: 1px;
  }
  .mbn__item--emphasized:active .mbn__icon {
    transform: scale(0.94);
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .mbn__item--emphasized .mbn__icon {
    transition: none;
  }
}
