/* Universal Mobile Overrides for DeCharge Scout */

:root {
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --primary: #00f2ea;
    --primary-glow: rgba(0, 242, 234, 0.4);
    --bg-dark: #0f172a;
    --glass-bg: rgba(15, 23, 42, 0.75);
    --border: rgba(255, 255, 255, 0.1);
}

/* Force 100dvh only in Mobile Viewport */
@media (max-width: 768px) {

    html,
    body {
        height: 100dvh !important;
        min-height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        background: var(--bg-dark);
        width: 100vw !important;
    }

    #landing-map,
    #map {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        z-index: 1 !important;
    }

    /* Burger Menu Visibility - Repositioned to avoid logo overlap */
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: rgba(15, 23, 42, 0.5) !important;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid var(--border) !important;
        color: #fff !important;
        font-size: 1.25rem !important;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        cursor: pointer;
        z-index: 10001 !important;
        margin-right: 10px;
        /* Spacing from left edge */
        flex-shrink: 0;
    }

    /* Navbar adjustments for mobile */
    .landing-nav {
        width: 94% !important;
        top: 15px !important;
        padding: 0.4rem 0.8rem !important;
        justify-content: flex-start !important;
        gap: 8px;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    .nav-logo {
        font-size: 0.9rem !important;
        margin-right: auto;
    }

    .nav-links {
        gap: 0.75rem !important;
    }

    .nav-cta-btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.8rem !important;
    }

    /* Network Intelligence Panel Fix */
    #network-stats-panel {
        width: 90% !important;
        max-width: 400px;
        left: 5% !important;
        bottom: 100px !important;
        max-height: 50vh;
        z-index: 2000 !important;
    }

    #network-stats-panel.hidden {
        display: none !important;
    }
}

/* Sidebar Styles - Integrated Look */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    /* Start fully hidden relative to itself */
    width: 300px;
    max-width: 85vw;
    height: 100dvh;
    background: rgba(15, 23, 42, 0.95);
    /* More opaque for integrated look */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 20000;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
    box-sizing: border-box;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    transform: translateX(0);
    /* Slide fully into view */
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1rem;
}

.sidebar-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-close-btn:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.9);
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #00f2ea, #ff0055);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-icon {
    font-size: 1.25rem;
}

/* Ensure Leaflet container fills everything */
.leaflet-container {
    height: 100% !important;
    width: 100% !important;
    background: var(--bg-dark) !important;
}