/* Mobile-first responsive design for Menu Analysis MVP */

/* CSS Reset and Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 16px;
  background-color: #f8f9fa;
  color: #212529;
  line-height: 1.5;
  min-height: 100vh;
}

/* Main Layout */
main {
  max-width: 480px;
  margin: 0 auto;
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

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

.header-content {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}

.logo-container {
  flex-shrink: 0;
}

.header-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-text {
  flex: 1;
  text-align: left;
}

.header-actions {
  flex-shrink: 0;
}

/* Theme Toggle Button */
.theme-toggle {
  background: #f8f9fa;
  border: 2px solid #dee2e6;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
  font-size: 1.2rem;
}

.theme-toggle:hover {
  background: #e9ecef;
  border-color: #007bff;
  transform: scale(1.05);
}

.theme-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.theme-icon {
  position: absolute;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Light mode - show sun icon, hide moon */
body:not(.dark-mode) .theme-toggle .light-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

body:not(.dark-mode) .theme-toggle .dark-icon {
  opacity: 0;
  transform: rotate(180deg) scale(0.5);
}

/* Dark mode - show moon icon, hide sun */
body.dark-mode .theme-toggle .light-icon {
  opacity: 0;
  transform: rotate(-180deg) scale(0.5);
}

body.dark-mode .theme-toggle .dark-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Screen Reader Only Content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hidden attribute support - CRITICAL for state management */
[hidden] {
  display: none !important;
}

/* Section Spacing */
section {
  margin-bottom: 24px;
}

/* Error Container */
.error-container {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: #721c24;
  font-size: 0.9rem;
}

.error-container.warning {
  background: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
}

.error-container.info {
  background: #d1ecf1;
  border-color: #bee5eb;
  color: #0c5460;
}

/* Upload Section */
.upload-section {
  position: relative;
}

#upload-form {
  position: relative;
}

.file-input-container {
  position: relative;
  margin-bottom: 16px;
}

.file-label {
  display: block;
  position: relative; /* Add positioning context */
  padding: 20px;
  border: 3px dashed #dee2e6;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.file-label:hover {
  border-color: #007bff;
  background: #e3f2fd;
}

.file-label:focus-within {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.label-text {
  display: block;
  font-weight: 600;
  color: #495057;
  margin-bottom: 4px;
}

.file-requirements {
  display: block;
  font-size: 1rem; /* Epic 3.4: ≥16px text requirement */
  color: #6c757d;
}

#file-input {
  position: absolute;
  opacity: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.quality-tip {
  margin-top: 8px;
  font-size: 0.9rem;
  color: #495057;
}

/* Drag Overlay */
.drag-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 123, 255, 0.1);
  border: 3px dashed #007bff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.drag-content {
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-weight: 600;
  color: #007bff;
}

/* Consent */
.consent-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 16px 0;
}

#image-consent {
  /* Epic 3.4: Touch targets ≥44x44px */
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  transform: scale(1);
  margin: 0;
}

#image-consent + label {
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #495057;
  /* Epic 3.4: Touch-friendly label */
  padding: 8px;
  min-height: 44px;
  display: flex;
  align-items: center;
  user-select: none;
}

#image-consent:focus {
  /* Epic 3.4: Focus indicators */
  outline: 3px solid #007bff;
  outline-offset: 2px;
}

#image-consent:focus + label {
  color: #007bff;
}

/* Upload Button */
.upload-btn {
  width: 100%;
  padding: 16px 24px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  min-height: 54px; /* Touch-friendly minimum */
}

.upload-btn:hover:not(:disabled) {
  background: #0056b3;
  transform: translateY(-1px);
}

.upload-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5);
}

.upload-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.btn-icon {
  font-size: 1.2rem;
}

/* Progress Container */
.progress-container {
  margin: 16px 0;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #007bff;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #007bff, #28a745);
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.9rem;
  color: #495057;
  text-align: center;
}

/* Processing Section */
.processing-container {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  background: #fff;
}

.processing-visual {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  position: relative;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e9ecef;
  border-top-color: #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.processing-icon {
  position: absolute;
  font-size: 1.25rem;
}

.processing-texts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.processing-status {
  font-weight: 700;
  color: #212529;
}

.processing-tip {
  color: #fd7e14;
}

.processing-timer {
  color: #6c757d;
}

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

/* Image Preview */
.preview-section {
  margin: 24px 0;
}

.image-preview {
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e9ecef;
}

