/* ==============================================
   MOBILE BOTTOM NAVIGATION
   Modern bottom nav bar for authenticated users
   ============================================== */

:root {
    --bottom-nav-height: 52px;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 4px 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: none; /* Hidden by default, shown on mobile */
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.2s ease;
}

/* Lift the nav content above the device's bottom safe area / system nav bar.
   env(safe-area-inset-bottom) covers the iOS home indicator and display
   cutouts. --android-nav-inset-bottom is injected by the Android host because
   an edge-to-edge Android WebView does NOT surface the gesture / 3-button
   navigation bar through env(); it stays 0px on web and iOS. */
.bottom-nav {
    padding-bottom: max(env(safe-area-inset-bottom), var(--android-nav-inset-bottom, 0px), 4px);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 64px;
    min-height: 44px;
    padding: 6px 12px;
    color: var(--text-secondary, #64748b);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
    border-radius: 12px;
    position: relative;
}

.bottom-nav-item i {
    font-size: 22px;
    transition: all 0.2s ease;
}

.bottom-nav-item span {
    opacity: 0.9;
    transition: all 0.2s ease;
}

/* Active state */
.bottom-nav-item.active {
    color: var(--primary-color, #00b4ff);
    font-weight: 600;
}

.bottom-nav-item.active i {
    transform: scale(1.1);
}

.bottom-nav-item.active span {
    opacity: 1;
}

/* Hover/tap feedback */
.bottom-nav-item:hover,
.bottom-nav-item:focus {
    background: rgba(0, 180, 255, 0.08);
    outline: none;
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }

    /* Pad the body so content clears the fixed bottom nav AND the device's
       bottom safe area / system nav bar. env(safe-area-inset-bottom) covers the
       iOS home indicator; --android-nav-inset-bottom is the host-forwarded
       Android nav-bar inset (0px on web/iOS). */
    body {
        padding-bottom: calc(var(--bottom-nav-height, 52px) + max(env(safe-area-inset-bottom), var(--android-nav-inset-bottom, 0px))) !important;
    }
}

/* Extra compact for very narrow screens */
@media (max-width: 380px) {
    .bottom-nav-item {
        min-width: 56px;
        padding: 4px 8px;
        font-size: 9px;
    }

    .bottom-nav-item i {
        font-size: 20px;
    }
}

/* Dark mode */
body.dark-mode .bottom-nav {
    background: rgba(26, 26, 26, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .bottom-nav-item {
    color: var(--text-secondary, #9ca3af);
}

body.dark-mode .bottom-nav-item.active {
    color: var(--primary-color, #00b4ff);
}

body.dark-mode .bottom-nav-item:hover,
body.dark-mode .bottom-nav-item:focus {
    background: rgba(0, 180, 255, 0.12);
}

/* Free-tier "Go Premium" upsell: a quiet purple pill within the tab bar --
   premium accent, visible without shouting. Purple maps to the Premium brand.
   If a shared premium-purple token gets introduced later, swap these literals
   for it. This block must stay AFTER the base .bottom-nav-item :hover / .active
   rules above -- the pro overrides win by source order at equal specificity. */
.bottom-nav-item-pro {
    color: #6d4bd8;
    background: rgba(124, 92, 255, 0.12);
}

.bottom-nav-item-pro.active {
    color: #6d4bd8;
}

.bottom-nav-item-pro:hover,
.bottom-nav-item-pro:focus {
    background: rgba(124, 92, 255, 0.20);
}

body.dark-mode .bottom-nav-item-pro {
    color: #b3a1ff;
    background: rgba(124, 92, 255, 0.20);
}

body.dark-mode .bottom-nav-item-pro:hover,
body.dark-mode .bottom-nav-item-pro:focus {
    background: rgba(124, 92, 255, 0.28);
}

/* Keep the active "Go Premium" pill purple in dark mode. Without this, the pill
   on /upgrade inherits the blue active color from the higher-specificity
   body.dark-mode .bottom-nav-item.active rule. Matches that rule's specificity
   (0,3,0) and wins by source order. */
body.dark-mode .bottom-nav-item-pro.active {
    color: #b3a1ff;
}
