/* Ingredient OCR scanner — matches simple-page green / primary system */

.scan-panel {
  padding-bottom: 0.25rem;
}

.scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.scan-file-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 1.15rem;
  border-radius: 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
  transition: background 0.15s ease, opacity 0.15s ease;
}

.scan-file-btn:hover {
  opacity: 0.92;
}

.scan-file-btn--secondary {
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
  box-shadow: inset 0 0 0 1px hsl(var(--primary) / 0.22);
}

.scan-file-btn--secondary:hover {
  background: hsl(var(--primary) / 0.16);
  opacity: 1;
}

.scan-file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.scan-clear-btn {
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border-radius: 0.55rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.scan-clear-btn:hover {
  color: hsl(var(--foreground));
  border-color: hsl(var(--foreground) / 0.25);
}

.scan-preview-wrap {
  margin-top: 1.25rem;
  border: 1px solid hsl(var(--border) / 0.9);
  border-radius: 0.75rem;
  background: hsl(var(--muted) / 0.28);
  overflow: hidden;
  max-width: 28rem;
}

.scan-preview {
  display: block;
  width: 100%;
  max-height: 18rem;
  object-fit: contain;
  background: hsl(var(--background));
}

.scan-lang {
  margin: 1.35rem 0 0;
  padding: 0;
  border: 0;
}

.scan-lang legend {
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.scan-lang__option {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-inline-end: 1.15rem;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
  color: hsl(var(--foreground));
  cursor: pointer;
}

.scan-run-btn {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.7rem 1.4rem;
  border: 0;
  border-radius: 0.55rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
  transition: opacity 0.15s ease;
}

.scan-run-btn:hover:not(:disabled) {
  opacity: 0.92;
}

.scan-run-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.scan-status-line {
  margin: 0.85rem 0 0;
  font-size: 0.95rem;
  color: hsl(var(--muted-foreground));
}

.scan-status-line--error {
  color: hsl(var(--destructive));
}

.scan-empty {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 0.65rem;
  border: 1px dashed hsl(var(--border));
  background: hsl(var(--muted) / 0.22);
  color: hsl(var(--muted-foreground));
  font-size: 0.95rem;
}

.scan-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.scan-result {
  margin: 0;
}

.scan-result__link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.95rem 1.1rem;
  border-radius: 0.65rem;
  border: 1px solid hsl(var(--border) / 0.9);
  background: hsl(var(--background));
  text-decoration: none;
  color: hsl(var(--foreground));
  transition: border-color 0.15s ease, background 0.15s ease;
}

.scan-result__link:hover {
  border-color: hsl(var(--primary) / 0.45);
  background: hsl(var(--primary) / 0.05);
}

.scan-result__title {
  font-family: var(--simple-display, "Outfit", ui-sans-serif, system-ui, sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.scan-result__token {
  display: block;
  margin-top: 0.35rem;
  padding-inline: 0.2rem;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

.scan-status {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.scan-status--halal {
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.12);
}

.scan-status--haram {
  color: hsl(var(--destructive));
  background: hsl(var(--destructive) / 0.12);
}

.scan-status--verified {
  color: #0e7490;
  background: rgba(14, 116, 144, 0.12);
}

.scan-status--market {
  color: #6d28d9;
  background: rgba(109, 40, 217, 0.1);
}

.scan-status--scholarly {
  color: #b45309;
  background: rgba(180, 83, 9, 0.12);
}

.scan-unmatched {
  margin-top: 1.75rem;
}

.scan-unmatched__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.scan-unmatched__lead {
  margin: 0.4rem 0 0.85rem;
  font-size: 0.92rem;
  color: hsl(var(--muted-foreground));
}

.scan-unmatched__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.scan-unmatched__item {
  padding: 0.35rem 0.7rem;
  border-radius: 0.45rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.35);
  font-size: 0.88rem;
  color: hsl(var(--foreground));
}

.scan-raw {
  margin-top: 1.5rem;
  border-top: 1px solid hsl(var(--border) / 0.7);
  padding-top: 1rem;
}

.scan-raw summary {
  cursor: pointer;
  font-weight: 650;
  color: hsl(var(--primary));
}

.scan-raw__text {
  margin: 0.75rem 0 0;
  padding: 0.9rem 1rem;
  border-radius: 0.55rem;
  background: hsl(var(--muted) / 0.35);
  border: 1px solid hsl(var(--border) / 0.8);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85rem;
  line-height: 1.5;
  color: hsl(var(--foreground));
  max-height: 16rem;
  overflow: auto;
}

html[lang="ar"] .scan-result__title {
  letter-spacing: 0;
}