.preview-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #495057;
}

.remove-btn {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-btn:hover {
  background: #c82333;
}

.remove-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.5);
}

.preview-image-container {
  margin-bottom: 12px;
  text-align: center;
}

#preview-image {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.preview-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: #6c757d;
}

.preview-info span {
  padding: 2px 0;
}

/* Results Section */
.results-section {
  margin: 24px 0;
}

.results-container {
  border: 1px solid #28a745;
  border-radius: 12px;
  padding: 20px;
  background: #f8fff9;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #d4edda;
}

.results-header h3 {
  margin: 0;
  color: #0d3d17;
  font-size: 1.4rem;
  font-weight: 700;
}

.analysis-time {
  font-size: 0.8rem;
  color: #6c757d;
}

.results-content {
  color: #155724;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Result Cards */
.result-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 16px;
  position: relative;
  min-height: 80px; /* Layout stability */
}

/* Analysis Overview Section */
.analysis-overview {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
  width: 100%;
}

/* On mobile, keep single column layout */
@media (max-width: 768px) {
  .analysis-overview {
    display: flex;
    flex-direction: column;
  }
}

/* Card 0: Venue Overview */
.result-card.restaurant-description {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-color: #6c757d;
}

/* Card 0.5: Current Brand Landscape */
.result-card.grants-positioning {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border-color: #9c27b0;
}

.restaurant-description-content,
.grants-positioning-content {
  padding: 8px 0;
}

.description-placeholder {
  text-align: center;
  padding: 20px 16px;
}

.placeholder-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  opacity: 0.7;
}

.placeholder-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 8px;
}

.placeholder-subtext {
  font-size: 0.9rem;
  color: #6c757d;
  font-style: italic;
}

/* Venue overview details */
.restaurant-description-details {
  padding: 8px 0;
}

.description-section {
  margin-bottom: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e9ecef;
}

.description-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.description-section.insights {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  margin-top: 8px;
}

.description-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.description-value {
  font-size: 0.95rem;
  color: #212529;
  line-height: 1.4;
}

.business-insights {
  font-style: italic;
  color: #155724;
  background: #d4edda;
  padding: 8px;
  border-radius: 4px;
  border-left: 3px solid #28a745;
}

/* Current brand landscape details */
.grant-positioning-details {
  padding: 8px 0;
}

.positioning-section {
  margin-bottom: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #e9ecef;
}

.positioning-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.positioning-section.recommendations {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  margin-top: 8px;
}

.positioning-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.positioning-value {
  font-size: 0.95rem;
  color: #212529;
  line-height: 1.4;
}

.positioning-list {
  margin: 0;
  padding-left: 16px;
  list-style-type: disc;
}

.positioning-list li {
  margin-bottom: 6px;
  line-height: 1.4;
}

.positioning-list li:last-child {
  margin-bottom: 0;
}

/* Card 1: Main result */
.result-card.main-result {
  background: linear-gradient(135deg, #e8f5e8 0%, #f0fdf0 100%);
  border-color: #28a745;
  text-align: center;
  padding: 20px 16px;
}

.main-result-header {
  font-size: 1.1rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 12px;
  text-transform: none;
}

.main-result-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: #155724;
  margin-bottom: 8px;
  line-height: 1.2;
}

.result-percentage {
  font-size: 2rem;
  color: #28a745;
  margin-right: 8px;
}

.result-fraction {
  font-size: 1.2rem;
  color: #6c757d;
}

.main-result-description {
  font-size: 0.9rem;
  color: #6c757d;
  font-style: italic;
  margin-bottom: 12px;
}

/* Brands container in main result card */
.result-card.main-result .brands-container {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(40, 167, 69, 0.2);
}

.result-card.main-result .empty-state {
  margin-top: 16px;
  padding: 12px;
  color: #6c757d;
  font-size: 0.9rem;
  font-style: italic;
}

/* Card 2: Brands list */
.result-card.brands-list .card-title,
.result-card.drinks-list .card-title {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #495057;
}

.brands-container,
.drinks-container {
  position: relative;
}

.brands-scroll-area,
.drinks-scroll-area {
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #dee2e6 transparent;
  scroll-behavior: smooth;
  padding-right: 4px;
}

.brands-scroll-area::-webkit-scrollbar,
.drinks-scroll-area::-webkit-scrollbar {
  width: 6px;
}

