:root {
  --bg-1: #fdf6e3;
  --accent: #f5f5f5;
  --panel-bg: rgba(255, 255, 255, 0.85);
  --text-color: #111;
  --btn-hover: #e0e0e0;
}
 

/* Regras globais */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at 20% 10%, rgba(245,214,186,0.1), transparent 10%), linear-gradient(180deg, var(--bg-1), #f0e8d0 60%);
}

/* Mapa */
#map {
  height: 100vh;
  width: 100%;
  position: relative;
  z-index: 0;
}

/* ocultar a caixa de info gerada pelo leaflet/qgis2web */
.info.leaflet-control,
.info.leaflet-control * ,
h2.__web-inspector-hide-shortcut__ {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#map-header {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(255, 255, 255, 0.8);
  padding: 10px 20px;
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  font-size: 24px;
  font-weight: bold;
  color: #000000;
  border-radius: 5px;
  z-index: 1000;
}

/* Botão INFO */
#stats-btn {
  position: absolute;
  top: 100px;
  left: 10px;
  z-index: 1000;
  background: var(--accent);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* efeito click */
#stats-btn:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
}

/* SVG responsivo */
#stats-btn img {
  width: 2em;    
  height: 2em;   
  max-width: 40px; /* limitador */
  max-height: 40px;
  display: block;
}
/* painel lateral */
#stats-panel {
  position: absolute;
  top: 90px;
  left: 10px;
  width: 360px;
  max-width: 520px;
  max-height: 70vh;
  padding: 24px;
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  background: white;
  color: black;
  border-radius: 12px;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 0 30px rgba(0,0,0,0.05);
  backdrop-filter: blur(6px);
  z-index: 3000;
}

/* Cabeçalhos e textos */
#stats-panel h2, #stats-panel h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px 0;
}
#stats-panel p, #stats-panel li {
  font-size: 14px;
  line-height: 1.6;
}

/* Botões internos do painel */
#stats-panel button {
  background: var(--accent);
  border: 1px solid #ccc;
  color: var(--text-color);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease;
}
#stats-panel button:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
}

/* Scroll moderno */
#stats-panel::-webkit-scrollbar {
  width: 8px;
}
#stats-panel::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
#stats-panel::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.1);
}

/* Canvas interno */
#stats-panel canvas { 
  background: transparent;
  border-radius: 6px; 
}

/* Responsividade */
@media (max-width:900px){
  #stats-btn{ left:12px; top:6vh; padding:10px 12px; }
  #stats-panel{ left:8px; width: calc(100% - 16px); top: 60px; max-height: 60vh; border-radius:8px; }
}

/* Classe utilitária */
.hidden { display: none !important; }

/* Logo fixa fora do painel */
#logo-link {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 2000; /* acima do painel */
  display: inline-block;
  pointer-events: auto;
}
#logo-link img#map-logo {
  width: 110px;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0.95;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.12));
}

/* sobrescreve o ícone padrão do Leaflet */
.leaflet-control-layers-toggle {
  width: 34px;
  height: 34px;
  background-image: url("../images/layers1.svg") !important; /* sobe uma pasta */
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 28px 28px !important;
  background-color: transparent !important;
  border: none !important;
  display: inline-block;
  box-sizing: border-box;
}


.leaflet-control-measure-toggle {
  display: none !important;
}

/* Responsivo logo */
@media (max-width:700px){
  #logo-link{ left: 8px; bottom: 8px; }
  #logo-link img#map-logo{ width: 80px; }
}
/*Git logo*/
#github-link{
  position:fixed;
  left:50%;
  bottom:16px;
  transform:translateX(-50%);
  z-index:10000;
  display:inline-block;
  text-decoration:none;
}
#github-logo{
  width:44px;
  height:44px;
  display:block;
  object-fit:contain;
  background: rgba(255,255,255,0.92);
  padding:6px;
  border-radius:8px;
  border:1px solid #333;
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}
#github-link:focus #github-logo,
#github-link:hover #github-logo{
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.14);
  border-color: rgba(3,102,214,0.18);
}
@media (max-width:480px){
  #github-logo{ width:38px; height:38px; padding:5px; bottom:12px; }
}

/* Barra de escala personalizada */
.scale-control {
  position: fixed;
  bottom: 16px;       /* mesma altura do logo do GitHub */
  left: calc(50% - 190px); /* mais para a esquerda do logo */
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #333;
  border-radius: 6px;
  padding: 6px 10px;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  z-index: 1000;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.scale-bar {
  height: 8px;
  min-width: 100px;
  margin-bottom: 2px;
  border: 1px solid #333;
  display: flex;
  background: linear-gradient(90deg, 
    #000000 0%, #000000 25%,     /* Primeiro quarto - preto */
    #ffffff 25%, #ffffff 50%,    /* Segundo quarto - branco */
    #000000 50%, #000000 75%,    /* Terceiro quarto - preto */
    #ffffff 75%, #ffffff 100%    /* Quarto quarto - branco */
  );
}

.scale-text {
  text-align: center;
  color: #333;
  margin: 0;
}

/* Responsividade */
@media (max-width: 768px) {
  .scale-control {
    bottom: 12px;
    left: calc(50% - 120px);
    font-size: 11px;
    padding: 4px 8px;
  }
  
  .scale-bar {
    min-width: 80px;
    height: 6px;
  }
}


#coords {
  position: fixed;
  bottom: 16px;       /* mesma altura do logo do GitHub */
  left: calc(50% + 60px); /* desloca para a direita do logo */
  background: white;
  padding: 6px 10px;
  border: 1px solid #333;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  pointer-events: none;
  z-index: 1000;
}
/* Gráficos internos */
.chart-section { position: relative; margin-bottom: 20px; }
.chart-section h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.expand-btn {
  width: 18px; height: 18px;
  cursor: pointer; opacity: 0.7;
  transition: opacity 0.2s ease;
}
.expand-btn:hover { opacity: 1; }

/* Overlay de gráfico expandido */
.chart-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 5000;
}
.chart-overlay canvas {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  max-width: 90%;
  max-height: 80%;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

#stats-summary p {
  margin: 4px 0;
  font-weight: 500;
}