/* Layout Principal - Fundo Claro (Removida a barra preta) */

/* Layout Principal - Fundo Claro */

/* Sidebar de Controles */
.map-sidebar {
    width: 90px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex; flex-direction: column;
    padding: 15px 5px;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.03);
    overflow-y: auto; /* Permite rolar se a tela for pequena */
    scrollbar-width: none; /* Esconde a barra no Firefox */
}
.map-sidebar::-webkit-scrollbar {
    display: none; /* Esconde a barra no Chrome/Safari */
}

.sidebar-section label {
    font-size: 10px; text-transform: uppercase; font-weight: 800;
    color: #64748b; text-align: center; display: block; margin-bottom: 15px;
}

.map-controls-grid { display: flex; flex-direction: column; gap: 8px; }

.ctrl-btn {
    border: none; background: transparent; color: #64748b;
    padding: 8px 4px; border-radius: 10px; cursor: pointer;
    display: flex; flex-direction: column; align-items: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ctrl-btn i { font-size: 16px; margin-bottom: 4px; }
.ctrl-btn span { font-size: 9px; font-weight: 700; text-align: center;}
.ctrl-btn:hover { background: #f1f5f9; color: #004587; }
.ctrl-btn.active {
    background: #004587; color: #fff;
    box-shadow: 0 4px 10px rgba(0, 69, 135, 0.2);
}

.header {
    /* Mantenha o position que você já usa (ex: fixed, sticky ou relative) */
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    
    /* Garante que o header fique acima do menu e do overlay */
    z-index: 9999 !important; 
}

.map-sidebar {
    /* Mantenha as outras propriedades que já existem aqui */
    
    /* Adiciona um espaço no topo para empurrar os botões para baixo */
    /* Ajuste esse valor (ex: 80px, 100px) conforme a altura do seu header */
    padding-top: 80px; 
}

.side-menu {
    position: fixed;
    
    /* Z-index menor que o do .header (9999) e maior que o do mapa */
    z-index: 9990 !important; 
    
    /* ATENÇÃO: Substitua '70px' pela altura exata do seu header. */
    /* Isso faz o menu começar exatamente onde o header termina. */
    top: 70px; 
    height: calc(100vh - 70px); 
}

#bg-overlay {
    z-index: 9980 !important;
}

body.map-page { 
    margin: 0; 
    padding: 0; 
    overflow: hidden; 
    height: 100vh; 
    width: 100vw;
    background: #f4f7f6; 
}

/* Força o wrapper a ocupar exatamente o espaço abaixo do header (assumindo header de 70px) */
.map-app-wrapper {
    position: absolute;
    top: 70px; /* Altura do seu header */
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw; /* Garante que pegue 100% da largura da tela */
    display: flex;
    overflow: hidden; /* Evita que crie barra de rolagem horizontal sem querer */
}


/* Mapa - Agora grudado em todas as bordas */
/* Mapa (CORREÇÃO DE ESPAÇO EM BRANCO) */
/* Mapa - Forçando a ignorar limites globais */
.map-main { 
    flex: 1 !important; 
    position: relative; 
    height: 100%; 
    width: 100% !important;
    min-width: 0; 
    
    /* 👇 AS LINHAS MÁGICAS PARA O PC 👇 */
    max-width: none !important; 
    margin: 0 !important;
    padding: 0 !important;
}

#mapa-previsao { 
    position: absolute;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    z-index: 1; 
}

.sidebar-section label {
    font-size: 10px; text-transform: uppercase; font-weight: 800;
    color: #64748b; text-align: center; display: block; margin-bottom: 15px;
}

.map-controls-grid { display: flex; flex-direction: column; gap: 10px; }

.ctrl-btn {
    border: none; background: transparent; color: #64748b;
    padding: 10px 5px; border-radius: 10px; cursor: pointer;
    display: flex; flex-direction: column; align-items: center;
    transition: all 0.2s;
}

.ctrl-btn i { font-size: 18px; margin-bottom: 4px; }
.ctrl-btn span { font-size: 10px; font-weight: 700; }
.ctrl-btn:hover { background: #f1f5f9; color: #004587; }
.ctrl-btn.active {
    background: #004587; color: #fff;
    box-shadow: 0 4px 10px rgba(0, 69, 135, 0.2);
}

/* Mapa */
/* =========================================
   MAPA (CORREÇÃO DE ESPAÇO EM BRANCO)
   ========================================= */
.map-main { 
    flex: 1; 
    position: relative; 
    height: 100%; 
    min-width: 0; /* Evita que o flexbox quebre a largura */
}

#mapa-previsao { 
    position: absolute; /* Força o mapa a preencher todo o espaço do .map-main */
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    z-index: 1; 
}

/* =========================================
   CAIXINHAS (CARDS) NO ESTILO DA SUA IMAGEM
   ========================================= */
.custom-div-icon { background: transparent; border: none; }

.map-label-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 4px; /* Cantos sutilmente arredondados */
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 11px;
    border: 1px solid rgba(255, 255, 255, 0.2); /* Borda muito sutil */
    box-shadow: 1px 1px 3px rgba(0,0,0,0.4); /* Sombra mais realista */
    white-space: nowrap;
}
.map-label-box span { font-size: 9px; margin-left: 1px; font-weight: 600; opacity: 0.9; }

/* =========================================
   LEGENDA HORIZONTAL (Agora bem visível!)
   ========================================= */
.map-legend-horizontal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    font-family: 'Inter', sans-serif;
}


/* O cabeçalho se mantém onde está */
.header {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999 !important; 
}

.hamburger {
    position: fixed !important; /* Tira o botão do fluxo do cabeçalho */
    top: 20px; /* Ajuste esse valor para centralizar na altura do seu header */
    right: 20px; /* Ajuste esse valor para a distância correta da borda */
    z-index: 10005 !important; /* Maior que o menu (10001) e overlay (10000) */
}

/* O fundo escuro (overlay) agora fica por cima do cabeçalho */
#bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000 !important; /* Maior que o header (9999) */
}

/* O menu lateral agora passa por cima de tudo e ocupa a tela inteira */
.side-menu {
    position: fixed;
    top: 0; /* Começa do topo absoluto da tela */
    height: 100vh; /* Ocupa 100% da altura da tela */
    z-index: 10001 !important; /* Maior que o overlay (10000) e o header */
}

.map-legend-horizontal h4 {
    margin: 0 0 8px 0; font-size: 12px; font-weight: 800; color: #1e293b;
    text-transform: uppercase;
}

.legend-bar-container { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin-bottom: 6px; }
.legend-segment { flex: 1; }
.legend-labels { display: flex; justify-content: space-between; font-size: 10px; font-weight: 700; color: #475569; }

@media (max-width: 768px) {
    .map-sidebar { width: 60px; }
    .ctrl-btn span { display: none; }
    .map-legend-horizontal { min-width: 220px; padding: 10px; }
}