body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #f4f4f4;
    padding: 20px;
    color: #333;
}

h2 {
    margin-bottom: 20px;
}

.form-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 10px 5px 0;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
  background-color: #fff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.controls label {
    font-weight: bold;
    margin-right: 5px;
}

.controls select,
.controls input,
.controls button {
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.controls button {
    background-color: #0078d7;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.controls button:hover {
    background-color: #005fa3;
}

.connected {
    color: green;
}

.disconnected {
    color: red;
}

body.dark {
    background-color: #1e1e1e;
    color: #ddd;
}

body.dark .controls {
    background-color: #2c2c2c;
    box-shadow: none;
}

body.dark input,
body.dark select,
body.dark button {
    background-color: #333;
    color: #ddd;
    border: 1px solid #555;
}

body.dark button {
    background-color: #0078d7;
}

body.dark button:hover {
    background-color: #005fa3;
}

/* Toggle switch styling */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #0078d7;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

#status {
  display: inline-block;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 4px;
  border: none;
  background-color: #ccc;
  color: #333;
  cursor: default;
  transition: background-color 0.3s ease;
}

.connected#status {
  background-color: #28a745;
  color: white;
}

.disconnected#status {
  background-color: #dc3545;
  color: white;
}

#canvas-wrapper {
  width: 100%;
  height: 300px;
  resize: both;
  overflow: hidden;
  border: 2px solid #ccc;
  border-radius: 6px;
  background-color: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  position: relative;
}

#canvas-wrapper canvas {
  width: 100%;
  height: 100%;
  display: block;
}