body {
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #f8faff 0%, #f4f6fa 100%);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}
.logo-container {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  margin-bottom: 10px;
}
.udi-logo {
  width: 110px;
  height: auto;
  display: block;
}
.card {
  background: #ffffff;
  max-width: 420px;
  margin: 0 auto 40px auto;
  border-radius: 18px;
  box-shadow: 0 4px 32px rgba(209,0,201,0.08), 0 1.5px 8px rgba(0,0,0,0.04);
  padding: 38px 28px 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}
.scan-heading {
  color: #d100c9;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 32px;
  margin-top: 0;
  letter-spacing: 0.5px;
}
.search-bar-outer {
  width: 100%;
  display: flex;
  align-items: center;
  background: #f7f7fa;
  border-radius: 32px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  padding: 0 10px;
  margin-bottom: 36px;
  border: 1.5px solid #ececec;
}
.search-icon {
  display: flex;
  align-items: center;
  margin-right: 6px;
}
#udi-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  padding: 14px 8px;
  outline: none;
  color: #333;
}
.camera-btn, .upload-btn {
  background: none;
  border: none;
  outline: none;
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-left: 6px;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.2s;
}
.camera-btn:hover, .upload-btn:hover {
  background: #f0e6f7;
}
.camera-btn img, .upload-btn img {
  width: 22px;
  height: 22px;
}
.submit-btn {
  width: 100%;
  background: #d100c9;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px 0;
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(209,0,201,0.08);
  transition: background 0.2s;
}
.submit-btn:hover {
  background: #a800a0;
}
@media (max-width: 600px) {
  .card {
    max-width: 98vw;
    margin: 0 auto 30px auto;
    padding: 18px 4vw;
  }
  .scan-heading {
    font-size: 1.2rem;
  }
  .udi-logo {
    width: 80px;
  }
}
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background: rgba(0,0,0,0.18);
}
.modal-content {
  background: #fff;
  margin: 60px auto;
  padding: 32px 24px 24px 24px;
  border-radius: 18px;
  max-width: 400px;
  position: relative;
  box-shadow: 0 4px 32px rgba(209,0,201,0.12), 0 1.5px 8px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.close {
  position: absolute;
  right: 18px;
  top: 12px;
  font-size: 1.7rem;
  color: #d100c9;
  cursor: pointer;
  font-weight: bold;
  z-index: 2;
}
.modal-udi-code {
  font-size: 1.1rem;
  color: #d100c9;
  font-weight: 700;
  margin: 0 25px 10px 25px;
  text-align: center;
  word-break: break-all;
  word-wrap: break-word;
  max-width: 100%;
  padding-right: 20px;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.4;
}
.modal-divider {
  width: 100%;
  height: 1px;
  background: #f0e6f7;
  margin: 18px 0 18px 0;
}
#modal-reviews-section {
  width: 100%;
  margin-bottom: 0;
  text-align: left;
  font-size: 1rem;
  color: #444;
}
#review-comment {
  width: 100%;
  min-height: 70px;
  border-radius: 8px;
  border: 1.5px solid #ececec;
  padding: 10px;
  font-size: 1rem;
  margin-bottom: 18px;
  resize: vertical;
}
.star-rating {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  justify-content: center;
}
.star-rating .star {
  font-size: 24px;
  color: #ddd;
  cursor: pointer;
  transition: color 0.2s ease;
  user-select: none;
  padding: 0 2px;
}
.star-rating .star.selected {
  color: #fbbf24;
}
.star-rating .star.hover {
  color: #fcd34d;
}
@media (max-width: 600px) {
  .modal-content {
    max-width: 96vw;
    margin: 20px auto;
    padding: 24px 16px 20px 16px;
  }

  .modal-udi-code {
    font-size: 1rem;
    margin: 0 20px 10px 20px;
  }

  .close {
    right: 12px;
    top: 8px;
  }
}
.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid #f3e6f7;
  border-top: 3px solid #d100c9;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 18px auto;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.modal-message {
  width: 100%;
  text-align: center;
  margin-bottom: 12px;
  font-size: 1.05rem;
  padding: 8px 0;
  border-radius: 8px;
}
.modal-message.error {
  background: #ffe6ee;
  color: #c9003a;
  border: 1px solid #fbb6ce;
}
.modal-message.success {
  background: #e6ffe9;
  color: #0a7a2a;
  border: 1px solid #7be495;
}
.submit-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* QR Code Scanner Styles */
#html5-qrcode {
  display: none;
  width: 100%;
  max-width: 100%;
  margin: 20px 0 0 0;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

