/* =============================================
   Mobile Bottom Navigation
   Only visible on mobile (≤768px)
   ============================================= */

.bottom-nav {
    display: none; /* hidden on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 998; /* Below header (999), mobile overlay (1000), mobile menu (1002) */
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);

    /* 5 equal columns */
    flex-direction: row;
    align-items: stretch;
    justify-content: space-around;

    /* notch / home-bar safe area */
    padding-bottom: env(safe-area-inset-bottom, 0px);

    /* prevent text selection on tap */
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Each nav item — anchor or button */
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px 6px;
    min-height: 56px;

    /* reset button defaults */
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;

    color: var(--text-muted);
    font-family: inherit;
    transition: color 0.15s ease, background 0.15s ease;
    position: relative;
    border-radius: 0;
}

/* Ripple / press effect */
.bottom-nav-item:active {
    background: rgba(59, 130, 246, 0.08);
}

/* Icon wrapper */
.bottom-nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-nav-icon i {
    font-size: 1.05rem;
    line-height: 1;
}

/* Label */
.bottom-nav-label {
    font-size: 0.6rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* ---- Active state ---- */
.bottom-nav-item.active {
    color: var(--primary, #3b82f6);
}

.bottom-nav-item.active .bottom-nav-icon {
    transform: translateY(-1px) scale(1.12);
}

/* Active indicator pill above icon */
.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: var(--primary, #3b82f6);
    border-radius: 0 0 3px 3px;
}

/* ---- Show on mobile only ---- */
@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }

    /* Push page content up so it's not hidden behind bottom nav.
       Class added by mobile-bottom-nav.js only when nav is in DOM. */
    body.has-bottom-nav {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }
}

/* Light theme overrides */
[data-theme="light"] .bottom-nav {
    background: #ffffff;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.10);
}
