/* Importando uma fonte mais moderna */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap');

:root {
    --primary-color: #2c5d63; /* Verde escuro, cor de floresta */
    --secondary-color: #4a9d9c; /* Verde mais claro, cor de água */
    --background-color: #f0f4f8; /* Fundo levemente azulado/acinzentado */
    --card-background: #ffffff;
    --text-color: #333333;
    --header-text-color: #ffffff;
}

body { font-family: 'Roboto', sans-serif; line-height: 1.6; margin: 0; padding: 0; background-color: var(--background-color); color: var(--text-color); }
header { background: linear-gradient(45deg, var(--primary-color), var(--secondary-color)); color: var(--header-text-color); padding: 2rem 1rem; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
header h1 { margin: 0; font-weight: 700; }
.container { max-width: 1100px; margin: auto; overflow: auto; padding: 0 2rem; }
#main-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; padding: 2rem 0; }

.search-container {
    margin: 1rem 0;
}

#searchInput {
    width: 100%;
    padding: 12px 20px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 25px;
    box-sizing: border-box;
    transition: box-shadow 0.3s ease;
}

.card-link {
  text-decoration: none;
  color: inherit;
}

.region-card { background: var(--card-background); border-left: 5px solid var(--primary-color); border-radius: 8px; padding: 1.5rem; box-shadow: 0 4px 8px rgba(0,0,0,0.08); transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out; }
.region-card:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0,0,0,0.15); }
.region-card h3 { color: var(--primary-color); margin-top: 0; font-size: 1.5rem; }
.data-point { display: flex; align-items: center; margin-bottom: 0.8rem; }
.data-point i { color: var(--secondary-color); margin-right: 12px; font-size: 1.3em; width: 25px; text-align: center; }
.data-point p { margin: 0; }
.data-point span { font-weight: 700; color: var(--primary-color); }
.source-info { font-style: italic; color: #777; font-size: 0.9em; margin-top: 1.5rem; border-top: 1px solid #eee; padding-top: 0.5rem; }

/* Estilos do Rodapé */
footer { background: #343a40; color: #f8f9fa; padding: 3rem 1rem 1rem; margin-top: 3rem; }

.footer-container {
    max-width: 1100px;
    margin: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-about, .footer-social { flex: 1; min-width: 280px; }

.footer-about h3, .footer-social h3 {
    color: var(--secondary-color);
    border-bottom: 2px solid var(--secondary-color);
    display: inline-block;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.footer-social a { color: #fff; font-size: 1.8rem; margin-right: 1.5rem; transition: color 0.3s; text-decoration: none; }
.footer-social a:hover { color: var(--secondary-color); }

.footer-bottom {
    text-align: center;
    border-top: 1px solid #495057;
    padding-top: 1.5rem;
    font-size: 0.9rem;
    color: #ced4da;
}

/* Estilo para o container do mapa */
#map {
    height: 450px;
    width: 100%;
    margin-top: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Estilo para o container do gráfico */
.chart-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

/* Animação de Carregamento (Spinner) */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 0;
    flex-direction: column;
    gap: 1rem;
    color: var(--primary-color);
}

.spinner {
    border: 5px solid #f3f3f3; /* Cinza claro */
    border-top: 5px solid var(--primary-color); /* Cor primária */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

/* Botão Voltar ao Topo */
#backToTop {
    display: none; /* Oculto por padrão */
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    font-size: 1.2rem;
    border: none;
    outline: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    padding: 1rem;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: background-color 0.3s, transform 0.3s;
}

#backToTop:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}