/* ============================================ */
/* Mobile Optimizations for Azimute */
/* ============================================ */

@media (max-width: 768px) {

    /* Header Simplificado */
    header {
        padding: 0 16px;
        height: 56px;
        justify-content: center;
        /* Center logo text */
    }

    /* Esconde logo icon para economizar espaço se precisar, ou mantém */
    .logo-icon {
        display: none;
    }

    header h1 {
        font-size: 1.1rem;
        margin: 0;
    }

    /* Esconde ações de desktop */
    .header-actions {
        display: none !important;
    }

    .mapa-id {
        font-size: 0.7rem;
    }

    /* Bottom Navigation Bar */
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: var(--card);
        /* Usa cor do tema */
        border-top: 1px solid var(--border);
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 2000;
        padding-bottom: env(safe-area-inset-bottom);
        /* iOS Safe Area */
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--muted);
        font-size: 0.7rem;
        padding: 8px;
        flex: 1;
        background: none;
        border: none;
        cursor: pointer;
        transition: color 0.2s;
    }

    .nav-item.active {
        color: var(--accent);
        /* Cor ativa */
    }

    .nav-item svg {
        width: 24px;
        height: 24px;
        margin-bottom: 4px;
        stroke: currentColor;
    }

    /* Floating Action Button (FAB) para Adicionar */
    .fab-add {
        position: fixed;
        bottom: 80px;
        right: 20px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--primary);
        /* Azul ou accent */
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        z-index: 1000;
        cursor: pointer;
        border: none;
        transition: transform 0.2s, box-shadow 0.2s;
    }

    .fab-add:active {
        transform: scale(0.95);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    /* Ajuste de controles do mapa (Leaflet) */
    .leaflet-control-zoom {
        left: 10px !important;
        bottom: 80px !important;
        /* Acima da Nav Bar */
        display: flex;
        flex-direction: column;
    }

    /* Controles de camadas (Map Controls) - Scroll horizontal em mobile */
    .map-controls {
        top: 65px;
        left: 10px;
        right: 10px;
        width: auto;
        position: fixed;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        background: var(--card);
        padding: 8px;
        border-radius: 8px;
        border: 1px solid var(--border);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        gap: 8px;
        scrollbar-width: none;
        /* Hide scrollbar Firefox */
    }

    .map-controls::-webkit-scrollbar {
        display: none;
        /* Hide scrollbar Chrome */
    }

    .map-control-btn {
        flex: 0 0 auto;
        /* No shrink */
    }

    /* Barra de Busca - Mover para baixo dos controles */
    .search-bar {
        top: 120px;
        left: 10px;
        right: 10px;
        transform: none;
        width: auto;
        display: flex;
    }

    .search-bar input {
        width: 100%;
        flex: 1;
    }

    .search-bar select {
        width: 80px;
    }

    /* Location Search - Abaixo da busca de torres */
    .location-search-bar {
        position: fixed;
        top: 170px;
        /* Abaixo da outra busca */
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
    }

    .location-results {
        top: 215px;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: 40vh;
    }

    /* Sidebar Mobile Full Screen */
    .sidebar,
    .sidebar-wide {
        width: 100%;
        right: -100%;
        top: 0;
        height: 100%;
        z-index: 2100;
        /* Acima da Nav Bar */
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.active,
    .sidebar-wide.active {
        right: 0;
        box-shadow: none;
    }

    /* Modais Mobile */
    .modal {
        padding: 0;
        align-items: flex-end;
        /* Sheet style bottom up? Ou full screen */
    }

    .modal-content {
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
        border: none;
        display: flex;
        flex-direction: column;
    }

    .modal-body {
        overflow-y: auto;
        flex: 1;
        padding-bottom: 80px;
        /* Space for bottom content */
    }

    /* Ajustes Gerais */
    body {
        overflow: hidden;
        /* Evita scroll na página inteira */
    }

    #map {
        height: 100vh;
        width: 100vw;
    }
}

/* Desktop Hide */
@media (min-width: 769px) {

    .bottom-nav,
    .fab-add {
        display: none !important;
    }
}