.brands-scroll-area::-webkit-scrollbar-track,
.drinks-scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.brands-scroll-area::-webkit-scrollbar-thumb,
.drinks-scroll-area::-webkit-scrollbar-thumb {
  background: #dee2e6;
  border-radius: 3px;
}

.brands-scroll-area::-webkit-scrollbar-thumb:hover,
.drinks-scroll-area::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}

/* Brand chips */
.brands-scroll-area {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #007bff;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-chip .brand-name {
  font-weight: 600;
}

.brand-chip .brand-count {
  font-weight: 400;
  opacity: 0.9;
}

/* Alcohol category colors (optional enhancement) */
.brand-chip.whisky { background: #8B4513; }
.brand-chip.gin { background: #2E8B57; }
.brand-chip.vodka { background: #4682B4; }
.brand-chip.rum { background: #CD853F; }
.brand-chip.cognac { background: #A0522D; }
.brand-chip.beer { background: #DAA520; }
.brand-chip.wine { background: #800080; }

/* Card 3: Drink items */
.drinks-scroll-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drink-item {
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 3px solid #e9ecef;
  transition: border-color 0.2s ease;
}

.drink-item:hover {
  border-left-color: #007bff;
}

.drink-name {
  font-weight: 600;
  color: #212529;
  font-size: 1rem;
  line-height: 1.3;
  margin-bottom: 4px;
}

.drink-description {
  color: #6c757d;
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 4px;
}

.drink-price {
  color: #28a745;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Brand highlighting */
.brand-highlight {
  background: #fff3cd;
  color: #856404;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 600;
  border: 1px solid #ffeaa7;
}

/* Empty states */
.empty-state {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 20px;
  font-size: 0.9rem;
}

/* Error fallback for results */
.result-error {
  text-align: center;
  padding: 40px 20px;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  color: #721c24;
}

.result-error .error-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.result-error .error-message {
  font-size: 1rem;
  margin-bottom: 16px;
  font-weight: 500;
}

.result-error .retry-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.result-error .retry-btn:hover {
  background: #c82333;
}

.result-error .retry-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.5);
}

/* Scroll indicators */
.result-card.scroll-top::before {
  content: "";
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1), transparent);
  pointer-events: none;
  z-index: 1;
}

.result-card.scroll-bottom::after {
  content: "";
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.1), transparent);
  pointer-events: none;
  z-index: 1;
}

/* Result Actions */
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px; /* Touch-friendly */
  text-decoration: none;
}

.action-btn.primary {
  background: #007bff;
  color: white;
}

.action-btn.primary:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

.action-btn.primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5);
}

.action-btn.secondary {
  background: #6c757d;
  color: white;
}

.action-btn.secondary:hover {
  background: #545b62;
  transform: translateY(-1px);
}

.action-btn.secondary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.5);
}

.action-btn:active {
  transform: translateY(0);
}

.action-btn .btn-icon {
  font-size: 1.1rem;
}

.result-placeholder {
  text-align: center;
  padding: 20px;
  color: #6c757d;
  font-style: italic;
}

