* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  overflow: hidden;
}

.container {
  display: flex;
  width: 100vw;
  height: 100vh;
}

/* Map Section */
.map-section {
  flex: 1;
  background-color: #e0e0e0;
  position: relative;
}

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

/* Info Section */
.info-section {
  width: 50%;
  background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
  border-left: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
}

.info-header {
  padding: 20px;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  border-bottom: 2px solid #e74c3c;
  flex-shrink: 0;
}

.info-header h2 {
  font-size: 1.3em;
  margin-bottom: 5px;
}

.subtitle {
  font-size: 0.85em;
  opacity: 0.9;
  font-style: italic;
}

.info-content {
  flex: 1;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
}

.placeholder {
  text-align: center;
  color: #999;
  padding: 40px 20px;
  font-size: 1.1em;
}

.info-details {
  transition: all 0.3s ease;
  opacity: 1;
}

.info-details.hidden {
  display: none;
  opacity: 0;
}

.info-header-title {
  margin-bottom: 15px;
}

.info-header-title h2 {
  font-size: 1.6em;
  color: #2c3e50;
  margin: 0;
  font-weight: 700;
  border-bottom: 3px solid #e74c3c;
  padding-bottom: 10px;
}

.section-title {
  font-size: 0.95em;
  font-weight: 600;
  color: #2c3e50;
  margin-top: 15px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Row layouts */
.info-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 15px;
}

.info-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.info-card {
  background: white;
  padding: 12px;
  border-radius: 6px;
  border-left: 4px solid #e74c3c;
  background: #ffe8e8;
  text-align: center;
}

.info-card label {
  display: block;
  font-weight: 600;
  color: #555;
  font-size: 0.8em;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-card span {
  display: block;
  font-size: 1.5em;
  color: #e74c3c;
  font-weight: 700;
  word-wrap: break-word;
}

.info-item {
  background: white;
  padding: 12px;
  border-radius: 6px;
  border-left: 4px solid #3498db;
  transition: all 0.3s ease;
}

.info-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-item label {
  display: block;
  font-weight: 600;
  color: #555;
  font-size: 0.8em;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-item span {
  display: block;
  font-size: 1em;
  color: #2c3e50;
  word-wrap: break-word;
  font-weight: 600;
}

.info-item.highlight {
  border-left: 4px solid #e74c3c;
  background: #ffe8e8;
}

.info-item.highlight span {
  color: #e74c3c;
  font-weight: 700;
  font-size: 1.8em;
}

.resaltado-value {
  display: inline-block;
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  margin-top: 8px;
}

.legend {
  border-top: 1px solid #ddd;
  padding: 12px 15px;
  background: #f9f9f9;
  margin-top: auto;
  flex-shrink: 0;
}

.legend h3 {
  font-size: 0.9em;
  margin-bottom: 8px;
  color: #2c3e50;
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.9em;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  margin-right: 8px;
  flex-shrink: 0;
}

.legend-color.default {
  background-color: #3498db;
  border: 1px solid #2980b9;
}

.legend-color.selected {
  background-color: #e74c3c;
  border: 1px solid #c0392b;
}

.legend-item span {
  font-size: 0.9em;
  color: #555;
}

/* Chart Section */
.chart-section {
  background: white;
  padding: 12px;
  margin-bottom: 15px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.chart-section h3 {
  font-size: 0.95em;
  color: #2c3e50;
  margin-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#age-chart {
  display: flex;
  justify-content: center;
  overflow: auto;
}

/* Leaflet Overrides */
.leaflet-control-zoom {
  border-radius: 8px !important;
}

.leaflet-control-zoom a {
  background-color: white !important;
  color: #333 !important;
  border: 1px solid #ddd !important;
  transition: all 0.3s ease;
}

.leaflet-control-zoom a:hover {
  background-color: #3498db !important;
  color: white !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Scrollbar Styling */
.info-section::-webkit-scrollbar {
  width: 8px;
}

.info-section::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.info-section::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.info-section::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Responsive */
@media (max-width: 1024px) {
  .container {
    flex-direction: column;
  }

  .map-section {
    flex: 1;
    min-height: 50%;
  }

  .info-section {
    width: 100%;
    height: 50%;
    border-left: none;
    border-top: 1px solid #ddd;
  }
}

@media (max-width: 768px) {
  .info-section {
    width: 100%;
    height: 40%;
  }

  .map-section {
    min-height: 60%;
  }

  .info-header h2 {
    font-size: 1.1em;
  }

  .info-row {
    grid-template-columns: 1fr;
  }

  .info-row-2col {
    grid-template-columns: 1fr;
  }

  .info-item span {
    font-size: 0.9em;
  }

  .info-card span {
    font-size: 1.2em;
  }
}
