/* =============================================================================
   Recall — Enterprise UI
   ============================================================================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;
  background: #f7f8fa;
  color: #111827;
  min-height: 100vh;
  padding: 48px 24px;
  line-height: 1.5;
}

/* Page spine — centered white container */
.container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  padding: 40px;
}

/* Header */
.header {
  margin-bottom: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.logo-icon {
  width: 20px;
  height: 20px;
  stroke: #6b7280;
}

/* Cards */
.card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

.step-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9ca3af;
  margin-bottom: 4px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 16px;
}

/* Dropzone */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 120px;
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  background: #f9fafb;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.dropzone:hover {
  border-color: #9ca3af;
  background: #f3f4f6;
}

.dropzone input[type="file"] {
  display: none;
}

.dropzone-icon {
  width: 32px;
  height: 32px;
  stroke: #9ca3af;
  margin-bottom: 8px;
}

.dropzone-text {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.dropzone-hint {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}

/* Progress bar */
.progress-container {
  margin-top: 16px;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #374151;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-bar.indeterminate {
  width: 30%;
  animation: indeterminate 1.5s infinite ease-in-out;
}

@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* Status */
.status {
  margin-top: 12px;
  font-size: 13px;
  color: #6b7280;
}

.status.success {
  color: #059669;
}

.status.error {
  color: #dc2626;
}

/* Query input */
.query-input {
  width: 100%;
  min-height: 110px;
  padding: 14px 16px;
  font-size: 14px;
  font-family: inherit;
  color: #111827;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.query-input::placeholder {
  color: #9ca3af;
}

.query-input:focus {
  outline: none;
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.15);
}

/* Buttons */
.button-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.btn-primary {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: white;
  background: #111827;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.btn-primary:hover:not(:disabled) {
  background: #1f2937;
}

.btn-primary:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: #374151;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.btn-secondary:hover {
  background: #f9fafb;
}

/* Results card */
.results-card {
  border-color: #d1d5db;
}

.results-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}

.results-summary {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 16px;
}

/* Result item */
.result-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}

.result-item:last-child {
  margin-bottom: 0;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.result-subject {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  flex: 1;
}

/* Confidence badges */
.confidence-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.confidence-high {
  background: #d1fae5;
  color: #065f46;
}

.confidence-medium {
  background: #fef3c7;
  color: #92400e;
}

.confidence-low {
  background: #fee2e2;
  color: #991b1b;
}

.result-meta {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.8;
}

.meta-label {
  font-weight: 500;
  color: #6b7280;
}

/* Email body toggle */
.result-body-toggle {
  margin-top: 12px;
}

.result-body-toggle summary {
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  padding: 8px 0;
}

.result-body-toggle summary:hover {
  color: #374151;
}

.result-body {
  margin-top: 8px;
  padding: 12px;
  font-size: 12px;
  font-family: 'SF Mono', Consolas, 'Liberation Mono', monospace;
  color: #374151;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
}

/* Result actions */
.result-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

/* Locator panel */
.locator-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.locator-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #9ca3af;
  margin-bottom: 8px;
}

.locator-grid {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.8;
}

.locator-grid code {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 11px;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
}

.mono {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 11px;
}

/* No results */
.no-results {
  font-size: 14px;
  color: #6b7280;
  text-align: center;
  padding: 24px 0;
}
