/* Estilos gerais */
.bahia-map-wrapper {
    display: flex;
    /*gap: 30px;*/
    max-width: 1200px;
    margin: 30px auto;
    flex-wrap: wrap;
    justify-content: center;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.top-section {
    display: flex;
    gap: 20px;
    flex-wrap: nowrap;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 30px;
}

/* Estilos da legenda - reduzido para respeitar o limite dos dados */
.legend {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    z-index: 1000;
    flex: 0 0 auto; /* Não cresce, não encolhe, tamanho automático */
    width: auto; /* Largura baseada no conteúdo */
    max-width: 350px; /* Largura máxima */
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.legend:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-8px);
}

.legend h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

.legend-item {
    margin: 8px 0;
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    padding-right: 20px;
}

.legend span {
    display: inline-block;
    width: 16px;
    height: 32px;
    margin-right: 10px;
    vertical-align: middle;
    border-radius: 4px;
}
.linha-comdados {
    font-weight: bold;
    font-size: 18px;
    color: #1a73e8;
}
.linha-semdados {
    font-weight: bold;
    font-size: 18px;
    color: #e53935;
}

/* Estilos dos cards de informação */
.info-cards-container {
    display: flex;
    gap: 20px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    flex: 1;
}

.info-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    flex: 1; /* Alterado para crescer e ocupar o espaço disponível */
    min-width: 280px; /* Aumentada a largura mínima para acomodar o conteúdo */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.info-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-8px);
}

.card-icon {
    margin-bottom: 15px;
}

.card-icon i {
    font-size: 32px;
    background: #f8f9fa;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto;
}

.card-content {
    width: 100%;
}

.card-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.card-value {
    font-size: 22px; /* Reduzido ligeiramente para melhor ajuste */
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap; /* Impede quebra de linha */
    /* Remover estas duas propriedades que estão causando o truncamento */
    /* overflow: hidden; */ /* Impede que o texto saia da caixa */
    /* text-overflow: ellipsis; */ /* Adiciona reticências se o texto for muito longo */
    max-width: 100%; /* Garante que o texto não ultrapasse a largura do container */
}

.value-suffix {
    font-size: 16px; /* Reduzido para melhor ajuste */
    font-weight: 500;
    display: inline-block; /* Garante que fique na mesma linha */
}

/* Responsividade */
@media (max-width: 992px) {
    .top-section {
        flex-wrap: wrap;
    }
    
    .legend, .info-cards-container {
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    .legend {
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .info-cards-container {
        flex-wrap: wrap;
    }
    
    .info-card {
        flex: 1 1 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }
    
    .card-value {
        font-size: 20px; /* Reduzido ainda mais para telas menores */
    }
    
    .value-suffix {
        font-size: 14px; /* Reduzido para telas menores */
    }
}

/* Manter os estilos existentes do mapa */
#bahia-map-container {
    width: 100%;
    max-width: 1200px;
    position: relative;
    z-index: 1; /* Ensure the map is below the dropdown list */
}

#bahia-map-container svg {
    width: 100%;
    height: auto;
    display: block;
}

#bahia-map-container path {
    transition: fill 0.3s ease;
    cursor: pointer;
}

#bahia-map-container path:hover {
    opacity: 0.8;
}

/* Estilos do tooltip */
.tooltip-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.tooltip {
    position: absolute;
    /*background: white;*/
    /*padding: 15px 20px;*/
   /* border: 1px solid #f0f0f0;*/
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-size: 14px;
    color: #333;
    pointer-events: none;
    z-index: 9999;
    display: none;
    max-width: auto;
    min-width: 200px;
    transition: opacity 0.2s ease;
    overflow: hidden;
}

.tooltip h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #222;
    font-weight: 600;
}

.tooltip p {
    margin: 5px 0 0 0;
    color: #666;
    line-height: 1.4;
}

.leaflet-popup-content {
    margin: 10px;
}
/* Cabeçalho com fundo verde */
.tooltip-header {
    background-color: #0073aa; /* verde suave */
    color: white;
    padding: 10px 14px;
    font-weight: bold;
    font-size: 16px;
  }
  
  /* Corpo com fundo branco */
  .tooltip-body {
    background-color: white;
    color: #333;
    padding: 10px 14px;
  }

.leaflet-popup-content h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

.leaflet-popup-content p {
    margin: 5px 0;
    font-size: 14px;
}

.info-cards-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    flex-grow: 1;
}

.info-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    flex: 1;
}

.card-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

/* Cores dos ícones */
.fa-money-bill-wave {
    color: #28A745;
}

.fa-music {
    color: #FD7E14;
}

.card-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.card-value {
    font-size: 24px;
    font-weight: bold;
}

.value-money {
    color: #28A745;
}

.value-contract {
    color: #FD7E14;
}

/* Estilos para o filtro de município */
.bahia-map-filter-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.bahia-map-filter-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.bahia-map-filter-card label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Adicionar estilos específicos para o select */
#municipio-select {
    display: none; /* Esconder o select original */
}

