body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: #1e1e2f;
    color: white;
  }
  
  #map { 
    position: absolute; 
    top: 0; 
    right: 0; 
    bottom: 0; 
    left: 400px; 
  }
  
  #sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    background: rgba(30, 30, 48, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid #444;
    box-shadow: 2px 0 8px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
  }
  
  .sidebar-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #444;
  }
  
  h1 { 
    font-size: 20px; 
    margin-bottom: 20px; 
    color: #00c2ff; 
  }
  
  h2 { 
    font-size: 16px; 
    color: #00ff88; 
    margin-top: 0; 
    margin-bottom: 15px; 
  }
  
  label { 
    font-weight: bold; 
    display: block; 
    margin-top: 15px; 
  }
  
  select, input, button {
    width: 100%;
    padding: 8px;
    margin-top: 6px;
    margin-bottom: 12px;
    background: #2b2b3d;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
  }
  
  button { 
    background: #00c2ff; 
    font-weight: bold;
    transition: all 0.3s;
  }
  
  button:hover { 
    background: #00aadd; 
    transform: translateY(-1px); 
  }
  
  .analytics-button {
    background: #4a5a7a;
    margin: 5px 0;
  }
  
  .analytics-button:hover {
    background: #5d6f96;
  }
  
  .popup-content { 
    font-size: 14px; 
  }
  
  .popup-header { 
    font-size: 16px; 
    font-weight: bold; 
    margin-bottom: 8px; 
  }
  
  .contained { 
    color: #00ff88; 
  } 
  
  .nearest { 
    color: #ffaa00; 
  }
  
  .leaflet-popup-content-wrapper {
    background: rgba(255,255,255,0.05); 
    color: white;
    backdrop-filter: blur(8px); 
    border-radius: 8px; 
    padding: 12px;
  }
  
  .param-button {
    background: #394865;
    border: 1px solid #4a5a7a;
    margin-bottom: 8px;
    cursor: pointer;
    width: 100%;
  }
  
  .param-button:hover {
    background: #49629c;
  }
  
  #chartContainer {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 500px;
    max-width: 90%;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 10px;
    padding: 20px;
    z-index: 9999;
    display: none;
    box-shadow: 0 0 20px rgba(0,0,0,0.7);
    border: 1px solid #444;
  }
  
  #chartContainer canvas { 
    width: 100%; 
    height: 300px; 
  }
  
  #chartClose {
    position: absolute;
    top: 6px;
    right: 10px;
    color: white;
    font-size: 20px;
    cursor: pointer;
  }
  
  #analyticsResults {
    background: #2b2b3d;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
  }
  
  .result-item {
    margin: 5px 0;
    padding: 5px;
    border-bottom: 1px solid #444;
  }
  
  .toggle-section {
    cursor: pointer;
    user-select: none;
  }
  
  .toggle-section::after {
    content: "▼";
    float: right;
    transition: transform 0.3s;
  }
  
  .toggle-section.collapsed::after {
    transform: rotate(-90deg);
  }
  
  .collapsible {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
  }
  
  .collapsed-content {
    max-height: 0;
  }
  
  .expanded-content {
    max-height: 1000px;
  }
  
  .selected-farmer-icon {
    border: 2px solid #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff88;
  }
  
  /* Update styles.css with these responsive additions */

/* Mobile menu button */
#mobileMenuBtn {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  background: rgba(30, 30, 48, 0.9);
  color: white;
  border: none;
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  text-align: center;
  line-height: 40px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

button, .param-button, .analytics-button {
  min-height: 44px; /* Recommended minimum touch target size */
}

/* Prevent text selection on buttons */
button, .toggle-section {
  user-select: none;
  -webkit-user-select: none;
}

/* Improve map popup interactions */
.leaflet-popup-content-wrapper {
  touch-action: manipulation;
}

/* Responsive layout */
@media (max-width: 768px) {
  #sidebar {
    width: 280px;
    left: -280px;
    transition: left 0.3s ease;
    z-index: 999;
    height: 100%;
    overflow-y: auto;
  }
  
  #sidebar.active {
    left: 0;
    box-shadow: 2px 0 15px rgba(0,0,0,0.7);
  }
  
  #map {
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    z-index: 1;
  }
  
  #mobileMenuBtn {
    display: block;
    z-index: 1000;
  }
  
  #chartContainer {
    width: calc(100% - 40px);
    top: 60px;
    left: 20px;
    right: 20px;
    max-width: none;
  }
  
  /* Improve button sizes for mobile */
  button, select, input {
    padding: 10px;
    font-size: 16px;
  }
  
  /* Adjust popup size */
  .leaflet-popup-content {
    width: auto !important;
    max-width: 250px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  #sidebar {
    width: 350px;
  }
  
  #map {
    left: 350px;
  }
}

@media (min-width: 1025px) and (max-width: 1440px) {
  #sidebar {
    width: 300px;
  }
  
  #map {
    left: 300px;
  }
}

@media (min-width: 1441px) {
  #sidebar {
    width: 350px;
  }
  
  #map {
    left: 350px;
  }
}

/* Adjust font sizes for smaller devices */
@media (max-width: 480px) {
  h1 {
    font-size: 18px;
  }
  
  h2 {
    font-size: 16px;
  }
  
  .popup-content {
    font-size: 12px;
  }
  
  .popup-header {
    font-size: 14px;
  }
  
  button, select, input {
    padding: 6px;
    font-size: 14px;
  }
}

/* Adjust chart container for mobile */
@media (max-width: 600px) {
  #chartContainer {
    top: 50px;
    right: 10px;
    width: calc(100% - 20px);
    padding: 10px;
  }
  
  #chartContainer canvas {
    height: 250px;
  }
}