* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background-color: #101722;
  color: #f1f4f8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, #1f2d3d, #0f172a);
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-header h1 {
  margin: 0;
  font-size: 1.75rem;
}

.build-info {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: #94a3b8;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1.5rem;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.preview-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.video-container {
  position: relative;
  width: min(90vw, 640px);
  aspect-ratio: 4 / 3;
  background-color: #0b1120;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.4);
}

.scanner video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.overlay-frame {
  width: 60%;
  height: 60%;
  border: 3px solid rgba(148, 163, 184, 0.7);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.8), 0 0 25px rgba(14, 116, 144, 0.6);
}

.controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.control-button {
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #14b8a6, #0369a1);
  color: #f8fafc;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.control-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.control-button:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.35);
}

.result-section {
  background-color: rgba(15, 23, 42, 0.9);
  padding: 1.25rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.35);
}

.result-section h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.scan-result {
  margin: 0;
  font-size: 1.1rem;
  font-weight: bold;
  color: #fbbf24;
}

.notes {
  margin-top: 1rem;
  color: #cbd5f5;
  font-size: 0.9rem;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .app-main {
    padding: 1rem;
  }

  .control-button {
    width: 100%;
  }
}