/* Estilos para o container do dropdown */
.ms-options-wrap {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* Estilos para o botão do dropdown */
.ms-options-wrap > button {
    background-color: #0073aa !important;
    border-color: #006799 !important;
    color: #fff !important;
    text-decoration: none !important;
    padding: 5px 10px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.ms-options-wrap > button:after {
    content: '▼';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #666;
}

/* Estilos para o dropdown aberto */
.ms-options-wrap.ms-active > .ms-options {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* Estilos para a lista de opções */
.ms-options-wrap > .ms-options {
    position: absolute;
    left: 0;
    width: 100%;
    margin-top: 5px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

/* Estilos para a barra de pesquisa */
.ms-options-wrap > .ms-options > .ms-search {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.ms-options-wrap > .ms-options > .ms-search input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Estilos para a lista de opções */
.ms-options-wrap > .ms-options > ul {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
    margin: 0;
    list-style: none;
}

/* Estilos para os itens da lista */
.ms-options-wrap > .ms-options > ul label {
    display: flex;
    align-items: center;
    padding: 8px 8px 8px 30px;
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    position: relative;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.ms-options-wrap > .ms-options > ul label:hover {
    background-color: #f5f5f5;
    border-color: #ddd;
}

/* Estilos para os checkboxes */
.ms-options-wrap > .ms-options > ul input[type="checkbox"] {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    width: 16px;
    height: 16px;
}

/* Estilos para itens selecionados */
.ms-options-wrap > .ms-options > ul li.selected label {
    background-color: #e8f0fe;
    border-color: #c6dafc;
    color: #1a73e8;
}

/* Estilos para o botão "Selecionar todos" */
.ms-options-wrap > .ms-options .ms-selectall {
    display: block;
    padding: 10px;
    text-align: center;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #1a73e8;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ms-options-wrap > .ms-options .ms-selectall:hover {
    background-color: #e8f0fe;
}

/* Responsividade */
@media (max-width: 768px) {
    .ms-options-wrap > .ms-options > ul {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ms-options-wrap > .ms-options > ul {
        grid-template-columns: 1fr;
    }
}

.municipio-lock-options {
    width: 100%;
    margin-top: 10px;
}

.lock-label {
    display: block;
    font-size: 14px;
    color: #333;
    font-weight: 600;
    margin-bottom: 10px;
}

.municipio-checkboxes {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #f0f0f0;
    border-radius: 5px;
    padding: 10px;
}

.municipio-checkbox-item {
    display: flex;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
}

.municipio-checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.municipio-checkbox-item label {
    cursor: pointer;
    color: #666;
    flex: 1;
}

.municipio-checkbox-item:hover {
    background-color: #f8f9fa;
}

/* Estilização da scrollbar */
.municipio-checkboxes::-webkit-scrollbar {
    width: 8px;
}

.municipio-checkboxes::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.municipio-checkboxes::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.municipio-checkboxes::-webkit-scrollbar-thumb:hover {
    background: #999;
}
.ms-options-wrap {
     max-width: 100%!important;
}

/* Estilos para o botão de selecionar municípios */
.bahia-map-select-button {
    background-color: #0073aa !important;
    border-color: #006799 !important;
    color: #fff !important;
    text-decoration: none !important;
    padding: 5px 10px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

/* Estilo para hover e focus do botão de selecionar municípios */
.bahia-map-select-button:hover,
.bahia-map-select-button:focus {
    background-color: #006799 !important;
    border-color: #005177 !important;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: 0 1px 0 #005177 !important;
}

/* Estilo para estado ativo do botão */
.bahia-map-select-button:active {
    background-color: #005177 !important;
    border-color: #004b6e !important;
    box-shadow: inset 0 1px 0 #004b6e !important;
}

/* Sobrescrever estilos do tema para o botão específico */
.bahia-map-select-button[type=button]:focus,
.bahia-map-select-button[type=button]:hover,
.bahia-map-select-button[type=submit]:focus,
.bahia-map-select-button[type=submit]:hover,
.bahia-map-select-button:focus,
.bahia-map-select-button:hover {
    color: #fff !important;
    background-color: #006799 !important;
    text-decoration: none !important;
}

/* Estilos para o botão do seletor de municípios */
.ms-options-wrap > button {
    background-color: #0073aa !important;
    border-color: #006799 !important;
    color: #fff !important;
    text-decoration: none !important;
    padding: 5px 10px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

/* Estilo para hover e focus do botão */
.ms-options-wrap > button:hover,
.ms-options-wrap > button:focus {
    background-color: #006799 !important;
    border-color: #005177 !important;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: 0 1px 0 #005177 !important;
}

/* Estilo para estado ativo do botão */
.ms-options-wrap > button:active {
    background-color: #005177 !important;
    border-color: #004b6e !important;
    box-shadow: inset 0 1px 0 #004b6e !important;
}

/* Sobrescrever estilos do tema para o botão específico */
.ms-options-wrap > button[type=button]:focus,
.ms-options-wrap > button[type=button]:hover,
.ms-options-wrap > button:focus,
.ms-options-wrap > button:hover {
    color: #fff !important;
    background-color: #006799 !important;
    text-decoration: none !important;
}
.ms-options-wrap > button:after {
    color: #ffffff!important;
}
