/* style.css */

:root {
  --bg-dark: #1e1e1e;
  --bg-light: #f5f5f5;
  --tooltip-dark: #333;
  --tooltip-light: #fff;
  --tooltip-text-dark: #fff;
  --tooltip-text-light: #000;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: sans-serif;
  background-color: var(--bg-dark);
  color: #fff;
}

body[data-theme="light"] {
  background-color: var(--bg-light);
  color: #000;
}

#mapCanvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  cursor: grab;
}

#controls {
  position: fixed;
  top: 16px; /* Adjusted from 10px */
  left: 10px;
  z-index: 10;
}

#tooltip {
  position: fixed;
  background: var(--tooltip-dark);
  color: var(--tooltip-text-dark);
  padding: 5px 8px;
  font-size: 14px;
  border-radius: 4px;
  pointer-events: none;
  white-space: pre-line;
  z-index: 100;
  box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

body[data-theme="light"] #tooltip {
  background: var(--tooltip-light);
  color: var(--tooltip-text-light);
}

#coord-box {
  position: fixed;
  top: 16px; /* Adjusted from 10px */
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 4px;
  z-index: 1000;
  pointer-events: none;
  font-family: sans-serif;
  text-align: right;
}

body[data-theme="light"] #coord-box {
  background: rgba(255, 255, 255, 0.8);
  color: black;
}

#sidebar {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 240px;
  max-height: 80vh;
  overflow-y: auto;
  background: rgba(30, 30, 30, 0.95);
  color: white;
  padding: 10px;
  font-family: sans-serif;
  z-index: 1000;
  border-left: 2px solid #555;
  border-radius: 8px 0 0 8px;
}

#sidebar::-webkit-scrollbar {
  width: 8px;
}

#sidebar::-webkit-scrollbar-track {
  background: rgba(50, 50, 50, 0.2);
}

#sidebar::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 4px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
  background-color: #aaa;
}

body[data-theme="light"] #sidebar::-webkit-scrollbar-thumb {
  background-color: #bbb;
}

body[data-theme="light"] #sidebar::-webkit-scrollbar-thumb:hover {
  background-color: #999;
}

#sidebar h3 {
  margin-top: 0;
  font-size: 18px;
}

#sidebar details {
  margin-bottom: 10px;
}

#sidebar details > summary {
  font-weight: bold;
  cursor: pointer;
  margin: 6px 0;
}

.control-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: nowrap;
  justify-content: space-between;
}

.control-group label {
  font-size: 13px;
  margin: 0;
  width: 90px;
  text-align: left;
  padding-left: 10px;
}

.control-group input[type="color"],
.control-group input[type="number"],
.control-group select,
.control-group input[type="checkbox"] {
  flex: 1;
  padding: 2px;
  box-sizing: border-box;
}

#sidebar input[type="color"] {
  width: 32px;
  height: 24px;
  padding: 0;
  border: none;
  background: none;
}

#sidebar input[type="color"]:hover,
#sidebar input[type="number"]:hover,
#sidebar select:hover,
#sidebar input[type="checkbox"]:hover {
  filter: brightness(1.2);
  cursor: pointer;
}

button {
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  background: #444;
  color: #fff;
  border: none;
  border-radius: 3px;
}

button:hover {
  background: #666;
}

body[data-theme="light"] button {
  background: #ccc;
  color: #000;
}

@media (max-width: 600px) {
  #sidebar {
    width: 90vw;
    right: auto;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}
