/**
 * Universal Mobile Bottom Navigation
 * Global navigation that appears on all pages (mobile only)
 * Theme-compatible with dark/light mode support
 */

/* Hide by default (desktop) */
.mobile-bottom-nav-global {
    display: none;
}

/* Show on mobile */
@media (max-width: 768px) {
    .mobile-bottom-nav-global {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: var(--card-bg);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        padding: 0 0 calc(env(safe-area-inset-bottom, 0px)) 0;
        height: calc(65px + env(safe-area-inset-bottom, 0px));
        justify-content: space-around;
        align-items: stretch;
    }

    [data-theme="light"] .mobile-bottom-nav-global {
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    }

    .mobile-nav-global-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: #8e9aaf;
        font-size: 0.7rem;
        font-weight: 500;
        padding: 0.5rem;
        transition: all 0.3s ease;
        cursor: pointer;
        position: relative;
        gap: 0.25rem;
        text-decoration: none;
    }

    .mobile-nav-global-item i {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
        transition: all 0.3s ease;
    }

    .mobile-nav-global-item span {
        font-size: 0.8rem;
        line-height: 1;
    }

    .mobile-nav-global-item.active {
        color: var(--primary-color);
    }

    .mobile-nav-global-item.active i {
        transform: scale(1.1);
    }

    .mobile-nav-global-item:active {
        background-color: rgba(102, 126, 234, 0.1);
    }

    [data-theme="light"] .mobile-nav-global-item:active {
        background-color: rgba(79, 172, 254, 0.1);
    }

    /* Add bottom padding to body to prevent content hiding behind nav */
    body {
        padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px));
    }

    /* Hide on dashboard page (which has its own tab navigation) */
    body[data-page="dashboard"] .mobile-bottom-nav-global {
        display: none !important;
    }

    /* Ensure tab-specific nav still shows on dashboard */
    body[data-page="dashboard"] .mobile-bottom-nav {
        display: flex !important;
    }
}

/* Accessibility */
@media (max-width: 768px) {
    .mobile-nav-global-item:focus-visible {
        outline: 2px solid var(--primary-color, #007bff);
        outline-offset: -2px;
    }

    /* Touch improvements */
    .mobile-nav-global-item {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        -webkit-user-select: none;
        user-select: none;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .mobile-nav-global-item,
    .mobile-nav-global-item i {
        transition: none !important;
    }
}
