:root {
  --primary: #ff4b4b;
  --bg: #0e1117;
  --card-bg: #262730;
  --text: #fafafa;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 20px;
  display: flex;
  justify-content: center;
}

.container {
  max-width: 800px;
  width: 100%;
}

header {
  text-align: center;
  margin-bottom: 20px;
}

header h1 {
  margin: 0 0 10px 0;
}

header p {
  margin: 0 0 6px 0;
}

.subtext {
  margin: 0 0 10px 0;
  font-size: 0.9em;
  color: #ccc;
}

.dashboard-link {
  display: inline-block;
  margin-top: 10px;
  background-color: var(--card-bg);
  color: #4caf50;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: bold;
  border: 1px solid #4caf50;
  transition: all 0.3s ease;
}

.dashboard-link:hover {
  background-color: #4caf50;
  color: var(--bg);
}

.controls {
  background: var(--card-bg);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}

button {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

button:disabled {
  background-color: #555;
  cursor: not-allowed;
}

.settings {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-left: auto;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: black;
  border-radius: 8px;
  overflow: hidden;
  min-height: 480px; /* Minimum height before webcam starts */
}

video {
  width: 100%;
  display: block;
}

canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Let clicks pass through to the video if needed */
}

.metrics {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 20px;
}

.metric-card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  min-width: 150px;
}

.metric-value {
  font-size: 2em;
  font-weight: bold;
  color: var(--primary);
}

.metric-label {
  font-size: 0.9em;
  color: #ccc;
  margin-top: 5px;
}
