/* Mobile chrome: fixed bottom navigation bar, the bottom-spacer, and the
   slide-up menu overlay. Loaded after Bootstrap. */

/* Mobile bottom navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    /* Respect iOS safe area */
    padding-bottom: env(safe-area-inset-bottom);
}

/* Ensure Leaflet map controls stay below mobile navbar when scrolling */
@media (max-width: 991.98px) {
    .leaflet-top,
    .leaflet-bottom {
        z-index: 400 !important;
    }
}

/* Spacer to prevent content being hidden behind fixed bottom nav */
.mobile-bottom-spacer {
    height: calc(64px + env(safe-area-inset-bottom));
}

.mobile-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    max-width: 100%;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #6c757d;
    font-size: 0.75rem;
    padding: 8px 12px;
    min-height: 44px; /* Touch target */
    min-width: 44px;
    border: none;
    background: none;
    transition: color 0.2s ease;
    touch-action: manipulation; /* Eliminate double-tap-to-zoom delay */
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

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

.mobile-nav-item i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
}

.mobile-menu {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-radius: 20px 20px 0 0;
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mobile-menu-items {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
}

.mobile-menu-overlay.show .mobile-menu {
    transform: translateY(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    color: #2c3e50;
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px solid var(--bg-secondary);
    min-height: 44px;
}

.mobile-menu-item:hover {
    color: var(--primary-color);
    background: var(--bg-secondary);
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
}

.mobile-menu-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 10px 0;
}
