/* Bilagskontrol -- minimal, clean CSS for receipt OCR demo */

/* ---------------------------------------------------------------------------
   Base
--------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
  background: #f8f9fa;
  color: #333;
  line-height: 1.5;
}

h1 {
  color: #1a1a2e;
  margin-bottom: 0.25rem;
}

/* ---------------------------------------------------------------------------
   Privacy notice
--------------------------------------------------------------------------- */

.privacy-notice {
  color: #888;
  font-size: 0.85rem;
  font-style: italic;
  margin-bottom: 1.5rem;
}

/* ---------------------------------------------------------------------------
   Drop zone
--------------------------------------------------------------------------- */

.drop-zone {
  border: 2px dashed #ccc;
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  background: #fff;
}

.drop-zone:hover {
  border-color: #999;
}

.drop-zone.drag-over {
  border-color: #4a90d9;
  background: #f0f6ff;
}

.drop-zone p {
  margin: 0 0 1rem;
  color: #666;
}

/* ---------------------------------------------------------------------------
   Upload button
--------------------------------------------------------------------------- */

.upload-button {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: #4a90d9;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s;
}

.upload-button:hover {
  background: #3a7bc8;
}

/* ---------------------------------------------------------------------------
   Result cards (shared)
--------------------------------------------------------------------------- */

.result-card {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: opacity 0.3s;
}

/* ---------------------------------------------------------------------------
   Result card -- done (side-by-side layout)
--------------------------------------------------------------------------- */

.result-card.done {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.result-image img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.result-data dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
}

.result-data dt {
  font-weight: 600;
  color: #555;
}

.result-data dd {
  margin: 0;
}

/* ---------------------------------------------------------------------------
   Line items table
--------------------------------------------------------------------------- */

.line-items {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.line-items th {
  text-align: left;
  border-bottom: 2px solid #ddd;
  padding: 0.25rem 0.5rem;
}

.line-items td {
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid #eee;
}

/* ---------------------------------------------------------------------------
   Result card -- loading
--------------------------------------------------------------------------- */

.result-card.loading {
  text-align: center;
  color: #666;
}

.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

/* ---------------------------------------------------------------------------
   Spinner
--------------------------------------------------------------------------- */

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #ddd;
  border-top-color: #4a90d9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------------------
   Elapsed time
--------------------------------------------------------------------------- */

.elapsed-time {
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------
   Processing time
--------------------------------------------------------------------------- */

.processing-time {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #888;
  grid-column: 1 / -1;
}

/* ---------------------------------------------------------------------------
   Validation warnings
--------------------------------------------------------------------------- */

.validation-warnings {
  grid-column: 1 / -1;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 0.75rem 1rem;
}

.warning-message {
  margin: 0;
  color: #856404;
  font-size: 0.9rem;
}

.warning-message + .warning-message {
  margin-top: 0.25rem;
}

/* ---------------------------------------------------------------------------
   OCR text toggle
--------------------------------------------------------------------------- */

.ocr-toggle {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
}

.ocr-toggle summary {
  cursor: pointer;
  color: #4a90d9;
  font-size: 0.85rem;
  user-select: none;
}

.ocr-toggle summary:hover {
  text-decoration: underline;
}

.ocr-text {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem;
  font-size: 0.8rem;
  line-height: 1.4;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ---------------------------------------------------------------------------
   Result card -- error
--------------------------------------------------------------------------- */

.result-card.error {
  border-left: 4px solid #e74c3c;
  color: #e74c3c;
}

.error-message {
  margin: 0;
}
