: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;
}

/* Botão Estatísticas */
#stats-btn {
  position: absolute;
  top: 150px;
  left: 10px;
  z-index: 1000;
  background: var(--accent);
  border: 1px solid #ccc;
  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;
}

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

/* Ajuste do ícone SVG responsivo */
#stats-btn img {
  width: 2em;    /* tamanho relativo ao botão */
  height: 2em;   /* mantém proporção quadrada */
  max-width: 40px; /* limita para não crescer demais em telas grandes */
  max-height: 40px;
  display: block;
}
/* Painel lateral moderno */
#stats-panel {
  position: absolute; /* evita criar stacking context */
  top: 90px;
  left: 10px;
  width: 360px;
  max-width: 520px;
  max-height: 70vh;
  padding: 24px;
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  background: var(--panel-bg);
  color: var(--text-color);
  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; /* acima do mapa, mas abaixo da logo fixa (se desejar a logo sempre visível) */
}

/* 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));
}

/* 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 rgba(0,0,0,0.06);
  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; }
}
/* 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;
}