/* ==========================================================================
   Owl OS - Mobile bottom navigation (app-like tab bar)
   Shown only on screens <= 768px. Hidden on desktop.
   ========================================================================== */

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

@media (max-width: 768px) {
    :root {
        --mbn-height: 64px;
        --mbn-safe: env(safe-area-inset-bottom, 0px);
        --mbn-total: calc(var(--mbn-height) + var(--mbn-safe));
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        margin: 0;
        border-bottom: 0;
        z-index: 990; /* above content, particles & back-to-top; below the slide-in menu (999/1000) */
        height: var(--mbn-total);
        padding: 0 6px var(--mbn-safe);
        align-items: stretch;
        justify-content: space-around;
        background: rgba(8, 8, 8, 0.82);
        -webkit-backdrop-filter: blur(18px) saturate(160%);
        backdrop-filter: blur(18px) saturate(160%);
        border-top: 1px solid rgba(255, 26, 26, 0.18);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
        font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
        -webkit-tap-highlight-color: transparent;
        box-sizing: border-box;
    }

    .mobile-bottom-nav a {
        position: relative;
        flex: 1 1 0;
        min-width: 44px;
        min-height: 44px;
        height: var(--mbn-height);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: rgba(212, 212, 212, 0.72);
        text-decoration: none;
        font-size: 0.68rem;
        font-weight: 500;
        letter-spacing: 0.01em;
        line-height: 1;
        transition: color 0.2s ease, transform 0.15s ease;
        user-select: none;
    }

    .mobile-bottom-nav a i {
        font-size: 1.2rem;
        line-height: 1;
        transition: transform 0.2s ease, text-shadow 0.2s ease;
    }

    .mobile-bottom-nav a span {
        white-space: nowrap;
    }

    .mobile-bottom-nav a:active {
        transform: scale(0.94);
    }

    .mobile-bottom-nav a:focus-visible {
        outline: 2px solid rgba(255, 26, 26, 0.6);
        outline-offset: -4px;
        border-radius: 12px;
    }

    /* Active indicator: small owl-red pill at the top edge */
    .mobile-bottom-nav a::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        width: 28px;
        height: 3px;
        border-radius: 0 0 3px 3px;
        background: linear-gradient(90deg, #FF1A1A, #E10600);
        box-shadow: 0 0 8px rgba(255, 26, 26, 0.45);
        transform: translateX(-50%) scaleX(0);
        transition: transform 0.25s ease;
    }

    .mobile-bottom-nav a.active {
        color: #FF1A1A;
        font-weight: 600;
    }

    .mobile-bottom-nav a.active::before {
        transform: translateX(-50%) scaleX(1);
    }

    .mobile-bottom-nav a.active i {
        transform: translateY(-1px);
        text-shadow: 0 0 12px rgba(255, 26, 26, 0.55);
    }

    /* Keep content and footer clear of the bar */
    body {
        padding-bottom: var(--mbn-total) !important;
    }

    /* Move existing fixed bottom elements above the bar */
    .back-to-top {
        bottom: calc(var(--mbn-total) + 16px) !important;
        right: 16px !important;
        width: 44px !important;
        height: 44px !important;
    }

    /* donate.html copy toast: sit above the bar, fully hidden until shown */
    .toast {
        bottom: calc(var(--mbn-total) + 16px) !important;
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), opacity 0.2s ease, visibility 0.2s;
    }

    .toast.show {
        opacity: 1;
        visibility: visible;
    }

    /* Hero stats (index): compact 2x2 grid instead of one card per row */
    .hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .hero-stats .stat-card {
        padding: 14px 10px;
        min-width: 0;
    }

    .hero-stats .stat-value {
        font-size: 1.6rem;
        line-height: 1.15;
        margin-bottom: 4px;
    }

    .hero-stats .stat-label {
        font-size: 0.7rem;
        letter-spacing: 0.04em;
        line-height: 1.3;
    }
}

@media (max-width: 360px) {
    .mobile-bottom-nav a {
        font-size: 0.62rem;
    }
    .hero-stats .stat-value {
        font-size: 1.4rem;
    }
}

/* Hide the bar when printing */
@media print {
    .mobile-bottom-nav { display: none !important; }
}