#html5-qrcode video {
  width: 100% !important;
  height: auto !important;
  min-height: 300px !important;
  border-radius: 12px;
  object-fit: cover;
}

/* Make sure the QR code scanner is visible on mobile */
@media (max-width: 600px) {
  #html5-qrcode {
    margin: 15px 0 0 0;
  }
  #html5-qrcode video {
    min-height: 250px !important;
  }
}

/* Scan Preview Styles */
.scan-preview {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(209,0,201,0.08);
  border: 1px solid #f0e6f7;
}

.scan-preview h3 {
  color: #d100c9;
  font-size: 1.2rem;
  margin: 0 0 15px 0;
  text-align: center;
}

.preview-content {
  margin-bottom: 20px;
}

.preview-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0e6f7;
}

.preview-row:last-child {
  border-bottom: none;
}

.preview-row .label {
  color: #666;
  font-size: 0.9rem;
  flex: 1;
}

.preview-row .value {
  color: #333;
  font-weight: 600;
  flex: 1;
  text-align: right;
}

.preview-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.cancel-btn {
  flex: 1;
  background: #f7f7fa;
  color: #666;
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 16px 0;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.cancel-btn:hover {
  background: #ececec;
}

.preview-row .value.empty {
  color: #999;
  font-style: italic;
}

@media (max-width: 600px) {
  .scan-preview {
    padding: 15px;
    margin: 15px 0;
  }

  .preview-row {
    flex-direction: column;
    padding: 6px 0;
  }

  .preview-row .value {
    text-align: left;
    margin-top: 4px;
  }
}

/* Raw Scan Section Styles */
.raw-scan-section {
  background: #f7f7fa;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 20px;
}

.raw-scan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.raw-scan-header span {
  color: #666;
  font-size: 0.9rem;
  font-weight: 600;
}

.copy-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}

.copy-btn:hover {
  background: #ececec;
}

.raw-scan-value {
  font-family: monospace;
  font-size: 0.95rem;
  color: #333;
  word-break: break-all;
  line-height: 1.4;
  padding: 8px;
  background: #fff;
  border-radius: 4px;
  border: 1px solid #ececec;
}

.preview-divider {
  height: 1px;
  background: #f0e6f7;
  margin: 20px 0;
}

/* Update existing preview styles */
.preview-content {
  margin-bottom: 0;  /* Remove margin since we have divider */
}

.copy-btn.copied {
  background: #e6ffe9;
}

.copy-btn.copied svg path,
.copy-btn.copied svg rect {
  fill: #0a7a2a;
  stroke: #0a7a2a;
}

@media (max-width: 600px) {
  .raw-scan-section {
    padding: 10px;
    margin-bottom: 15px;
  }

  .raw-scan-value {
    font-size: 0.85rem;
  }
}

/* Scanner Container Styles */
.scanner-container {
  width: 100%;
  max-width: 100%;
  margin: 20px 0 0 0;
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  height: 0;
  opacity: 0;
  transition: all 0.3s ease;
  transform: translateZ(0); /* Force GPU acceleration */
}

.scanner-container.active {
  height: 300px;
  opacity: 1;
  margin-bottom: 20px;
}

.scanner-view {
  width: 100%;
  height: 100%;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

video#html5-qrcode {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  background: #000;
  transform: translateZ(0); /* Force GPU acceleration */
  will-change: transform; /* Hint for browser optimization */
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  padding: 0;
}

