/* Distribución de la Fauna de Chile */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #fafafa;
  color: #000;
  line-height: 1.6;
}

/* Layout */
.container {
  display: flex;
  height: 100vh;
}

.map-section {
  flex: 0 0 40%;
  background: white;
  border-right: 1px solid #e5e5e5;
}

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


.content-section {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

/* Header */
.header {
  margin-bottom: 1rem;
}

.header h1 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 0.9375rem;
  color: #525252;
  margin-bottom: 1rem;
  font-weight: 500;
}

/* Legend */
.legend {
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 0.625rem;
  padding: 0.75rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.legend-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.legend-gradient {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.legend-label {
  font-size: 0.6875rem;
  color: #525252;
  font-weight: 500;
  min-width: 2rem;
}

.gradient-bar {
  flex: 1;
  height: 0.5rem;
  border-radius: 0.25rem;
  background: linear-gradient(to right, #dcfce7, #86efac, #22c55e, #16a34a);
  border: 1px solid #e5e5e5;
}

.legend-description {
  font-size: 0.6875rem;
  color: #525252;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 0.75rem;
}

/* Region Cards */
.region-stat {
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 0.625rem;
  padding: 0.75rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.region-stat:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.region-stat.more-regions {
  background: #fafafa;
  border: 2px dashed #e5e5e5;
  color: #525252;
  opacity: 0.7;
  font-style: italic;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.region-stat.more-regions:hover {
  transform: none;
  opacity: 0.9;
}

.region-name {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1f2937;
  line-height: 1.2;
  min-height: 2rem;
  display: flex;
  align-items: center;
}

.region-percentage {
  font-size: 1.375rem;
  font-weight: 700;
  color: #065f46;
  margin-bottom: 0.25rem;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  text-align: center;
}

.region-animals {
  font-size: 0.75rem;
  color: #1f2937;
  font-weight: 500;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
  text-align: center;
  margin-top: auto;
}

/* Context Info */
.context-info {
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 0.625rem;
  padding: 1rem;
  margin-top: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.context-text {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.context-text:last-child {
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
  
  .map-section {
    flex: 0 0 40vh;
    border-right: none;
    border-bottom: 1px solid #e5e5e5;
  }
  
  .content-section {
    padding: 1rem;
  }
  
  .header h1 {
    font-size: 1.5rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 0.5rem;
  }
}