h1 {
    text-align: center;
    font-size: 3rem;
    color: white;
}

select {
    padding: 0.5rem 0.75rem;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    font-size: 1rem;
    transition: border-color 0.2s;
    color: black;
}

select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Label */
label {
    font-weight: 500;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1.2rem;
    color: black;
}

#globalChapterFilter {
    text-align:center;
    padding: 10px;
    margin: 2rem 0;
    background: #fafafa;
    border-radius: 5px;
}

#globalChapterFilter a {
    font-size: 0.9rem;
    color: white;
    text-decoration: None;
    padding: 5px;
    border-radius: 5px;
    background-color: black;
}

#chapterSelect {
    width: 400px;
    max-height: 200px;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

.filter-group {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    color: black;
}

.filter-group label {
    font-size: 15px;
}

.filter-group select {
    padding: 0;
    margin: 0;
    font-size: 15px;
    height: 30px;
}

#mapContainer {
    position: relative;
    height: 500px;
    max-width: 1100px;
    margin: auto;
}

#map {
    background: transparent;
    height: 100%;
    width: 100%;
}

.leaflet-container {
    background: transparent;
}

.leaflet-control.legend {
    background: rgba(255, 255, 255, 0.97);
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.4;
    color: #111;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}

.leaflet-control.legend strong {
    font-size: 13px;
    color: #000;
}

.leaflet-control.legend small {
    color: #444;
}

.leaflet-control.legend i {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

/* Spinner styles */
.spinnerOverlayChart {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    display: none; /* escondido por padrão */
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

#data-sources-title {
    text-align: center;
    font-size: 2rem;
}

.methodology-note {
    text-align: center;
    max-width: 800px;
    margin: 1rem auto;
    font-size: 0.9rem;
}

.data-sources {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    align-items: center;
    list-style: none;
    margin-top: 20px;
}

.data-sources li {
    margin-bottom: 0.5rem;
}

.data-sources a {
    color: white;
}

.data-sources a:hover {
    text-decoration: underline;
}

/* ================================
   RESPONSIVIDADE MOBILE
   ================================ */
@media (max-width: 768px) {

    /* Títulos */
    h1 {
        font-size: 2rem;
        padding: 0 1rem;
        text-align: center;
    }

    h2 {
        font-size: 1.4rem;
        text-align: center;
        margin-top: 2rem;
    }

    /* Labels */
    label {
        font-size: 1rem;
    }

    /* Selects */
    select {
        width: 100%;
        max-width: 100%;
        font-size: 1rem;
        padding: 0.6rem 0.75rem;
    }

    #chapterSelect {
        width: 100%;
        font-size: 0.9rem;
    }

    /* Choices.js (multiselect) */
    .choices {
        width: 100%;
    }

    .choices__inner {
        min-height: 44px;
        font-size: 0.9rem;
        padding: 6px 8px;
    }

    .choices__list--multiple .choices__item {
        font-size: 0.8rem;
    }

    /* Filtros */
    .filter-group {
        padding: 5px;
        margin-bottom: 1rem;
    }

    .filter-group label {
        font-size: 15px;
    }

    .filter-group select {
        padding: 0;
        font-size: 13px;
        height: 25px;
    }

    #globalChapterFilter {
        padding: 5px;
    }

    #globalChapterFilter a {
        display: inline-block;
        font-size: 11px;
    }

    /* Mapa */
    #mapContainer {
        height: 350px;
        padding: 0 0.5rem;
    }

    .leaflet-control.legend {
        font-size: 8px;
        padding: 5px;
    }

    .leaflet-control.legend span {
        font-size: 8px;
    }

    /* Fontes de dados */
    #data-sources-title {
        font-size: 1.5rem;
    }

    .data-sources a {
        font-size: 0.9rem;
    }

    .methodology-note {
        font-size: 0.8rem;
        padding: 0 1rem;
    }

    .data-sources {
        padding: 0 1rem;
        text-align: center;
    }
}
