
/* ===============================
   SEARCHABLE_COMBOBOX.CSS
   =============================== */


/* ================================
   COMBOBOX PESQUISÁVEL
   -> Estilos para campo de seleção com busca integrada (input, dropdown, itens e estados).
   ================================ */

.searchable-combobox {
    position: relative;
    width: 100%;
}

.combobox-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.combobox-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    background-color: white;
    color: #495057;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    cursor: text;
}

.combobox-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.combobox-input::placeholder {
    color: #6c757d;
    font-style: italic;
}

.combobox-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 10;
}

.combobox-toggle:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.combobox-toggle i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.combobox-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    max-height: 300px;
    overflow-y: auto;
}

.combobox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f3f4;
    font-size: 14px;
}

.combobox-item:last-child {
    border-bottom: none;
}

.combobox-item:hover,
.combobox-item.active {
    background-color: #f8f9fa;
    color: #007bff;
}

.combobox-item.selected {
    background-color: #e3f2fd;
    color: #007bff;
    font-weight: 500;
}

.combobox-item.selected:hover {
    background-color: #bbdefb;
}

.combobox-item i:first-child {
    color: #6c757d;
    width: 16px;
    text-align: center;
}

.combobox-item.selected i:first-child {
    color: #007bff;
}

.combobox-item i:last-child {
    margin-left: auto;
    color: #28a745;
}

.combobox-item span {
    flex: 1;
}

.combobox-item.no-results {
    color: #6c757d;
    font-style: italic;
    cursor: default;
    justify-content: center;
}

.combobox-item.no-results:hover {
    background-color: transparent;
    color: #6c757d;
}

.combobox-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: #6c757d;
    font-size: 14px;
}

.combobox-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scrollbar personalizada para o dropdown */
.combobox-dropdown::-webkit-scrollbar {
    width: 6px;
}

