* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: #222;
}

body {
  display: flex;
  height: 100vh;
}

#sidebar {
  width: 320px;
  flex-shrink: 0;
  background: #f7f7f8;
  border-right: 1px solid #ddd;
  padding: 16px;
  overflow-y: auto;
}

#sidebar h1 {
  font-size: 18px;
  margin: 0 0 16px 0;
}

#sidebar h2 {
  font-size: 13px;
  text-transform: uppercase;
  color: #666;
  letter-spacing: 0.5px;
  margin: 20px 0 8px 0;
}

#map {
  flex: 1;
  height: 100vh;
}

.mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mode-buttons button {
  text-align: left;
  padding: 8px 10px;
  background: white;
  color: #222;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.mode-buttons button:hover {
  background: #eef;
}

.mode-buttons button.active {
  background: #2b6cb0;
  color: white;
  border-color: #2b6cb0;
}

.panel {
  margin-top: 16px;
  padding: 12px;
  background: white;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
}

.panel.hidden,
.hidden,
[hidden] {
  display: none !important;
}

.hint {
  margin: 0 0 10px 0;
  color: #555;
  font-size: 12px;
  line-height: 1.4;
}

.quiz-prompt {
  font-size: 18px;
  font-weight: 600;
  padding: 10px;
  background: #f0f4ff;
  border-radius: 6px;
  text-align: center;
  margin-bottom: 10px;
}

.quiz-feedback {
  min-height: 20px;
  font-size: 13px;
  margin: 8px 0;
}

.quiz-feedback.correct { color: #2f855a; }
.quiz-feedback.wrong { color: #c53030; }
.quiz-feedback.info { color: #444; }

.quiz-score {
  font-size: 12px;
  color: #666;
  margin-top: 8px;
  border-top: 1px solid #eee;
  padding-top: 8px;
}

.quiz-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#panel-quiz-place-to-name input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 8px;
}

button {
  padding: 7px 12px;
  background: #2b6cb0;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

button:hover {
  background: #2c5282;
}

button.danger {
  background: #c53030;
}

button.danger:hover {
  background: #9b2c2c;
}

.stats {
  margin-top: 16px;
}

#stats-content {
  font-size: 13px;
  line-height: 1.7;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.io {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.taal-section {
  margin-top: 16px;
}

.taal-section select {
  width: 100%;
  padding: 7px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 13px;
  background: white;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"]:disabled + span,
.checkbox-label.disabled {
  color: #999;
  cursor: not-allowed;
}

.overlay-section {
  margin-top: 16px;
}

.overlay-section .hint {
  margin-bottom: 8px;
}

.slider-label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #555;
  gap: 4px;
  margin: 8px 0;
}

.slider-label input[type="range"] {
  width: 100%;
}

#overlay-opacity-value {
  font-weight: 600;
  color: #222;
}

.overlay-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#overlay-upload-btn {
  width: 100%;
}

/* Hoek-handles */
.overlay-corner {
  width: 14px;
  height: 14px;
  background: #ffcc00;
  border: 2px solid #333;
  border-radius: 3px;
  cursor: nwse-resize;
}

.overlay-corner.ne, .overlay-corner.sw {
  cursor: nesw-resize;
}

.overlay-center {
  width: 22px;
  height: 22px;
  background: #ffcc00;
  border: 2px solid #333;
  border-radius: 50%;
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: #333;
}

.quick-cat-label {
  font-size: 11px;
  color: #555;
  margin: 8px 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quick-cat {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.quick-cat button {
  flex: 1 0 auto;
  padding: 5px 8px;
  background: white;
  color: #222;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.quick-cat button:hover {
  background: #eef;
}

.quick-cat button.active {
  background: #2b6cb0;
  color: white;
  border-color: #2b6cb0;
}

.quick-cat button.active .stat-dot {
  outline: 1px solid white;
}

#edit-list {
  max-height: 220px;
  overflow-y: auto;
  font-size: 12px;
}

.edit-item {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

.edit-item:hover {
  background: #f0f4ff;
}

.edit-item .name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edit-item .cat {
  color: #888;
  font-size: 11px;
  margin-left: 6px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background: white;
  border-radius: 8px;
  padding: 20px;
  width: 320px;
  max-width: 90vw;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
  margin: 0 0 12px 0;
  font-size: 16px;
}

.modal-content label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  color: #555;
}

.modal-content input,
.modal-content select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  margin-top: 4px;
}

.modal-coords {
  font-size: 11px;
  color: #888;
  margin-bottom: 10px;
  font-family: monospace;
}

.modal-buttons {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* Marker kleuren via Leaflet divIcon */
.marker-pin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

#map.quiz-noninteractive .leaflet-marker-icon {
  pointer-events: none;
}

.marker-pin.land { background: #2b6cb0; }
.marker-pin.werelddeel { background: #d97706; }
.marker-pin.stad { background: #c53030; }
.marker-pin.gebied { background: #2f855a; }
.marker-pin.water { background: #00a3c4; }

.marker-pin.highlight {
  width: 26px;
  height: 26px;
  box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.5);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