/* Status Container */
.status-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 1000;
  max-width: calc(100vw - 40px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.status-container:not(:empty) {
  opacity: 1;
}

.status-container.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.status-container.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-container.warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.status-container.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Responsive Design - Tablet and larger screens */
@media (min-width: 481px) {
  body {
    padding: 24px;
  }
  
  main {
    max-width: 640px;
    padding: 32px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .header-logo {
    width: 80px;
    height: 80px;
  }
  
  .header-content {
    gap: 20px;
    padding: 20px 0;
  }
  
  .file-label {
    padding: 32px;
  }
  
  .preview-info {
    flex-direction: row;
    justify-content: space-between;
  }
  
  #preview-image {
    max-height: 300px;
  }
  
  /* Results responsive improvements */
  .result-actions {
    flex-direction: row;
    justify-content: center;
    gap: 16px;
  }
  
  .action-btn {
    flex: 0 0 auto;
    min-width: 160px;
  }
  
  .brands-scroll-area,
  .drinks-scroll-area {
    max-height: 250px;
  }
  
  .main-result-text {
    font-size: 1.8rem;
  }
  
  .result-percentage {
    font-size: 2.5rem;
  }
}

@media (min-width: 769px) {
  main {
    max-width: 800px;
    padding: 40px;
  }
  
  .header-logo {
    width: 100px;
    height: 100px;
  }
  
  .header-content {
    gap: 24px;
    padding: 24px 0;
  }
  
  .upload-btn {
    max-width: 300px;
    margin: 0 auto;
  }
  
  /* Desktop layout for results */
  .results-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 20px;
  }
  
  .analysis-overview {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  
  .result-card.main-result {
    grid-column: 1 / -1;
  }
  
  .result-card.suggestions-list {
    grid-column: 1 / -1;
  }
  
  .result-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
  }
  
  .brands-scroll-area,
  .drinks-scroll-area {
    max-height: 300px;
  }
  
  .main-result-text {
    font-size: 2rem;
  }
  
  .result-percentage {
    font-size: 3rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .file-label {
    border-width: 4px;
  }
  
  .upload-btn:focus,
  .remove-btn:focus {
    outline: 3px solid currentColor;
    outline-offset: 2px;
  }
  
  /* High contrast for results */
  .result-card {
    border-width: 2px;
  }
  
  .brand-chip {
    border: 2px solid currentColor;
  }
  
  .brand-highlight {
    border-width: 2px;
  }
  
  .action-btn:focus {
    outline: 3px solid currentColor;
    outline-offset: 2px;
  }
  
  .drink-item {
    border-left-width: 4px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================================
   Producer Suggestions Styles
   ============================================================================ */

/* Suggestions card and container */
.suggestions-scroll-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #dee2e6 transparent;
}

.suggestions-scroll-area::-webkit-scrollbar {
  width: 6px;
}

.suggestions-scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.suggestions-scroll-area::-webkit-scrollbar-thumb {
  background: #dee2e6;
  border-radius: 3px;
}

.suggestions-scroll-area::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}

/* Individual suggestion item */
.suggestion-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.suggestion-item:hover {
  background: #e9ecef;
  border-color: #007bff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.suggestion-item.selected {
  background: #e7f3ff;
  border-color: #007bff;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}


/* Checkbox styling */
.suggestion-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: #007bff;
}

/* Suggestion content area */
.suggestion-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suggestion-text {
  font-size: 0.95rem;
  line-height: 1.4;
  color: #495057;
  margin: 0;
  font-weight: 500;
}

/* Suggestion meta information */
.suggestion-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #6c757d;
}

/* Category badge */
.suggestion-category {
  background: #007bff;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.75rem;
  white-space: nowrap;
}

/* Priority badge */
.suggestion-priority {
  background: #28a745;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.75rem;
  white-space: nowrap;
}

.suggestion-priority.priority-1 {
  background: #dc3545; /* High priority - red */
}

.suggestion-priority.priority-2 {
  background: #fd7e14; /* Medium priority - orange */
}

.suggestion-priority.priority-3 {
  background: #ffc107; /* Low priority - yellow */
  color: #000;
}

.suggestion-priority.priority-4 {
  background: #6c757d; /* Very low priority - gray */
}

/* Brand name badge */
.suggestion-brand {
  background: #6f42c1;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.75rem;
  white-space: nowrap;
}

/* Confirm button */
#confirm-suggestions-btn {
  width: 100%;
  padding: 12px 20px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 12px;
}

#confirm-suggestions-btn:hover:not(:disabled) {
  background: #218838;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

#confirm-suggestions-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===================================
   Strategic Insights Styles
   =================================== */

.strategic-insights-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Summary Section */
.insight-summary {
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  margin-bottom: 8px;
}

.insight-summary-text {
  font-size: 0.95rem;
  line-height: 1.6;
  font-weight: 500;
}

/* Priority Actions Section */
.priority-actions-section {
  padding: 16px;
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  border-radius: 8px;
}

.insight-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #212529;
  margin: 0 0 12px 0;
}

.priority-actions-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.priority-action-item {
  padding: 10px 12px;
  background: white;
  border-radius: 6px;
  border-left: 3px solid #ffc107;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #495057;
}

/* Insights Section */
.insights-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.strategic-insight-item {
  padding: 16px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.strategic-insight-item:hover {
  background: #e9ecef;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.insight-title {
  font-size: 1rem;
  font-weight: 600;
  color: #212529;
  margin: 0;
  flex: 1;
}

.insight-type {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase;
}

.insight-type-expansion {
  background: #d1ecf1;
  color: #0c5460;
}

.insight-type-premium {
  background: #f8d7da;
  color: #721c24;
}

.insight-type-targeting {
  background: #d4edda;
  color: #155724;
}

.insight-type-experience {
  background: #fff3cd;
  color: #856404;
}

.insight-type-competitive {
  background: #e2e3e5;
  color: #383d41;
}

.insight-type-general {
  background: #e7e8ea;
  color: #495057;
}

.insight-description {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #495057;
  white-space: pre-wrap;
}

/* Empty state for suggestions */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
  font-style: italic;
}

