/* General page */
body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #ffe6e6, #fff0f5);
  color: #333;
  transition: background 0.3s, color 0.3s;
}

h1 {
  text-align: center;
  padding: 20px 0 10px 0;
  color: #800000;
  font-weight: 600;
}

/* Container */
#container {
  max-width: 1000px;
  margin: auto;
  padding: 20px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  position: relative;
  transition: background 0.3s, color 0.3s;
}

/* Dark/Light toggle */
#modeToggle {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background-color: #4a90e2;
  color: white;
  cursor: pointer;
  font-weight: 500;
  z-index: 10000;
  transition: background 0.3s;
}

#modeToggle:hover {
  background-color: #357ab8;
}

/* Controls */
#controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
  justify-content: center;
  align-items: center;
}

#controls input {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ccc;
  flex: 1 1 120px;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
}

#controls button {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background-color: #ff6666;
  color: white;
  cursor: pointer;
  font-weight: 500;
  transition: 0.3s;
}

#controls button:hover {
  background-color: #cc0000;
}

/* Main content */
#mainContent {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

#map {
  flex: 2 1 600px;
  height: 500px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: filter 0.3s;
}

#sidebar {
  flex: 1 1 300px;
  background: #fff0f5;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition: background 0.3s, color 0.3s;
}

#result {
  font-weight: 500;
  padding: 10px;
  background: #ffe6e6;
  border-radius: 8px;
  text-align: center;
  font-size: 15px;
  transition: background 0.3s, color 0.3s;
}

#alertsList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.alert-item {
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
}

.alert-item.minor { background-color: #f5c542; color: #000; }
.alert-item.moderate { background-color: #f5a742; color: #000; }
.alert-item.severe { background-color: #e54a42; color: white; }
.alert-item.extreme { background-color: #c70039; color: white; }

#extremeBtn {
  display: none;
  padding: 10px 16px;
  font-size: 15px;
  border-radius: 8px;
  border: none;
  background-color: #d93025;
  color: white;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s;
}

#extremeBtn:hover {
  background-color: #a71d1d;
}

/* Legend images */
.info.legend img { 
  vertical-align: middle; 
  margin-right: 4px; 
}

/* Dark Mode (applies to entire page) */
.dark-mode {
  background: #1f2c4d;
  color: #e0e0e0;
}
.dark-mode h1 {
  color: #ffffff;
}
.dark-mode #container {
  background: #2b3b5c;
  color: #e0e0e0;
}
.dark-mode .info.legend {
  color: #000000; /* black text */
}

.dark-mode #sidebar {
  background: #2b3b5c;
  color: #e0e0e0;
}

.dark-mode #result {
  background: #3a4b6b;
  color: #fff;
}

.dark-mode #controls button {
  background-color: #4a90e2;
  color: white;
}

.dark-mode #controls button:hover {
  background-color: #357ab8;
}

.dark-mode #extremeBtn {
  background-color: #b71c1c;
}

.dark-mode #extremeBtn:hover {
  background-color: #8b1414;
}

.dark-mode #map {
  filter: brightness(0.7);
}

/* Responsive */
@media (max-width: 900px) {
  #mainContent {
    flex-direction: column;
  }
  #map, #sidebar {
    flex: 1 1 100%;
  }
  #modeToggle {
    top: 10px;
    right: 10px;
  }
}