/* Add scanning overlay */
.scanner-view::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(209,0,201,0.5);
  border-radius: 20px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}

/* Mobile optimizations */
@media (max-width: 600px) {
  .scanner-container.active {
    height: 250px;
  }

  .scanner-view::after {
    width: 150px;
    height: 150px;
  }
}

.switch-camera-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
  color: #333;
  font-weight: 500;
  display: none;
}

.switch-camera-btn:hover {
  background: #fff;
}

/* Mobile Adjustments for Scanner */
@media (max-width: 600px) {
  .scanner-container.active {
    height: 250px;
  }

  .switch-camera-btn {
    bottom: 15px;
    right: 15px;
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

/* Support Section Styles */
.support-section {
  background: linear-gradient(to bottom, #f8faff, #ffffff);
  padding: 60px 20px;
  margin-top: 0;
  border-top: 1px solid rgba(209,0,201,0.1);
  width: 100%;
  box-sizing: border-box;
}

.support-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

.support-section h2 {
  color: #d100c9;
  font-size: 1.8rem;
  margin: 0 0 20px 0;
  text-align: center;
}

.support-intro {
  color: #444;
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 0 auto 40px auto;
  max-width: 800px;
  text-align: center;
}

.support-flex-container {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 20px;
  box-sizing: border-box;
}

.donation-info {
  flex: 1;
  background: #ffffff;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(209,0,201,0.08);
  width: calc(50% - 20px);
  min-width: 300px;
}

.support-video {
  flex: 1;
  width: calc(50% - 20px);
  min-width: 300px;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(209,0,201,0.08);
}

.support-video::before {
  content: "";
  display: block;
  padding-top: 177.78%; /* 16:9 Aspect Ratio (9 / 16 = 0.5625) */
}

.support-video video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.donation-info h3 {
  color: #333;
  font-size: 1.2rem;
  margin: 0 0 20px 0;
  font-weight: 600;
}

.donation-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 25px 0;
}

.donation-benefits li {
  color: #444;
  font-size: 1.05rem;
  margin-bottom: 15px;
  padding-left: 32px;
  position: relative;
  line-height: 1.4;
}

.donation-benefits li:before {
  content: "✅";
  position: absolute;
  left: 0;
  top: 0;
}

.donate-button {
  display: block;
  background: #d100c9;
  color: #fff;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 1.15rem;
  font-weight: 700;
  transition: background 0.2s, transform 0.2s;
  margin: 20px auto;
  text-align: center;
  width: 100%;
  max-width: 300px;
}

.donate-button:hover {
  background: #a800a0;
  transform: translateY(-2px);
}

.thank-you {
  color: #666;
  font-size: 1rem;
  font-style: italic;
  margin: 20px 0 0 0;
  text-align: center;
}

/* Responsive Styles */
@media (max-width: 992px) {
  .support-flex-container {
    padding: 0 15px;
    gap: 30px;
  }

  .donation-info,
  .support-video {
    width: calc(50% - 15px);
  }
}

@media (max-width: 768px) {
  .support-flex-container {
    flex-direction: column;
    gap: 40px;
  }

  .donation-info,
  .support-video {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
  }

  .support-section {
    padding: 40px 15px;
  }

  .support-section h2 {
    font-size: 1.5rem;
  }

  .support-intro {
    font-size: 1rem;
    margin-bottom: 30px;
  }
}

@media (max-width: 480px) {
  .support-section {
    padding: 30px 12px;
  }

  .support-flex-container {
    padding: 0 10px;
    gap: 30px;
  }

  .donation-info {
    padding: 20px;
    min-width: unset;
  }

  .support-section h2 {
    font-size: 1.3rem;
  }

  .donation-info h3 {
    font-size: 1.1rem;
  }

  .donation-benefits li {
    font-size: 0.95rem;
    padding-left: 28px;
  }

  .donate-button {
    padding: 12px 20px;
    font-size: 1rem;
  }
}

/* Results Section */
#results-section {
  max-width: 800px;
  margin: 0 auto 40px auto;
  padding: 0 20px;
}