/* Dark mode support - Class-based instead of system preference */
body.dark-mode {
  background-color: #1a1a1a;
  color: #e9ecef;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode main {
  background: #2d3748;
  color: #e9ecef;
}

body.dark-mode h1 {
  color: #f8f9fa;
}

body.dark-mode .header-logo {
  box-shadow: 0 2px 8px rgba(255,255,255,0.1);
}

body.dark-mode .theme-toggle {
  background: #4a5568;
  border-color: #6c757d;
  color: #e9ecef;
}

body.dark-mode .theme-toggle:hover {
  background: #5a6578;
  border-color: #007bff;
}

body.dark-mode .file-label {
  background: #4a5568;
  border-color: #6c757d;
  color: #e9ecef;
}

body.dark-mode .file-label:hover {
  background: #5a6578;
  border-color: #007bff;
}

body.dark-mode .image-preview {
  background: #4a5568;
  border-color: #6c757d;
}

body.dark-mode .processing-container {
  background: #4a5568;
  border-color: #6c757d;
}

body.dark-mode .drag-content {
  background: #4a5568;
  color: #007bff;
}

/* Dark mode for results */
body.dark-mode .results-container {
  background: #2d3748;
  border-color: #28a745;
}

body.dark-mode .results-header h3 {
  color: #f8f9fa;
}

body.dark-mode .result-card {
  background: #4a5568;
  border-color: #6c757d;
  color: #e9ecef;
}

body.dark-mode .result-card.restaurant-description {
  background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
  border-color: #6c757d;
}