.combobox-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.combobox-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.combobox-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsivo */
@media (max-width: 768px) {
    .combobox-dropdown {
        max-height: 200px;
    }
    
    .combobox-item {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .combobox-input {
        padding: 10px 40px 10px 12px;
        font-size: 13px;
    }
}

/* Estados especiais */
.combobox-input:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.combobox-input:disabled + .combobox-toggle {
    color: #6c757d;
    cursor: not-allowed;
}

.combobox-input:disabled + .combobox-toggle:hover {
    background-color: transparent;
    color: #6c757d;
}

/* Animações */
.combobox-dropdown {
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Melhorias de acessibilidade */
.combobox-item:focus {
    outline: 2px solid #007bff;
    outline-offset: -2px;
}

.combobox-input[aria-expanded="true"] {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Indicador de carregamento no input */
.combobox-input-container.loading .combobox-toggle i {
    animation: spin 1s linear infinite;
}

/* Estilo para quando há muitos itens */
.combobox-dropdown.many-items {
    border-top: 1px solid #e9ecef;
    margin-top: 1px;
}

/* Destaque de busca */
.combobox-item .search-highlight {
    background-color: #fff3cd;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 600;
}


/* ===============================
   STILO_C_ADICIONAL_PUBLICADOS.CSS
   =============================== */


/* ===============================
   CSS Unificado — Controles Leaflet
   Origem dos arquivos:
   - [A] stilo_c_adicional_publicados.css (controle de Camadas Adicionais)
   - [B] layer_control_styles.css (controle Granular e Base: Satélite/Mapa)

   Estratégia de união sem conflitos:
   1) Mantivemos ajustes gerais do Leaflet do arquivo [A].
   2) Preservamos integralmente os estilos do controle granular e do controle de camadas base do arquivo [B].
   3) Reescopamos seletores genéricos de [A] para ficarem sob .leaflet-control-additional-layer quando aplicável,
      evitando sobrescrever estilos de [B] (ex.: .layer-control-header, .layer-name, etc.).
   4) Identificamos cada bloco com comentários [A] ou [B] para saber a origem.

   Observações:
   - Se algum componente do seu HTML não tiver o wrapper esperado (ex.: .leaflet-control-additional-layer para o controle adicional),
     ajuste o markup para garantir que os escopos funcionem corretamente.
   - Ajustes responsivos do controle granular permanecem conforme [B].
   =============================== */

/* =============================== */
/* [A] Ajustes gerais do container Leaflet (Topo/Direita) e controles */
/* =============================== */
.leaflet-top.leaflet-right {
    /* Mantém o flex-direction column para o container principal */
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    top: 2px !important;
    right: 2px !important;
}

/* Container para os botões de ação (fullscreen e toggle) */
.leaflet-action-buttons {
    display: flex;
    flex-direction: row; /* Alinha os botões horizontalmente */
    gap: 2px; /* Espaçamento entre os botões */
    /* Garante que o container de botões esteja na frente */
    z-index: 1001; 
}

/* Estilos para o botão de toggle */
.layers-toggle-btn {
    /* Garante que o botão seja um controle Leaflet padrão */
    box-shadow: 0 1px 5px rgba(0,0,0,0.65);
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    font-size: 1.2em;
    text-align: center;
    text-decoration: none;
    width: 30px;
    height: 30px;
    line-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* Z-index para garantir que esteja acima do mapa, mas abaixo do dropdown */
    z-index: 1000;
}

/* Estilos para o botão de fullscreen (para garantir consistência) */
.leaflet-control-fullscreen {
    /* Garante que o botão seja um controle Leaflet padrão */
    box-shadow: 0 1px 5px rgba(0,0,0,0.65);
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    font-size: 1.2em;
    text-align: center;
    text-decoration: none;
    width: 30px;
    height: 30px;
    line-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* Z-index para garantir que esteja acima do mapa, mas abaixo do dropdown */
    z-index: 1000;
}

@media (max-width: 768px) {
    .leaflet-control-zoom a {
        width: 28px !important;
        height: 28px !important;
        line-height: 26px !important;
        font-size: 14px !important;
    }
    /* NOTA: O width do controle granular fica a cargo de [B] para evitar conflito */

    /* Ajustes para os botões de ação em mobile */
    .leaflet-action-buttons {
        flex-direction: row; /* Mantém horizontal em mobile */
    }

    .layers-toggle-btn,
    .leaflet-control-fullscreen {
        width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 1.1em;
    }
}

.leaflet-control {
    transition: all 0.2s ease !important;
}

.leaflet-control:hover {
    transform: translateY(-1px) !important;
}

/* Foco/acessibilidade em elementos comuns */
.leaflet-control-zoom a:focus,
.layers-control-title:focus,
.layer-group-header input:focus {
    outline: 2px solid #007bff !important;
    outline-offset: 2px !important;
}

/* Indicadores de estado usados pelo controle granular */
.leaflet-control-layers-granular.has-active-layers {
    border-left: 3px solid #007bff !important;
}

.layer-group.partially-visible {
    border-left: 3px solid #ffc107 !important;
}

.layer-group.fully-hidden {
    opacity: 0.6 !important;
}


/* ============================================= */
/* [B] Controle GRANULAR
   -> Estilos para gerenciar camadas de mapas no Leaflet (satélite, normal, overlays). e Controle de Camadas Base (Satélite/Normal) */
/*     Conteúdo proveniente de layer_control_styles.css                */
/* ============================================= */

/* Estilos para Controle de Camadas */
.layer-control-section {
    margin-top: 15px;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.layer-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.layer-control-header h5 {
    margin: 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.layer-control-header h5 i {
    margin-right: 8px;
    color: #6c757d;
}

.layers-container {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.empty-layers {
    text-align: center;
    padding: 30px 20px;
    color: #6c757d;
}

.empty-layers i {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.empty-layers p {
    margin: 10px 0 5px 0;
    font-weight: 500;
}

.empty-layers small {
    font-size: 12px;
    opacity: 0.8;
}

.layer-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 12px;
    transition: all 0.2s ease;
}

.layer-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.layer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.layer-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.layer-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: #495057;
}

.layer-name i {
    color: #6c757d;
    font-size: 14px;
}

.layer-type .badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 500;
}

.badge-feature { background-color: #e3f2fd; color: #1976d2; }
.badge-base    { background-color: #f3e5f5; color: #7b1fa2; }
.badge-overlay { background-color: #e8f5e8; color: #388e3c; }

.layer-controls { display: flex; align-items: center; gap: 15px; }
.layer-controls .custom-checkbox { margin: 0; }
.layer-controls .custom-checkbox label { font-size: 12px; margin: 0; color: #6c757d; }

.layer-details { margin-top: 5px; padding-top: 5px; border-top: 1px solid #f1f3f4; }

.layer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

/* Checkboxes customizados */
.custom-checkbox { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.custom-checkbox input[type="checkbox"] { width: 16px; height: 16px; margin: 0; cursor: pointer; }
.custom-checkbox label { cursor: pointer; font-size: 13px; margin: 0; user-select: none; }

/* Animações genéricas */
.layer-item { animation: fadeInUp 0.3s ease; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Botões utilitários */
.btn-sm { padding: 4px 8px; font-size: 12px; border-radius: 4px; }
.btn-outline-primary   { color: #007bff; border-color: #007bff; }
.btn-outline-primary:hover   { background-color: #007bff; color: white; }
.btn-outline-secondary { color: #6c757d; border-color: #6c757d; }
.btn-outline-secondary:hover { background-color: #6c757d; color: white; }
.btn-outline-danger    { color: #dc3545; border-color: #dc3545; }
.btn-outline-danger:hover    { background-color: #dc3545; color: white; }

/* Scrollbar para container de camadas */
.layers-container::-webkit-scrollbar { width: 6px; }
.layers-container::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.layers-container::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
.layers-container::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* Controle hierárquico (granular) */
.layers-control-title {
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 8px 12px !important;
    background: #f8f9fa !important;
    border-radius: 6px !important;
    transition: background-color 0.2s ease !important;
}
.layers-control-title:hover { background: #e9ecef !important; }
.toggle-icon { transition: transform 0.2s ease !important; font-size: 10px !important; color: #6c757d !important; }

.layers-control-content.collapsed { display: none !important; }
.layers-control-content { padding: 8px !important; max-height: 300px !important; overflow-y: auto !important; border-top: 1px solid #dee2e6 !important; }

.layer-group { margin-bottom: 12px !important; border: 1px solid #e9ecef !important; border-radius: 6px !important; background: white !important; animation: fadeInUp 0.3s ease !important; }
.layer-group-header { display: flex !important; align-items: center !important; padding: 8px 10px !important; background: #f8f9fa !important; border-radius: 6px 6px 0 0 !important; gap: 8px !important; }
.layer-label { flex: 1 !important; cursor: pointer !important; margin: 0 !important; font-weight: 500 !important; color: #495057 !important; }
.layer-name { font-size: 13px !important; }
.layer-expand-btn { background: none !important; border: none !important; cursor: pointer !important; padding: 4px !important; border-radius: 3px !important; transition: background-color 0.2s ease !important; }
.layer-expand-btn:hover { background: #dee2e6 !important; }
.layer-toggle { transition: transform 0.2s ease !important; font-size: 10px !important; color: #6c757d !important; }

.layer-values { border-top: 1px solid #e9ecef !important; background: #fafbfc !important; }
.layer-values.collapsed { display: none !important; }
.layer-value-item { display: flex !important; align-items: center !important; padding: 6px 15px !important; gap: 8px !important; border-bottom: 1px solid #f1f3f4 !important; transition: background-color 0.2s ease !important; animation: fadeInLeft 0.2s ease !important; }
.layer-value-item:last-child { border-bottom: none !important; }
.layer-value-item:hover { background: #f1f3f4 !important; }
.layer-value-item input[type="checkbox"] { width: 14px !important; height: 14px !important; margin: 0 !important; cursor: pointer !important; }
.layer-value-item label { cursor: pointer !important; font-size: 12px !important; margin: 0 !important; color: #6c757d !important; flex: 1 !important; }
.layer-value-item label span { display: block !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; max-width: 150px !important; }

@keyframes fadeInLeft { from { opacity: 0; transform: translateX(-10px);} to { opacity: 1; transform: translateX(0);} }

/* Indicadores visuais */
.layer-group-header input[type="checkbox"]:checked + .layer-label { color: #007bff !important; font-weight: 600 !important; }
.layer-value-item input[type="checkbox"]:checked + label { color: #495057 !important; font-weight: 500 !important; }

/* Estados especiais */
.layer-group.all-hidden { opacity: 0.6 !important; }
.layer-value-item.hidden { opacity: 0.5 !important; }

/* Melhorias no controle principal */
.leaflet-control-layers-granular { min-width: 180px !important; max-width: 220px !important; box-shadow: 0 3px 12px rgba(0,0,0,0.15) !important; }
.layers-control-header { padding: 0 !important; border-bottom: none !important; background: transparent !important; border-radius: 8px 8px 0 0 !important; }



/* Ajustes responsivos compactos para telas pequenas */
@media (max-width: 768px) {
    /* Container principal */
    .leaflet-top.leaflet-right {
        align-items: flex-end !important;
        right: 5px !important; /* Mais próximo da borda direita */
        gap: 3px !important; /* Gap menor entre elementos */
    }

    /* Oculta os containers de camadas em mobile por padrão APENAS quando o toggle está ativo */
    .leaflet-top.leaflet-right:not(.show-layers) .leaflet-control.leaflet-control-layers,
    .leaflet-top.leaflet-right:not(.show-layers) .leaflet-control-layers-granular,
    .leaflet-top.leaflet-right:not(.show-layers) .leaflet-control-additional-layer {
        display: none !important;
    }

    /* Mostra os containers quando a classe 'show-layers' está ativa OU quando o toggle não foi inicializado */
    .leaflet-top.leaflet-right.show-layers .leaflet-control.leaflet-control-layers,
    .leaflet-top.leaflet-right.show-layers .leaflet-control-layers-granular,
    .leaflet-top.leaflet-right.show-layers .leaflet-control-additional-layer {
        display: block !important;
        width: 120px !important; /* Tamanho mais compacto */
        max-width: 120px !important;
        min-width: 120px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        align-self: flex-end !important;
        transform: none !important; /* Remove transformações */
        animation: slideInFromRight 0.3s ease-out !important;
    }

    /* Animação para aparecer os containers */
    @keyframes slideInFromRight {
        from {
            opacity: 0;
            transform: translateX(20px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* Ícone de toggle para mostrar/ocultar camadas - SEMPRE VISÍVEL EM MOBILE */
    .layers-toggle-btn {
    margin-right: 2px !important; /* alinhado com fullscreen */
        position: relative !important; /* agora participa do fluxo flex */
        top: auto !important; 
        right: auto !important;
        width: 30px !important;
        height: 30px !important;
        background: white !important;
        border: 1px solid #ddd !important;
        border-radius: 4px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 16px !important;
        color: #666 !important;
        transition: all 0.2s ease !important;
        z-index: 1002 !important; /* Z-index ainda maior */
        flex-shrink: 0 !important; /* Não encolhe */
        margin: 0 !important;
        pointer-events: auto !important; /* Garante que eventos de ponteiro funcionem */
        user-select: none !important; /* Evita seleção de texto */
        touch-action: manipulation !important; /* Melhora a responsividade em dispositivos móveis */
        outline: none !important; /* Remove outline padrão do button */
        font-family: inherit !important; /* Herda a fonte */
    }

    /* Alinhamento específico para o botão de fullscreen */
    .leaflet-control-fullscreen {
        position: relative !important;
        align-self: flex-end !important;
        margin: 0 !important;
    }

    /* Container específico para agrupar fullscreen e toggle */
    .leaflet-top.leaflet-right {
        align-items: flex-end !important;
    }

    /* Garante que fullscreen e toggle fiquem juntos */
    .leaflet-control-fullscreen,
    .layers-toggle-btn {
    margin-right: 2px !important; /* alinhado com fullscreen */
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .layers-toggle-btn:hover {
        background: #f8f9fa !important;
        color: #333 !important;
        transform: translateY(-1px) !important;
    }

    .layers-toggle-btn.active {
        background: #007bff !important;
        color: white !important;
        border-color: #007bff !important;
    }

    /* Z-index para o menu de download aparecer acima do mapa */
    .dropdown-menu,
    .btn-group .dropdown-menu,
    [class*="dropdown"] .dropdown-menu {
        z-index: 1050 !important;
    }

    /* Especificamente para o botão de download e seu menu */
    .btn-group,
    .dropdown {
        z-index: 1050 !important;
    }

    /* Para garantir que dropdowns apareçam acima do mapa em mobile */
    @media (max-width: 768px) {
        .dropdown-menu,
        .btn-group .dropdown-menu,
        [class*="dropdown"] .dropdown-menu {
            z-index: 1100 !important;
            position: fixed !important;
        }
        
        .btn-group,
        .dropdown {
            z-index: 1100 !important;
        }
    }

    /* Tamanho compacto e uniforme para TODOS os controles quando visíveis */
    .leaflet-top.leaflet-right.show-layers .leaflet-control.leaflet-control-layers,
    .leaflet-top.leaflet-right.show-layers .leaflet-control-layers-granular,
    .leaflet-top.leaflet-right.show-layers .leaflet-control-additional-layer {
        width: 120px !important; /* Tamanho mais compacto */
        max-width: 120px !important;
        min-width: 120px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        align-self: flex-end !important;
        transform: none !important; /* Remove transformações */
    }

    /* Remove container duplicado do controle base - mantém apenas um container */
    .leaflet-top.leaflet-right.show-layers .leaflet-control.leaflet-control-layers {
        width: 120px !important; /* Tamanho mais compacto */
        max-width: 120px !important;
        min-width: 120px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        align-self: flex-end !important;
        transform: none !important; /* Remove transformações */
    }

    /* Remove container duplicado do controle base - mantém apenas um container */
    .leaflet-top.leaflet-right .leaflet-control.leaflet-control-layers {
        background: white !important;
        border-radius: 6px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
        border: 1px solid #ddd !important;
        padding: 6px !important;
        width: 120px !important;
        max-width: 120px !important;
        min-width: 120px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        align-self: flex-end !important;
        transform: none !important;
    }

    /* Remove estilização do conteúdo interno para evitar duplicação */
    .leaflet-top.leaflet-right .leaflet-control.leaflet-control-layers .leaflet-control-layers-list {
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        width: auto !important;
        max-width: none !important;
        min-width: auto !important;
        box-sizing: content-box !important;
    }

    .leaflet-top.leaflet-right .leaflet-control.leaflet-control-layers label {
        font-size: 11px !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin-bottom: 3px !important;
    }

    /* Controle granular compacto */
    .leaflet-top.leaflet-right .leaflet-control-layers-granular {
        width: 120px !important;
        max-width: 120px !important;
        min-width: 120px !important;
        padding: 6px !important;
        background: white !important;
        border-radius: 6px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
        border: 1px solid #ddd !important;
    }

    .leaflet-top.leaflet-right .leaflet-control-layers-granular .layers-control-title {
        font-size: 11px !important;
        padding: 4px 6px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .leaflet-top.leaflet-right .leaflet-control-layers-granular .layer-group-header {
        padding: 3px 6px !important;
    }

    .leaflet-top.leaflet-right .leaflet-control-layers-granular .layer-name {
        font-size: 10px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .leaflet-top.leaflet-right .leaflet-control-layers-granular .layer-value-item {
        padding: 3px 6px !important;
    }

    .leaflet-top.leaflet-right .leaflet-control-layers-granular .layer-value-item label span {
        max-width: 80px !important;
        font-size: 10px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Controle adicional compacto */
    .leaflet-top.leaflet-right .leaflet-control-additional-layer {
        width: 120px !important;
        max-width: 120px !important;
        min-width: 120px !important;
        padding: 6px !important;
        background: white !important;
        border-radius: 6px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
        border: 1px solid #ddd !important;
    }

    .leaflet-top.leaflet-right .leaflet-control-additional-layer .layer-control-header {
        padding: 4px 6px !important;
    }

    .leaflet-top.leaflet-right .leaflet-control-additional-layer .layer-name {
        font-size: 10px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Botão de maximizar compacto e próximo ao zoom */
    .leaflet-control-fullscreen {
        order: -1 !important;
        margin: 0 !important;
        align-self: flex-end !important;
    }

    .leaflet-control-fullscreen a {
        width: 26px !important;
        height: 26px !important;
        line-height: 24px !important;
        font-size: 14px !important;
        background: white !important;
        border-radius: 4px !important;
        box-shadow: 0 1px 5px rgba(0,0,0,0.4) !important;
    }

    /* Botões de zoom compactos */
    .leaflet-control-zoom a {
        width: 26px !important;
        height: 26px !important;
        line-height: 24px !important;
        font-size: 14px !important;
    }

    /* Toggle do controle de camadas */
    .leaflet-control-layers-toggle {
        width: 26px !important;
        height: 26px !important;
        line-height: 26px !important;
    }
}

/* ===================================== */
/* [A] Controle de CAMADAS ADICIONAIS
   -> Estilos extras para exibir/ocultar camadas adicionais personalizadas. (escopado) */
/*     Conteúdo proveniente de stilo_c_adicional_publicados.css         */
/* ===================================== */

/* Container do controle adicional */
.leaflet-control-additional-layer {
    background: white !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    border: 1px solid #ddd !important;
    margin-left: auto !important;
    margin-right: 10px !important;
    min-width: 200px !important;
    max-width: 200px !important;
    padding: 2px 2px !important;
}

/* Ajuste específico para telas pequenas - remove margens que causam desalinhamento */
@media (max-width: 768px) {
    .leaflet-control-additional-layer {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

.additional-layer-control { padding: 0 !important; }

/* Cabeçalho do controle adicional */
.leaflet-control-additional-layer .layer-control-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 12px !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
    border-radius: 6px !important;
}
.leaflet-control-additional-layer .layer-control-header:hover { background: #f8f9fa !important; }

.leaflet-control-additional-layer .layer-control-info { display: flex !important; align-items: center !important; gap: 8px !important; flex: 1 !important; }
.leaflet-control-additional-layer .layer-control-info i { color: #6c757d !important; font-size: 14px !important; }

.leaflet-control-additional-layer .layer-name { font-size: 12px !important; font-weight: 100 !important; color: #495057 !important; margin: 0 !important; }

/* Toggle switch do controle adicional */
.leaflet-control-additional-layer .layer-control-toggle { position: relative !important; }
.leaflet-control-additional-layer .layer-control-toggle input[type="checkbox"] { display: none !important; }

.leaflet-control-additional-layer .toggle-switch {
    display: inline-block !important;
    width: 28px !important;
    height: 14px !important;
    background: #ccc !important;
    border-radius: 10px !important;
    position: relative !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
}
.leaflet-control-additional-layer .toggle-switch::before {
    content: '' !important;
    position: absolute !important;
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    background: white !important;
    top: 1px !important;
    left: 1px !important;
    transition: transform 0.3s ease !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}
.leaflet-control-additional-layer .layer-control-toggle input[type="checkbox"]:checked + .toggle-switch { background: #007bff !important; }
.leaflet-control-additional-layer .layer-control-toggle input[type="checkbox"]:checked + .toggle-switch::before { transform: translateX(14px) !important; }

/* Descrição (oculta por padrão) */
.leaflet-control-additional-layer .layer-description { display: none !important; }
.leaflet-control-additional-layer .layer-description small { color: #6c757d !important; font-size: 10px !important; line-height: 1.4 !important; }

/* Labels das camadas adicionais */
.additional-layer-label { background: transparent !important; border: none !important; box-shadow: none !important; }
.additional-layer-label span { display: block !important; white-space: nowrap !important; pointer-events: none !important; user-select: none !important; }

/* Popup das camadas adicionais */
.additional-layer-popup { min-width: 300px !important; }
.additional-layer-popup h4 { margin: 0 0 10px 0 !important; color: #495057 !important; font-size: 14px !important; font-weight: 600 !important; border-bottom: 1px solid #dee2e6 !important; padding-bottom: 5px !important; }
.additional-layer-popup .popup-properties { max-height: 200px !important; overflow-y: auto !important; }
.additional-layer-popup .popup-property { margin-bottom: 5px !important; font-size: 12px !important; line-height: 1.4 !important; }
.additional-layer-popup .popup-property strong { color: #495057 !important; margin-right: 5px !important; }

/* Estados do bloco adicional */
.leaflet-control-additional-layer.layer-visible { border-left: 3px solid #28a745 !important; }
.leaflet-control-additional-layer.layer-hidden  { opacity: 0.7 !important; }

/* Animação de entrada */
.leaflet-control-additional-layer { animation: slideInRight 0.3s ease !important; }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px);} to { opacity: 1; transform: translateX(0);} }

/* Responsividade do controle adicional */
@media (max-width: 768px) {
    .leaflet-control-additional-layer { min-width: 100px !important; max-width: 100px !important; padding: 2px 2px !important; }
    .leaflet-control-additional-layer .layer-control-header { padding: 8px 10px !important; }
    .leaflet-control-additional-layer .layer-name { font-size: 11px !important; }
    .leaflet-control-additional-layer .toggle-switch { width: 36px !important; height: 18px !important; }
    .leaflet-control-additional-layer .toggle-switch::before { width: 14px !important; height: 14px !important; top: 2px !important; left: 2px !important; }
    .leaflet-control-additional-layer .layer-control-toggle input[type="checkbox"]:checked + .toggle-switch::before { transform: translateX(18px) !important; }
}

/* Integração — posição relativa aos demais controles */
.leaflet-top.leaflet-right .leaflet-control-additional-layer { order: 10 !important; }

/* Acessibilidade (escopada) */
.leaflet-control-additional-layer .layer-control-header:focus { outline: 2px solid #007bff !important; outline-offset: 2px !important; }
.leaflet-control-additional-layer .toggle-switch:focus { outline: 2px solid #007bff !important; outline-offset: 2px !important; }

/* Indicadores visuais (escopados) */
.leaflet-control-additional-layer .layer-control-info i.fa-layer-group { color: #007bff !important; }
.leaflet-control-additional-layer .layer-control-header.active { background: #e3f2fd !important; }

/* Scrollbar personalizada para popup do adicional */
.additional-layer-popup .popup-properties::-webkit-scrollbar { width: 4px !important; }
.additional-layer-popup .popup-properties::-webkit-scrollbar-track { background: #f1f1f1 !important; border-radius: 2px !important; }
.additional-layer-popup .popup-properties::-webkit-scrollbar-thumb { background: #c1c1c1 !important; border-radius: 2px !important; }
.additional-layer-popup .popup-properties::-webkit-scrollbar-thumb:hover { background: #a8a8a8 !important; }

/* Modal de configuração das camadas adicionais */
.modal-large { max-width: 800px !important; }
.additional-layers-list { min-height: 60px !important; border: 1px solid #dee2e6 !important; border-radius: 4px !important; padding: 15px !important; background: #f8f9fa !important; }
.additional-layers-list .empty-layers { text-align: center !important; color: #6c757d !important; }
.additional-layers-list .empty-layers i { font-size: 24px !important; margin-bottom: 10px !important; color: #adb5bd !important; }
.additional-layers-list .empty-layers p { margin: 5px 0 !important; font-weight: 500 !important; }
.additional-layers-list .empty-layers small { font-size: 11px !important; }

.file-upload-area { border: 2px dashed #dee2e6 !important; border-radius: 6px !important; padding: 30px !important; text-align: center !important; cursor: pointer !important; transition: all 0.3s ease !important; background: #fafbfc !important; }
.file-upload-area:hover { border-color: #007bff !important; background: #f0f8ff !important; }
.file-upload-area i { font-size: 32px !important; color: #6c757d !important; margin-bottom: 10px !important; }
.file-upload-area p { margin: 0 !important; color: #495057 !important; font-weight: 500 !important; }
.file-upload-area input[type="file"] { display: none !important; }

/* Lista de camadas adicionais (itens) */
.additional-layer-item { display: flex !important; align-items: center !important; justify-content: space-between !important; padding: 10px !important; border: 1px solid #dee2e6 !important; border-radius: 4px !important; margin-bottom: 8px !important; background: white !important; }
.additional-layer-item:last-child { margin-bottom: 0 !important; }
.layer-item-info { flex: 1 !important; }
.layer-item-name { font-weight: 500 !important; color: #495057 !important; margin-bottom: 2px !important; }
.layer-item-description { font-size: 11px !important; color: #6c757d !important; }
.layer-item-actions { display: flex !important; gap: 5px !important; }
.btn-icon { width: 28px !important; height: 28px !important; padding: 0 !important; display: flex !important; align-items: center !important; justify-content: center !important; border-radius: 4px !important; font-size: 12px !important; }









/* Novo container para agrupar fullscreen e toggle */
.leaflet-action-buttons {
    display: flex !important;
    flex-direction: column !important; /* fullscreen em cima, toggle embaixo */
    gap: 3px !important;
    align-items: flex-end !important;
}


/* Garante que fullscreen e toggle fiquem exatamente alinhados em coluna */
.leaflet-action-buttons {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important; /* alinha pela borda direita */
    gap: 4px !important; /* pequeno espaço entre eles */
}

.leaflet-control-fullscreen,
.layers-toggle-btn {
    margin-right: 2px !important; /* mesmo recuo da borda */
}


/* Padroniza fullscreen e toggle para ficarem exatamente alinhados */
.leaflet-control-fullscreen a,
.layers-toggle-btn {
    width: 30px !important;
    height: 30px !important;
    margin-right: 2px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}


/* Correção final: remove diferenças de padding/line-height */
.leaflet-control-fullscreen a,
.layers-toggle-btn {
    width: 30px !important;
    height: 30px !important;
    margin-right: 2px !important;
    padding: 0 !important;
    line-height: normal !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}


/* Força o botão toggle a usar o mesmo recuo lateral (direita) dos controles Leaflet */
.leaflet-right .layers-toggle-btn {
    margin-right: 10px !important; /* igual ao .leaflet-right .leaflet-control */
}


/* ===============================
   PUBLICADOS_STYLES.CSS
   =============================== */


/* Reset e base
   -> Normalização global e estilos básicos de tipografia e layout. */
/* Reset global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* Container principal - ocupa toda a tela */
.main-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

/* Navegação
   -> Abas de navegação (tabs) no topo da interface. */
.nav-tabs {
    background: white;
    border-radius: 12px 12px 0 0;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 0;
    display: flex;
    list-style: none;
}

.nav-item {
    margin-right: 10px;
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: 15px 25px;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.nav-tabs .nav-link:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

.nav-tabs .nav-link.active {
    color: #007bff;
    background-color: #e3f2fd;
    border-bottom: 3px solid #007bff;
}

/* Conteúdo principal
   -> Área central da página, inclui cabeçalho e ações. - ocupa espaço restante */
.content-area {
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Cabeçalho da página */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.page-subtitle {
    color: #6c757d;
    font-size: 14px;
    margin-top: 5px;
}

.page-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Filtros
   -> Área de seleção de mapas e filtros adicionais. */
.filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.map-selector {
    max-width: 500px;
}

.map-selector label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
}

.map-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    background-color: white;
    color: #495057;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.map-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.map-select option {
    padding: 10px;
}

/* Container do mapa selecionado - ocupa espaço restante */
.selected-map-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.no-map-selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.no-map-selected h3 {
    margin-bottom: 10px;
    color: #495057;
}

.no-map-selected p {
    font-size: 14px;
}

/* Container dos mapas
   -> Cards e grades de mapas exibidos. */
.maps-container {
    display: grid;
    gap: 30px;
}

/* Card do mapa - ocupa todo o espaço disponível */
.map-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.map-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Cabeçalho do mapa
   -> Título, metadados e botões de ação em cada card. */
.map-header {
    background: linear-gradient(135deg, #6366f1, #00bcd4); /* gradiente azul/roxo */
    border: 2px solid;
    border-image: linear-gradient(135deg, #6366f1, #00bcd4) 1;
    backdrop-filter: blur(10px);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.map-info h3 {
    font-size: 18px;
    font-weight: 700;              /* mais forte */
    color: #111;                   /* preto mais intenso */
    margin-bottom: 8px;
}

.map-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #fff;                   /* branco */
}

.map-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.map-actions {
    position: relative;
    z-index: 300;
}

/* Botão de download com dropdown */
.download-dropdown {
    position: relative;
    display: inline-block;
}

.btn-download {
    background-color: #007bff;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    z-index: 301;
}

.btn-download:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 6px;
    z-index: 302;
    right: 0;
    top: 100%;
    margin-top: 2px;
    border: 1px solid #e9ecef;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
    background-color: #f8f9fa;
}

.dropdown-content a:first-child {
    border-radius: 6px 6px 0 0;
}

.dropdown-content a:last-child {
    border-radius: 0 0 6px 6px;
}

/* CORREÇÃO: Dropdown permanece visível quando hover no botão OU no conteúdo */
.download-dropdown:hover .dropdown-content,
.dropdown-content:hover {
    display: block;
}

/* Garantir que não há gap entre botão e dropdown */
.download-dropdown {
    position: relative;
    display: inline-block;
}

.download-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 301;
}


.map-canvas {
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
}

.map-canvas > div {
    height: 100% !important;
    width: 100% !important;
}

.map-sidebar {
    background: #f8f9fa;
    border-left: 1px solid #e9ecef;
    padding: 20px;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 25px;
}

.sidebar-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-section h4 i {
    color: #007bff;
}

/* Atributos visíveis */
.attribute-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.attribute-item:last-child {
    border-bottom: none;
}

.attribute-name {
    font-weight: 500;
    color: #333;
}

.attribute-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-ativo {
    background-color: #d4edda;
    color: #155724;
}

.status-inativo {
    background-color: #f8d7da;
    color: #721c24;
}

.status-coloracao {
    background-color: #cce5ff;
    color: #004085;
}

/* Checkbox customizado */
.custom-checkbox {
    position: relative;
    display: inline-block;
    margin-right: 10px;
}

.custom-checkbox input[type="checkbox"] {
    opacity: 0;
    position: absolute;
}

.custom-checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #333;
}

.custom-checkbox label::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 8px;
    transition: all 0.3s ease;
}

.custom-checkbox input[type="checkbox"]:checked + label::before {
    background-color: #007bff;
    border-color: #007bff;
}

.custom-checkbox input[type="checkbox"]:checked + label::after {
    content: '✓';
    position: absolute;
    left: 4px;
    top: 1px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Legenda
   -> Estilos para legenda de cores dos mapas. */
.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 10px;
    border: 1px solid #ddd;
}

/* Loading
   -> Indicadores de carregamento da interface. */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #6c757d;
}

/* Responsivo */
@media (max-width: 768px) {
    .selected-map-container,
    .map-card,
    .map-content {
        height: 100%;       /* força ocupar toda altura do container */
        flex: 1;            /* garante crescimento proporcional */
    }

 
    .map-canvas {
        flex: 1;              /* ocupa todo espaço disponível */
        min-height: 50vh;     /* nunca fica muito pequeno */
    }

    .map-sidebar {
        flex: none;           /* mantém altura automática */
        min-height: 40vh;     /* pelo menos 40% da tela */
    }
}
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .nav-item {
        margin-right: 0;
        margin-bottom: 5px;
    }
}

/* Estilo para labels das features */
.feature-label {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #333 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

.feature-label::before {
    display: none !important;
}



/* Estilos para campo de pesquisa */
.search-container {
    margin-bottom: 15px;
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fff;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-input::placeholder {
    color: #6c757d;
    font-style: italic;
}

.search-results {
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.search-result-item {
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.search-result-item:hover {
    background-color: #e9ecef;
    border-color: #007bff;
}

.search-result-item:last-child {
    margin-bottom: 0;
}

.search-no-results {
    padding: 15px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    font-size: 13px;
}

.search-highlight {
    background-color: #fff3cd !important;
    border: 2px solid #ffc107 !important;
    animation: searchPulse 1s ease-in-out;
}

@keyframes searchPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}



/* ================================
   SUBMENU DE PDFs
   -> Submenu interativo para listagem de PDFs em dropdowns.
   ================================ */

.pdf-submenu {
    position: relative;
}

.pdf-menu-item {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: background-color 0.3s ease;
    cursor: pointer;
    border-bottom: 1px solid #e9ecef;
}

.pdf-menu-item:hover {
    background-color: #f8f9fa;
}

.submenu-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.submenu-arrow.rotated {
    transform: rotate(90deg);
}

.pdf-submenu-content {
    display: none;
    position: fixed !important;
    left: auto !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background-color: white !important;
    min-width: 250px !important;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3) !important;
    border-radius: 6px !important;
    z-index: 999999 !important;
    border: 2px solid #007bff !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    padding: 5px !important;
}

.pdf-submenu-content.show {
    display: block;
}

.pdf-submenu-content a {
    color: #333;
    padding: 10px 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #f1f3f4;
    white-space: nowrap;
}

.pdf-submenu-content a:hover {
    background-color: #f8f9fa;
}

.pdf-submenu-content a:first-child {
    border-radius: 6px 6px 0 0;
}

.pdf-submenu-content a:last-child {
    border-radius: 0 0 6px 6px;
    border-bottom: none;
}

.pdf-loading {
    padding: 12px 16px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.pdf-empty {
    padding: 12px 16px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-style: italic;
}

/* Ajustar posicionamento do submenu */
/* HOVER REMOVIDO - Agora usa apenas modal */

/* Garantir que o submenu não seja cortado */
.download-dropdown {
    position: relative;
    z-index: 999998;
}

.dropdown-content {
    z-index: 999998;
    overflow: visible;
}

.pdf-submenu-content {
    z-index: 999999;
}
/* Forçar submenu PDF na frente de tudo */
.pdf-submenu-content {
    z-index: 999999 !important;
    position: fixed !important;
}

.pdf-submenu-content a {
    z-index: 999999 !important;
}

/* Garantir que dropdown principal também tenha z-index alto */
.dropdown-content {
    z-index: 999998 !important;
}



/* ================================
   MODAL DE PDFs
   -> Estilos para exibir PDFs em modal flutuante.
   ================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h3 i {
    color: #dc3545;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
}

.pdfs-list {
    padding: 0;
}

.pdf-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.pdf-item:hover {
    background-color: #f8f9fa;
}

.pdf-item:last-child {
    border-bottom: none;
}

.pdf-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.pdf-icon {
    color: #dc3545;
    font-size: 20px;
}

.pdf-details {
    flex: 1;
}

.pdf-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    word-break: break-word;
}

.pdf-size {
    font-size: 12px;
    color: #666;
}

.btn-download-pdf {
    background: #007bff;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-download-pdf:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

.loading-pdfs, .no-pdfs, .error-pdfs {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading-pdfs i {
    font-size: 24px;
    margin-bottom: 10px;
    color: #007bff;
}

.no-pdfs i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
    color: #dc3545;
}

.error-pdfs i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #dc3545;
}

.no-pdfs p, .error-pdfs p {
    margin: 0;
    font-size: 14px;
}

/* ===================================================================
   CORREÇÃO: Garante que o menu de Download apareça sobre o mapa
   =================================================================== */

/* Define um contexto de empilhamento para o cabeçalho do mapa */
.map-header {
    position: relative; /* Essencial para o z-index funcionar nos filhos */
    z-index: 1050;      /* Garante que o cabeçalho fique acima do mapa */
}

/* Aumenta o z-index do grupo de botões de download e do próprio dropdown */
.map-actions .btn-group,
.map-actions .dropdown {
    position: relative; /* Necessário para o z-index ter efeito */
    z-index: 1051;      /* Um valor maior que o do cabeçalho */
}

/* Garante que o menu dropdown tenha o maior z-index de todos */
.dropdown-menu,
.dropdown-content {
    z-index: 1052 !important; /* O !important ajuda a sobrepor estilos conflitantes */
}

/* Ajuste específico para mobile, onde o posicionamento pode ser mais complexo */
@media (max-width: 768px) {
    .dropdown-menu,
    .btn-group .dropdown-menu {
        /* Usar position: fixed em mobile pode ajudar a escapar de containers "presos" */
        position: fixed !important;
        z-index: 9999 !important; /* Um valor bem alto para garantir a sobreposição */
    }
}



/* ===================================================================
   CORREÇÃO: Garante que o mapa seja renderizado no modo normal
   =================================================================== */

.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Garante que o container principal ocupe a altura total da viewport */
}

.content-area {
    flex: 1; /* Permite que a área de conteúdo ocupe o espaço restante */
    display: flex;
    flex-direction: column;
    padding-bottom: 20px; /* Espaçamento inferior para o conteúdo */
}

.selected-map-container {
    flex: 1; /* Permite que o container do mapa ocupe o espaço restante */
    display: flex;
    flex-direction: column;
    min-height: 400px; /* Altura mínima para o mapa, ajuste conforme necessário */
}

.map-card {
    flex: 1; /* Garante que o card do mapa ocupe o espaço disponível */
    display: flex;
    flex-direction: column;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden; /* Garante que o conteúdo não transborde */
}

.map-content {
    flex: 1; /* Permite que o conteúdo do mapa (canvas + sidebar) ocupe o espaço restante */
    display: flex;
    flex-direction: row; /* Alinha o canvas e a sidebar lado a lado */
}

.map-canvas {
    flex: 1; /* Permite que o canvas do mapa ocupe o espaço restante */
    height: 100%; /* Garante que o canvas preencha a altura do map-content */
}

/* Garante que o elemento do mapa Leaflet tenha altura */
.map-canvas > div[id^="map_"] {
    height: 100%;
    width: 100%;
}

.map-sidebar {
    width: 300px; /* Largura fixa para a sidebar, ajuste conforme necessário */
    min-width: 250px; /* Largura mínima para a sidebar */
    max-width: 400px; /* Largura máxima para a sidebar */
    border-left: 1px solid #e9ecef;
    padding: 15px;
    overflow-y: auto;
    background-color: #f8f9fa;
}

/* Ajustes responsivos para o modo normal */
@media (max-width: 768px) {
    .content-area {
        padding-bottom: 10px;
    }

    .selected-map-container {
        min-height: 300px; /* Altura mínima menor para mobile */
    }

    .map-content {
        flex-direction: column; /* Sidebar abaixo do mapa em mobile */
    }

    .map-sidebar {
        width: 100%;
        height: auto; /* Altura automática para a sidebar em mobile */
        border-left: none;
        border-top: 1px solid #e9ecef;
    }
}

.linha-label {
  font-size: 12px;
  font-weight: bold;
  color: black;
  background: white;
  border: 1px solid #666;
  border-radius: 4px;
  padding: 2px 4px;
}
