/* Reset e estilos base */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Source Sans Pro', Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* Header fixo */
header {
  width: 100%; height: 60px; background-color: #003f7d; color: #fff;
  display: flex; align-items: center; padding: 0 1rem;
  position: fixed; top: 0; left: 0; z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
header img.logo { height: 40px; margin-right: 1rem; }
header h1 { font-size: 1.2rem; font-weight: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


#map {
  height: 100%;
  min-height: 300px;   /* mantém um mínimo confortável */
  flex-grow: 1;
}

.map-error { padding: 1rem; color: #d32f2f; text-align: center; }

.profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.profile-chart-container { height: 180px; position: relative; }

/* Menu hamburger */
.hamburger {
  margin-left: auto; background: none; border: none; color: #fff; font-size: 1.5rem;
  cursor: pointer; padding: 0.5rem; display: flex; align-items: center; justify-content: center;
  z-index: 1001; transition: transform 0.3s ease;
}
.hamburger.is-active { transform: rotate(90deg); }

/* Menu lateral colapsável */
nav#sideMenu {
  width: 250px; background-color: #003f7d; color: #fff; height: 100vh;
  position: fixed; top: 0; left: 0; transform: translateX(-100%);
  transition: transform 0.3s ease; z-index: 999; overflow-y: auto;
}
nav#sideMenu.open { transform: translateX(0); }
nav#sideMenu ul { list-style: none; margin-top: 60px; }
nav#sideMenu ul li a {
  display: block; padding: 0.8rem 1rem; text-decoration: none; color: #fff; border-bottom: 1px solid #222;
}
nav#sideMenu ul li a:hover { background-color: #0052a4; }

/* Conteúdo principal */
.main-content { margin-top: 60px; padding: 1rem; transition: margin-left 0.3s ease-in-out; }
.main-content.shifted { margin-left: 250px; }
@media (max-width: 768px) {
  .main-content.shifted { margin-left: 0; }
  nav#sideMenu { width: 80%; }
}

/* Containers */
.container {
  background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05); display: flex; flex-direction: column;
}
.container h3 {
  margin-bottom: 1rem; color: #003f7d; border-bottom: 1px solid #eee; padding-bottom: 0.5rem;
}

/* Loading overlay */
.loading-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%;
  background: rgba(255,255,255,0.8); display: none; justify-content: center; align-items: center; z-index: 2000;
}
.loading-content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.loading-text { font-size: 1.5rem; margin-bottom: 1rem; }
.spinner {
  border: 4px solid rgba(0, 63, 125, 0.1); border-radius: 50%;
  border-top: 4px solid #003f7d; width: 40px; height: 40px; animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Formulários */
form { display: grid; gap: 0.8rem; }
label { display: block; margin-bottom: 0.3rem; font-weight: 600; font-size: 0.9rem; }
select, input { width: 100%; padding: 0.5rem; border: 1px solid #ddd; border-radius: 4px; font-family: inherit; }
button[type="submit"] {
  background-color: #003f7d; color: white; border: none; padding: 0.7rem 1rem; border-radius: 4px;
  cursor: pointer; margin-top: 0.5rem; font-weight: 600; transition: background-color 0.2s;
}
button[type="submit"]:hover { background-color: #0052a4; }

/* Stat cards */
.stat-card { background: #f8f9fa; padding: 0.8rem; border-radius: 4px; margin-bottom: 0.8rem; font-size: 0.9rem; }
.stat-card strong { font-size: 1.1rem; color: #003f7d; }

/* Elementos interativos */
.top-neighborhood, .top-hour { cursor: pointer; color: #003f7d; text-decoration: underline dotted; font-weight: 600; }

/* Responsividade */
@media (max-width: 768px) {
  .container { min-width: 100%; }
  header h1 { font-size: 1rem; }
}
