/* =========================================
   GERAL
   ========================================= */
body {
    background-color: #f8f9fa;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

/* =========================================
   CABEÇALHO (HEADER)
   ========================================= */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header h1 {
    margin: 0;
    font-size: 2.2em;
    font-weight: 700;
}

.header p {
    margin: 10px 0 0 0;
    opacity: 0.9;
    font-size: 1.1em;
}

/* =========================================
   BARRA DE FILTROS
   ========================================= */
.filter-bar {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    border: 1px solid #e9ecef;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 0;
    white-space: nowrap;
}

.dropdown-check {
    position: relative;
}

.dropdown-check-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    min-width: 220px;
    font-size: 0.875rem;
    color: #555;
    transition: border-color 0.2s;
}

.dropdown-check-btn:hover {
    border-color: #adb5bd;
}

.dropdown-arrow {
    font-size: 0.7rem;
    color: #888;
    transition: transform 0.2s;
}

.dropdown-check.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-check-list {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 1000;
    min-width: 280px;
    padding: 8px 0;
}

.dropdown-check.open .dropdown-check-list {
    display: block;
}

.dropdown-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #444;
    transition: background 0.15s;
    margin: 0;
}

.dropdown-check-item:hover {
    background: #f1f3f5;
}

.dropdown-check-item input {
    cursor: pointer;
    margin: 0;
}

.dropdown-check-footer {
    display: flex;
    gap: 8px;
    padding: 8px 14px;
    border-top: 1px solid #f1f3f5;
    margin-top: 4px;
}

.btn-check-all {
    font-size: 0.8rem;
    color: #4a90d9;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.btn-check-all:hover {
    text-decoration: underline;
}

/* Checkboxes customizados nos filtros */
.custom-check {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    padding: 4px 8px;
    border-radius: 5px;
    transition: background 0.2s;
}

.custom-check:hover {
    background-color: #f1f3f5;
}

.custom-check input {
    margin: 0;
    cursor: pointer;
}

.dropdown-check-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid #f1f3f5;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.875rem;
    color: #555;
}

.dropdown-check-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #888;
    padding: 0 4px;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.dropdown-check-close:hover {
    background: #f1f3f5;
    color: #333;
}

/* ================
RESUMO MUNICÍPIOS
================= */
.resumo-municipio {
    position: relative;
    z-index: 0;
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.resumo-titulo {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.resumo-cards {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.resumo-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 20px;
    min-width: 120px;
}

.resumo-numero {
    font-size: 1.8rem;
    font-weight: 700;
    color: #4a90d9;
}

.resumo-label {
    font-size: 0.8rem;
    color: #888;
    margin-top: 2px;
}

/* =========================================
   MAPA
   ========================================= */
.map-container {
    position: relative;
    margin-bottom: 30px;
}

#map {
/*    height: 750px;  Altura ajustada */
    height: 500px;

    width: 100%;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1;
    position: relative;
}

/* Legenda do Mapa */
.custom-legend {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid #ddd;
}

.legend-title {
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
    color: #333;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: default;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* =========================================
   BARRA DE BUSCA
   ========================================= */
.search-box {
    margin-bottom: 25px;
}

.search-box .form-control {
    border-radius: 20px;
    padding: 10px 20px;
    border: 1px solid #ced4da;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.search-box .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* =========================================
   ACCORDION (Lista de Municípios)
   ========================================= */
.accordion-item {
    margin-bottom: 10px;
    border-radius: 8px !important;
    overflow: hidden;
    border: 1px solid #e9ecef;
    background: #fff;
}

.accordion-header {
    background: #fff;
    padding: 15px 20px;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 1.5em;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: #f8f9fa;
}

.badge-count {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
}

/* =========================================
   CARDS DAS INSTITUIÇÕES
   ========================================= */
.instituicao-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 15px;
    border-left: 5px solid #667eea; /* Cor destaque */
    transition: transform 0.2s;
}

.instituicao-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.instituicao-card h5 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.15em;
    font-weight: 700;
}

.badge {
    margin-right: 5px;
    margin-bottom: 5px;
    font-weight: 500;
}

.card-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.95em;
    align-items: center;
}

.card-label {
    font-weight: 600;
    color: #6c757d;
    min-width: 100px;
}

.card-value {
    color: #333;
}

.endereco-completo {
    background: #f8f9fa;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    margin: 12px 0;
    color: #555;
    border: 1px solid #eee;
}

#cardMunicipioSelecionado {
    position: relative;
    z-index: 0;
    pointer-events: auto;
}

/* =========================================
   UTILITÁRIOS E MAPA
   ========================================= */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* Ajustes para o Leaflet Popup */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.leaflet-popup-content {
    font-family: 'Segoe UI', sans-serif;
    line-height: 1.5;
}

/* Marcador Personalizado */
.custom-marker {
    transition: transform 0.2s;
    cursor: pointer;
}
.custom-marker:hover {
    transform: scale(1.1);
}

/* Legenda nos filtros */
.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    margin-right: 6px;
    flex-shrink: 0;
}

.custom-check {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    padding: 4px 8px;
    border-radius: 5px;
    transition: background 0.2s;
}

.custom-check:hover {
    background-color: rgba(0,0,0,0.05);
}

.custom-check input {
    margin: 0;
    cursor: pointer;
}

.header {
    background: white;  /* Fundo branco para destacar o banner */
    padding: 0;
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;  /* Para o border-radius funcionar */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header-banner {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Se quiser o título e subtítulo por cima do banner (opcional) */
.header h1, .header p {
    display: none;  /* Esconde o texto se o banner já tiver tudo */
}

.leaflet-container {
    z-index: 1;
}

.leaflet-pane {
    z-index: 2;
}

.leaflet-overlay-pane {
    z-index: 3;
}

.leaflet-marker-pane {
    z-index: 4;
}

.leaflet-popup-pane {
    z-index: 5;
}

.alert-info-container {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.alert-info-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.alert-info-content {
    flex: 1;
}

.alert-info-content strong {
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
}

.alert-info-content p {
    margin: 0 0 8px 0;
    font-size: 14px;
    opacity: 0.95;
}

.email-link {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.email-link:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.btn-exportar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    background: #217346;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    align-self: center;
}

.btn-exportar:hover {
    background: #1a5c38;
}