.header {
  background: linear-gradient(to right, #2E7D32, #66BB6A);
  color: #fff;
  padding: 1rem;
  text-align: center;
}
.header .logo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}
.header .logo {
  font-size: 2rem;
  margin-right: 0.5rem;
}
.header .title-section h1 {
  margin: 0;
  font-size: 1.5rem;
}
.header .title-section p {
  margin: 0;
  font-size: 1rem;
}
.header .date-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  display: inline-block;
  font-size: 0.9rem;
}
.main-container {
  display: flex;
  height: calc(100vh - 60px);
}
.sidebar {
  background: #fff;
  padding: 1rem;
  width: 300px;
  border-right: 1px solid #ddd;
  overflow-y: auto;
}
.control-section {
  margin-bottom: 1.5rem;
}
.control-section h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  position: relative;
  padding-bottom: 0.3rem;
}
.control-section h3:after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: 0;
  left: 0;
  background: linear-gradient(to right, #2E7D32, #66BB6A);
}
.crop-selector {
  display: flex;
  flex-direction: column;
}
.crop-btn {
  background: #f4f4f9;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}
.crop-btn i {
  margin-bottom: 0.2rem;
}
.crop-btn.active {
  background: #2E7D32;
  color: #fff;
  border-color: #2E7D32;
}
.slider-group {
  margin-bottom: 1rem;
}
.slider-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: #ddd;
  outline: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.slider:hover {
  opacity: 1;
}
.scenario-tabs {
  display: flex;
  justify-content: space-between;
}
.scenario-tab {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  margin: 0 0.1rem;
  background: #f4f4f9;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.3s;
}
.scenario-tab.active {
  background: #2E7D32;
  color: #fff;
  border-color: #2E7D32;
}
.legend {
  background: #fff;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}
.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}
.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 0.3rem;
  margin-right: 0.5rem;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.stat-card {
  background: #f4f4f9;
  padding: 1rem;
  border-radius: 0.5rem;
  text-align: center;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}
#map {
  width: 100%;
  height: 100%;
  border-radius: 0.5rem;
}
.map-container {
  position: relative;
  width: 100%;
  height: 100vh;
}
/* Toggle points button style */
.toggle-points-btn {
  font-size: 1.15rem !important;
  font-weight: bold !important;
  background: #fff !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
  z-index: 1001 !important;
}
/* Points legend style */
#points-legend {
  pointer-events: none;
}
.info-popup {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  width: 300px;
  display: none;
}
.info-popup.show {
  display: block;
}
#yield-chart {
  width: 100%;
  height: 200px;
  margin-top: 1rem;
}
@media (max-width: 900px) {
  .main-container {
      flex-direction: column;
      height: auto;
  }
  .sidebar {
      width: 100%;
      border-right: none;
      border-bottom: 1px solid #ddd;
      padding: 0.5rem;
  }
  .map-container {
      height: 60vh;
      min-height: 300px;
  }
  #map {
      height: 100%;
      min-height: 300px;
  }
}
@media (max-width: 600px) {
  .header .logo-section {
      flex-direction: column;
      align-items: flex-start;
  }
  .header .logo {
      margin-bottom: 0.5rem;
      margin-right: 0;
  }
  .sidebar {
      padding: 0.3rem;
  }
  .legend, .stat-card, .control-section {
      padding: 0.5rem;
  }
  .info-popup {
      width: 95vw;
      left: 2.5vw;
      right: auto;
      top: 0.5rem;
      padding: 0.5rem;
  }
  #yield-chart {
      height: 120px;
  }
}
@media (max-width: 400px) {
  .info-popup {
      width: 99vw;
      left: 0.5vw;
      padding: 0.2rem;
  }
  .header .title-section h1 {
      font-size: 1.1rem;
  }
  .header .title-section p {
      font-size: 0.8rem;
  }
}
