:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --border: #2a2a2a;
  --accent: #1c9cd9;
  --accent2: #1c9cd9;
  --text: #f0ede8;
  --muted: #666;
  --success: #4caf77;
  --radius: 12px;
  --name: #e1eefe; /* Of gebruik kleur #213ec8 (beide kleuren komen van mijn persoonlijke website)*/
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
}

header {
  text-align: center;
  margin-bottom: 36px;
}
header img {
  max-height: 50px;
  display: block;
  margin: 0 auto 1rem auto;
}
h1 {
  font-family: 'Syne', sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

h1 span {
  color: var(--accent);
}

.subtitle {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.subtitle a {
  color: var(--muted);
  text-decoration: none;
}

.subtitle a:hover {
  color: var(--name);
}

.scanner-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 860px;
}

.cam-box {
  position: relative;
  flex-shrink: 0;
}

.cam-frame {
  width: 280px;
  height: 280px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: #000;
}

.cam-frame video,
.cam-frame canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cam-overlay {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  pointer-events: none;
  border: 2px solid transparent;
  transition: border-color 0.3s;
}

.cam-overlay.detecting {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(28, 156, 217, 0.2);
}

.cam-overlay.saved {
  border-color: var(--success);
  box-shadow: 0 0 20px rgba(76, 175, 119, 0.3);
}

.corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--accent);
  border-style: solid;
  opacity: 0.6;
}

.corner.tl {
  top: 10px;
  left: 10px;
  border-width: 2px 0 0 2px;
}

.corner.tr {
  top: 10px;
  right: 10px;
  border-width: 2px 2px 0 0;
}

.corner.bl {
  bottom: 10px;
  left: 10px;
  border-width: 0 0 2px 2px;
}

.corner.br {
  bottom: 10px;
  right: 10px;
  border-width: 0 2px 2px 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.3s;
}

.dot.active {
  background: var(--accent);
  animation: pulse 1.2s infinite;
}

.dot.saved {
  background: var(--success);
  animation: none;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

/* Right panel */
.info-panel {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.prediction-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 10px;
}

.detected-rating {
  font-family: 'Syne', sans-serif;
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--accent);
  min-height: 48px;
}

.confidence-bar-wrap {
  margin-top: 10px;
  background: var(--border);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}

.confidence-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  width: 0%;
  transition: width 0.2s ease;
}

.confidence-text {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 5px;
}

/* Stars display */
.stars-display {
  font-size: 1.6rem;
  margin-top: 4px;
  min-height: 32px;
  letter-spacing: 2px;
}

/* Save feedback */
.save-flash {
  background: #0d2318;
  border: 1px solid var(--success);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.75rem;
  color: var(--success);
  display: none;
  align-items: center;
  gap: 8px;
}

.save-flash.visible {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Log */
.log-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.log-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 10px;
}

#log-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 180px;
  overflow-y: auto;
}

#log-list li {
  font-size: 0.75rem;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
}

#log-list li .time {
  color: var(--muted);
}

#log-list::-webkit-scrollbar {
  width: 4px;
}

#log-list::-webkit-scrollbar-track {
  background: transparent;
}

#log-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.empty-log {
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
  padding: 10px 0;
}

/* Threshold slider */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  margin-bottom: 8px;
}

.settings-row span {
  color: var(--muted);
}

.settings-row strong {
  color: var(--accent);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

/* Error */
.error-banner {
  background: #2a0e0e;
  border: 1px solid var(--accent2);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--accent2);
  font-size: 0.75rem;
  display: none;
  margin-bottom: 16px;
}

.error-banner.visible {
  display: block;
}

.instructions-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.instructions-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 10px;
}

.instructions-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.75rem;
  color: var(--text);
}

.instructions-step + .instructions-step {
  border-top: 1px solid var(--border);
}


.instructions-icon {
  font-size: 1rem;
  flex-shrink: 0;
}