/* Capture Page Styles - QuestionAI Clone */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f5f5f5;
  color: #1a1a1a;
  line-height: 1.5;
  min-height: 100vh;
}

/* Header */
.capture-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.back-button {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.back-button:hover {
  background-color: #f3f4f6;
}

.back-button svg {
  width: 20px;
  height: 20px;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}

/* Main Container */
.capture-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Upload Area */
.upload-section {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background-color: #fafafa;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: #3B82F6;
  background-color: #eff6ff;
}

.upload-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background-color: #eff6ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-icon svg {
  width: 32px;
  height: 32px;
  color: #3B82F6;
}

.upload-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.upload-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 16px;
}

.upload-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: 'Inter', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background-color: #3B82F6;
  color: white;
}

.btn-primary:hover {
  background-color: #2563EB;
}

.btn-secondary {
  background-color: #f3f4f6;
  color: #374151;
}

.btn-secondary:hover {
  background-color: #e5e7eb;
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* Image Preview */
.preview-container {
  margin-top: 24px;
  display: none;
}

.preview-container.show {
  display: block;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.preview-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.btn-remove {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.btn-remove:hover {
  background-color: #fef2f2;
}

.preview-image {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  background-color: #fafafa;
}

/* Results Section */
.results-section {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.results-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid #e5e7eb;
  border-top-color: #3B82F6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  margin-top: 16px;
  font-size: 14px;
  color: #6b7280;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #9ca3af;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background-color: #f3f4f6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-icon svg {
  width: 32px;
  height: 32px;
  color: #9ca3af;
}

.empty-state-text {
  font-size: 14px;
  color: #6b7280;
}

/* Results Content */
.result-block {
  margin-bottom: 20px;
}

.result-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.result-value {
  font-size: 14px;
  color: #1a1a1a;
  padding: 12px 16px;
  background-color: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  line-height: 1.6;
}

.result-value.latex {
  font-family: 'Courier New', monospace;
  background-color: #1a1a2e;
  color: #e2e8f0;
  border-color: #374151;
}

.result-value.subject {
  display: inline-block;
  background-color: #dbeafe;
  color: #1d4ed8;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 500;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e5e5;
}

.btn-solve {
  flex: 1;
  padding: 14px 20px;
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.btn-solve:hover {
  background: linear-gradient(135deg, #2563EB, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-ask {
  flex: 1;
  padding: 14px 20px;
  background-color: #ffffff;
  color: #374151;
  border: 2px solid #e5e5e5;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.btn-ask:hover {
  border-color: #3B82F6;
  color: #3B82F6;
}

/* History Section */
.history-section {
  margin-top: 24px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.history-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.btn-clear {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-clear:hover {
  background-color: #f3f4f6;
  color: #374151;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.history-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
  border: 2px solid transparent;
}

.history-item:hover {
  transform: translateY(-2px);
  border-color: #3B82F6;
}

.history-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.history-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  padding: 8px;
  color: white;
  font-size: 11px;
}

/* Paste Hint */
.paste-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background-color: #fef3c7;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: #92400e;
}

.paste-hint svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.keyboard-shortcut {
  display: inline-block;
  padding: 2px 6px;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 4px;
  font-family: monospace;
  font-weight: 600;
  margin: 0 2px;
}

/* Responsive */
@media (max-width: 900px) {
  .capture-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .capture-header {
    padding: 12px 16px;
  }
  
  .capture-container {
    padding: 16px;
  }
  
  .upload-zone {
    padding: 32px 16px;
  }
  
  .upload-actions {
    flex-direction: column;
  }
  
  .action-buttons {
    flex-direction: column;
  }
}
