/**
 * Sensor Control Panel — wokwi-style top-of-canvas panel for adjusting
 * sensor values (temperature, distance, humidity, etc.) during simulation.
 */

.sensor-control-panel {
  position: absolute;
  top: 8px;
  left: 8px;
  background-color: #2d2d2d;
  border: 1px solid #555;
  border-radius: 8px;
  padding: 12px 16px 14px;
  min-width: 320px;
  max-width: 420px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 1002;
  pointer-events: all;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  user-select: none;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.sensor-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #444;
}

.sensor-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
}

.sensor-panel-close {
  background: transparent;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 20px;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.15s, color 0.15s;
  line-height: 1;
}

.sensor-panel-close:hover {
  background-color: #444;
  color: #fff;
}

/* ── Section labels (ACCELERATION / ROTATION / TEMPERATURE etc.) ──────── */

.sensor-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #aaa;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 10px;
  margin-bottom: 4px;
}

.sensor-section-label:first-of-type {
  margin-top: 0;
}

.sensor-section-icon {
  font-size: 14px;
}

/* ── Slider row ──────────────────────────────────────────────────────────── */

.sensor-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.sensor-control-label {
  font-size: 12px;
  color: #ccc;
  width: 20px;
  flex-shrink: 0;
  text-align: right;
}

.sensor-control-label-wide {
  font-size: 12px;
  color: #ccc;
  min-width: 90px;
  flex-shrink: 0;
}

.sensor-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #555;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.sensor-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #007acc;
  cursor: pointer;
  transition: background 0.15s;
}

.sensor-slider::-webkit-slider-thumb:hover {
  background: #0095e8;
}

.sensor-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #007acc;
  cursor: pointer;
  border: none;
}

.sensor-value-display {
  font-size: 12px;
  color: #fff;
  min-width: 70px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Button control ──────────────────────────────────────────────────────── */

.sensor-trigger-button {
  margin-top: 8px;
  padding: 7px 16px;
  background-color: #3d3d3d;
  border: 1px solid #666;
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
  width: 100%;
}

.sensor-trigger-button:hover {
  background-color: #505050;
  border-color: #888;
}

.sensor-trigger-button:active {
  background-color: #007acc;
  border-color: #007acc;
}
