/* Full-screen map container */
#map {
  height: 100%;
  width: 100%;
  background-color: #e5e5e5;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Shoot Button (Above Brake Button) */
#shoot-button {
  width: 80px;
  height: 80px;
  position: fixed;
  bottom: 120px; /* Positioned above brake button */
  left: 20px;
  color: white;
  font-size: 24px;
  font-weight: bold;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transition: background-color 0.3s ease-in-out;
}

/* Ready to Fire (Orange) */
.shoot-ready {
  background-color: #FFA500; /* Orange */
}

/* Not Ready to Fire (Grey) */
.shoot-not-ready {
  background-color: #808080; /* Grey */
}

/* Target Expload */
@keyframes explode {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(2); opacity: 0.7; }
  100% { transform: scale(3); opacity: 0; }
}

.explosion {
  width: 50px;
  height: 50px;
  background-color: orange;
  border-radius: 50%;
  position: absolute;
  animation: explode 1s ease-out forwards;
}




/* Joystick (RIGHT SIDE) */
#joystick-container {
  width: 150px;
  height: 150px;
  position: fixed;
  bottom: 20px;
  right: 20px; /* Forces joystick to the right */
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  z-index: 1000;
}


/* Brake button (LEFT SIDE) */
#brake-button {
  width: 80px;
  height: 80px;
  position: fixed;
  bottom: 30px;
  left: 20px; /* Forces button to the left */
  background-color: red;
  color: white;
  font-size: 24px;
  font-weight: bold;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}


/* Controls for map interaction */
#controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 18px;
  gap: 10px;
}

#controls .button-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}

#controls button {
  font-size: 24px;
  width: 70px;
  height: 50px;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

#controls button:hover {
  background-color: rgba(0, 0, 0, 0.9);
  transform: scale(1.05);
}

#controls button:active {
  background-color: rgba(0, 0, 0, 1);
  transform: scale(0.95);
}

/* Responsive design for smaller screens */
@media (max-width: 600px) {
  #controls button {
    width: 60px;
    height: 40px;
    font-size: 20px;
  }
}

/* Shared styling for overlays (version and speed display) */
#version-overlay,
#speed-display {
  position: fixed;
  left: 10px;
  font-size: 16px;
  font-weight: bold;
  color: #000;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#version-overlay {
  top: 10px;
}

#speed-display {
  top: 50px;
}

/* Map hover effect */
#map:hover {
  cursor: grab;
  filter: brightness(0.95);
}

/* Fix potential conflicts */
#joystick-container, #brake-button {
  touch-action: none; /* Prevents unwanted touch events */
  user-select: none;
}

#road-lock-button {
  position: fixed;
  bottom: 180px;
  right: 30px;
  padding: 10px 20px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  z-index: 1000;
}

#road-lock-button.active {
  background-color: #28a745;
}

/* Zoom Controls */
#zoom-controls {
  position: fixed;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 1000;
}

#zoom-controls button {
  width: 50px;
  height: 50px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease-in-out;
}

#zoom-controls button:hover {
  background-color: #0056b3;
}

#zoom-level {
  font-size: 16px;
  font-weight: bold;
  color: #000;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#cruise-control-button {
  position: fixed;
  bottom: 29px;
  left: 110px;
  width: 80px;
  height: 80px;
  color: white;
  border: none;
  border-radius: 50%; /* Make the button circular */
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: gray; /* Default color for OFF state */
}

#cruise-control-button.on {
  background-color: green; /* Color for ON state */
}

#cruise-control-button.off {
  background-color: gray; /* Color for OFF state */
}

#view-mode-slider {
  position: fixed;
  bottom: 200px;
  left: -50px;
  width: 200px;
  height: 300px;
  writing-mode: bt-lr; /* Vertical slider */
  transform: rotate(270deg); /* Rotate to make it vertical */
  margin-top: 20px;
}