body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background-color: #f0f2f5;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

.container {
  max-width: 600px;
  width: 100%;
  text-align: center;
  background: #ffffff;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

h1 {
  color: #2c3e50;
  font-size: 2em;
  margin-bottom: 10px;
}

p {
  color: #7f8c8d;
  font-size: 1em;
  margin-bottom: 20px;
}

.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 20px auto;
  border: 2px solid #34495e;
  border-radius: 8px;
  overflow: hidden;
  background: #ecf0f1;
}

.camera {
  width: 100%;
  height: auto;
  display: block;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
}

#scanButton, #clearButton {
  padding: 12px 24px;
  font-size: 16px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#scanButton {
  background-color: #28a745;
  color: white;
}

#scanButton:hover {
  background-color: #218838;
}

#clearButton {
  background-color: #e74c3c;
  color: white;
}

#clearButton:hover {
  background-color: #c0392b;
}

.file-upload {
  margin: 20px 0;
}

.file-upload label {
  display: block;
  color: #2c3e50;
  font-weight: bold;
  margin-bottom: 8px;
}

.file-upload input {
  width: 100%;
  padding: 8px;
  border: 1px solid #bdc3c7;
  border-radius: 5px;
  font-size: 14px;
}

#result {
  margin-top: 20px;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

#barcode {
  font-weight: bold;
  font-size: 1.1em;
  color: #2c3e50;
  margin-bottom: 10px;
}

#loading {
  color: #7f8c8d;
  font-style: italic;
}

#productInfo {
  margin-top: 15px;
  text-align: left;
}

#productInfo h3 {
  color: #2c3e50;
  font-size: 1.4em;
  margin-bottom: 15px;
  border-bottom: 2px solid #ecf0f1;
  padding-bottom: 5px;
}

.nutrient {
  margin: 10px 0;
  padding: 10px;
  background: #ffffff;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nutrient strong {
  color: #34495e;
}

.percentile {
  display: block;
  font-size: 0.9em;
  color: #7f8c8d;
  margin-top: 5px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #ecf0f1;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 5px;
}

.progress {
  height: 100%;
  transition: width 0.5s ease;
}

.health-rating {
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 5px;
  display: inline-block;
}

@media (max-width: 600px) {
  .container {
    padding: 15px;
  }

  .video-wrapper {
    max-width: 100%;
  }

  .controls {
    flex-direction: column;
    gap: 10px;
  }

  #scanButton, #clearButton {
    width: 100%;
    padding: 12px;
  }

  #productInfo h3 {
    font-size: 1.2em;
  }

  .nutrient {
    padding: 8px;
  }
}