body.dark-mode .result-card.grants-positioning {
  background: linear-gradient(135deg, #2d1b69 0%, #4a148c 100%);
  border-color: #9c27b0;
}

body.dark-mode .positioning-label {
  color: #e9ecef;
}

body.dark-mode .positioning-value {
  color: #f8f9fa;
}

body.dark-mode .positioning-section.recommendations {
  background: #1a1a2e;
  border-color: #16213e;
}

body.dark-mode .placeholder-text {
  color: #e9ecef;
}

body.dark-mode .placeholder-subtext {
  color: #a0aec0;
}

body.dark-mode .description-section {
  border-bottom-color: #4a5568;
}

body.dark-mode .description-section.insights {
  background: #2d3748;
  border-color: #4a5568;
}

body.dark-mode .description-label {
  color: #e9ecef;
}

body.dark-mode .description-value {
  color: #f8f9fa;
}

body.dark-mode .business-insights {
  color: #d4edda;
  background: #1a2e1a;
  border-left-color: #28a745;
}

body.dark-mode .result-card.main-result {
  background: linear-gradient(135deg, #1a2e1a 0%, #2d3e2d 100%);
  border-color: #28a745;
}

body.dark-mode .main-result-text {
  color: #f8f9fa;
}

body.dark-mode .result-percentage {
  color: #28a745;
}

body.dark-mode .main-result-description {
  color: #adb5bd;
}

body.dark-mode .main-result-header,
body.dark-mode .card-title {
  color: #e9ecef;
}

body.dark-mode .drink-item {
  background: #5a6578;
}

body.dark-mode .drink-name {
  color: #f8f9fa;
}

body.dark-mode .drink-description {
  color: #adb5bd;
}

body.dark-mode .brand-highlight {
  background: #856404;
  color: #fff3cd;
  border-color: #856404;
}

body.dark-mode .empty-state {
  color: #adb5bd;
}

body.dark-mode .suggestion-item {
  background: #5a6578;
  border-color: #6c757d;
}

body.dark-mode .suggestion-item:hover {
  background: #6a7488;
  border-color: #007bff;
}


body.dark-mode .suggestion-text {
  color: #e9ecef;
}

body.dark-mode .suggestion-item.selected {
  background: #2d4a7a;
  border-color: #007bff;
}

body.dark-mode .suggestion-meta {
  color: #adb5bd;
}

body.dark-mode .suggestions-scroll-area {
  scrollbar-color: #495057 transparent;
}

body.dark-mode .suggestions-scroll-area::-webkit-scrollbar-thumb {
  background: #495057;
}

body.dark-mode .suggestions-scroll-area::-webkit-scrollbar-thumb:hover {
  background: #6c757d;
}

/* Dark mode styles for Strategic Insights */
body.dark-mode .insight-summary {
  background: linear-gradient(135deg, #4a5568 0%, #553c7a 100%);
}

body.dark-mode .priority-actions-section {
  background: #4a4634;
  border-left-color: #b8860b;
}

body.dark-mode .insight-section-title {
  color: #e9ecef;
}

body.dark-mode .priority-action-item {
  background: #5a6578;
  color: #e9ecef;
  border-left-color: #b8860b;
}

body.dark-mode .strategic-insight-item {
  background: #5a6578;
  border-color: #6c757d;
}

body.dark-mode .strategic-insight-item:hover {
  background: #6a7488;
}

body.dark-mode .insight-title {
  color: #e9ecef;
}

body.dark-mode .insight-description {
  color: #cbd5e0;
}

body.dark-mode .insight-type-expansion {
  background: #2d3748;
  color: #63b3ed;
}

body.dark-mode .insight-type-premium {
  background: #3d2d38;
  color: #fc8181;
}

body.dark-mode .insight-type-targeting {
  background: #2d3d2d;
  color: #68d391;
}

body.dark-mode .insight-type-experience {
  background: #3d3828;
  color: #fbd38d;
}

body.dark-mode .insight-type-competitive {
  background: #353a40;
  color: #a0aec0;
}

body.dark-mode .insight-type-general {
  background: #4a5568;
  color: #cbd5e0;
}

/* Keep the system preference as fallback for users without manual toggle */
@media (prefers-color-scheme: dark) {
  body:not(.light-mode):not(.dark-mode) {
    background-color: #1a1a1a;
    color: #e9ecef;
  }

  body:not(.light-mode):not(.dark-mode) main {
    background: #2d3748;
    color: #e9ecef;
  }

  body:not(.light-mode):not(.dark-mode) h1 {
    color: #f8f9fa;
  }

  body:not(.light-mode):not(.dark-mode) .header-logo {
    box-shadow: 0 2px 8px rgba(255,255,255,0.1);
  }

  body:not(.light-mode):not(.dark-mode) .theme-toggle {
    background: #4a5568;
    border-color: #6c757d;
    color: #e9ecef;
  }

  body:not(.light-mode):not(.dark-mode) .theme-toggle:hover {
    background: #5a6578;
    border-color: #007bff;
  }

  body:not(.light-mode):not(.dark-mode) .file-label {
    background: #4a5568;
    border-color: #6c757d;
    color: #e9ecef;
  }

  body:not(.light-mode):not(.dark-mode) .file-label:hover {
    background: #5a6578;
    border-color: #007bff;
  }

  body:not(.light-mode):not(.dark-mode) .image-preview {
    background: #4a5568;
    border-color: #6c757d;
  }

  body:not(.light-mode):not(.dark-mode) .results-container {
    background: #2d3748;
    border-color: #28a745;
  }

  body:not(.light-mode):not(.dark-mode) .results-header h3 {
    color: #f8f9fa;
  }

  body:not(.light-mode):not(.dark-mode) .result-card {
    background: #4a5568;
    border-color: #6c757d;
    color: #e9ecef;
  }

  body:not(.light-mode):not(.dark-mode) .result-card.main-result {
    background: linear-gradient(135deg, #1a2e1a 0%, #2d3e2d 100%);
    border-color: #28a745;
  }

  body:not(.light-mode):not(.dark-mode) .main-result-text {
    color: #f8f9fa;
  }

  body:not(.light-mode):not(.dark-mode) .result-percentage {
    color: #28a745;
  }

  body:not(.light-mode):not(.dark-mode) .main-result-description {
    color: #adb5bd;
  }

  body:not(.light-mode):not(.dark-mode) .main-result-header,
  body:not(.light-mode):not(.dark-mode) .card-title {
    color: #e9ecef;
  }

  body:not(.light-mode):not(.dark-mode) .drink-item {
    background: #5a6578;
  }

  body:not(.light-mode):not(.dark-mode) .drink-name {
    color: #f8f9fa;
  }

  body:not(.light-mode):not(.dark-mode) .drink-description {
    color: #adb5bd;
  }

  body:not(.light-mode):not(.dark-mode) .brand-highlight {
    background: #856404;
    color: #fff3cd;
    border-color: #856404;
  }

  body:not(.light-mode):not(.dark-mode) .empty-state {
    color: #adb5bd;
  }
}
