/**
 * Plant List Matcher - Styles
 * Follows Progressive Plants design patterns
 */

/* ============= Container & Layout ============= */
.plant-matcher-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.page-header {
  text-align: center;
  margin-bottom: 30px;
  background: rgba(24, 24, 24, 0.85);
  padding: 25px 20px;
  border-radius: 8px;
}

.page-header h1 {
  color: #fff;
  font-size: 2em;
  margin-bottom: 10px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.page-header p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1em;
}

/* ============= Auth Gate ============= */
.auth-gate {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.auth-gate-content {
  text-align: center;
  padding: 40px;
  background: #f8f9fa;
  border-radius: 12px;
  max-width: 400px;
}

.auth-icon {
  width: 64px;
  height: 64px;
  color: #4a6830;
  margin-bottom: 20px;
}

.auth-gate h2 {
  color: #333;
  margin-bottom: 15px;
}

.auth-gate p {
  color: #666;
  margin-bottom: 25px;
}

.auth-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

/* ============= Section Styles ============= */
.matcher-section {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 25px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #4a6830;
  color: #fff;
  border-radius: 50%;
  font-weight: 600;
  font-size: 1.1em;
}

.section-header h2 {
  color: #333;
  font-size: 1.4em;
  margin: 0;
}

.section-description {
  color: #666;
  margin-bottom: 20px;
}

/* ============= Upload Area ============= */
.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 30px;
  border: 2px dashed #ccc;
  border-radius: 12px;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-area:hover {
  border-color: #4a6830;
  background: #f5f9f3;
}

.upload-area.drag-over {
  border-color: #4a6830;
  background: #e8f5e3;
  border-style: solid;
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: #4a6830;
  margin-bottom: 15px;
}

.upload-text {
  font-size: 1.1em;
  color: #333;
  margin-bottom: 8px;
}

.upload-hint {
  font-size: 0.9em;
  color: #888;
}

/* ============= Files Preview ============= */
.files-preview {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.files-header {
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 10px;
}

.file-icon {
  font-size: 1.5em;
}

.file-details {
  flex: 1;
}

.file-name {
  font-weight: 500;
  color: #333;
  word-break: break-word;
}

.file-size {
  font-size: 0.85em;
  color: #888;
}

.file-remove {
  background: none;
  border: none;
  font-size: 1.5em;
  color: #999;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
}

.file-remove:hover {
  color: #dc3545;
}

.btn-add-more {
  display: block;
  width: 100%;
  padding: 12px;
  background: #fff;
  border: 1px dashed #4a6830;
  border-radius: 8px;
  color: #4a6830;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-more:hover {
  background: #f5f9f3;
}

/* ============= Turnstile Container ============= */
.turnstile-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

/* ============= Messages ============= */
.message {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 15px 0;
  font-size: 0.95em;
}

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

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

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

/* ============= Progress Indicator ============= */
.progress-container {
  margin: 20px 0;
  text-align: center;
}

.progress-bar {
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a6830, #6b8f48);
  width: 0%;
  animation: progress-indeterminate 1.5s infinite ease-in-out;
}

@keyframes progress-indeterminate {
  0% { width: 0%; margin-left: 0%; }
  50% { width: 50%; margin-left: 25%; }
  100% { width: 0%; margin-left: 100%; }
}

.progress-text {
  color: #666;
  font-size: 0.95em;
}

/* ============= Buttons ============= */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #4a6830;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
  text-decoration: none;
}

.btn-primary:hover {
  background: #3d5728;
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #fff;
  color: #4a6830;
  border: 2px solid #4a6830;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

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

.btn-success {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-success:hover {
  background: #218838;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  color: #666;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  border-color: #999;
  color: #333;
}

.btn-large {
  padding: 14px 32px;
  font-size: 1.1em;
  width: 100%;
  justify-content: center;
  margin-top: 15px;
}

.btn-notify {
  padding: 6px 12px;
  background: #17a2b8;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.85em;
  cursor: pointer;
}

.btn-notify:hover {
  background: #138496;
}

.btn-notify.btn-disabled {
  background: #6c757d;
  cursor: default;
}

.btn-view {
  padding: 6px 12px;
  background: #f8f9fa;
  color: #4a6830;
  border: 1px solid #4a6830;
  border-radius: 4px;
  font-size: 0.85em;
  text-decoration: none;
}

.btn-view:hover {
  background: #f5f9f3;
}

/* ============= Results Summary ============= */
.results-summary {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.summary-stat {
  text-align: center;
  padding: 20px 30px;
  background: #f8f9fa;
  border-radius: 8px;
  min-width: 120px;
}

.stat-value {
  display: block;
  font-size: 2em;
  font-weight: 600;
  color: #333;
}

.stat-label {
  font-size: 0.9em;
  color: #666;
}

.summary-stat.in-stock {
  background: #d4edda;
}

.summary-stat.in-stock .stat-value {
  color: #155724;
}

.summary-stat.out-of-stock {
  background: #fff3cd;
}

.summary-stat.out-of-stock .stat-value {
  color: #856404;
}

/* ============= Results Table ============= */
.results-table-container {
  overflow-x: auto;
  margin-bottom: 25px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

.results-table th,
.results-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
  color: #333;
}

.results-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.results-table tr:hover {
  background: #f8f9fa;
}

.results-table tr.out-of-stock {
  background: #fffbeb;
}

.plant-cell {
  max-width: 300px;
}

/* Plant Name Styling */
.plant-extracted-name {
  font-size: 0.85em;
  color: #666;
  margin-bottom: 4px;
}

.plant-extracted-label {
  font-weight: 500;
  color: #888;
}

.plant-matched-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.plant-matched-name a {
  color: #4a6830;
  text-decoration: none;
  font-weight: 500;
}

.plant-matched-name a:hover {
  text-decoration: underline;
}

/* Confidence Icons */
.confidence-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.75em;
  font-weight: 600;
}

.confidence-icon.confidence-high {
  background: #d4edda;
  color: #155724;
}

.confidence-icon.confidence-medium {
  background: #fff3cd;
  color: #856404;
}

.confidence-icon.confidence-low {
  background: #f8d7da;
  color: #721c24;
}

.confidence-icon.confidence-none {
  background: #e0e0e0;
  color: #666;
}

.extracted-name {
  font-size: 0.85em;
  color: #888;
  margin-bottom: 4px;
}

.matched-name {
  font-weight: 500;
}

.matched-name a {
  color: #4a6830;
  text-decoration: none;
}

.matched-name a:hover {
  text-decoration: underline;
}

/* Confidence Badges */
.confidence-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 500;
}

.confidence-high {
  background: #d4edda;
  color: #155724;
}

.confidence-medium {
  background: #fff3cd;
  color: #856404;
}

.confidence-low {
  background: #f8d7da;
  color: #721c24;
}

.confidence-none {
  background: #e0e0e0;
  color: #666;
}

/* Availability Cell */
.availability-cell {
  min-width: 150px;
}

.stock-badge {
  display: inline-block;
  padding: 4px 8px;
  background: #d4edda;
  color: #155724;
  border-radius: 4px;
  font-size: 0.85em;
  margin: 2px 4px 2px 0;
}

.no-stock {
  color: #856404;
  font-style: italic;
}

/* Availability Sections */
.current-availability-section,
.future-availability-section {
  margin-bottom: 10px;
}

.availability-label {
  font-size: 0.75em;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.availability-label.future-label {
  color: #0c5460;
}

/* Selectable Badges */
.selectable-badge {
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-block;
  margin: 2px 4px 2px 0;
}

.selectable-badge:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.selectable-badge.selected {
  background: #4a6830 !important;
  color: #fff !important;
  border-color: #3d5728 !important;
}

.selectable-badge.perfect-match {
  background: #d4edda;
  color: #155724;
  border: 2px solid #28a745;
}

.selectable-badge.partial-match {
  background: #fff3cd;
  color: #856404;
  border: 2px solid #ffc107;
}

/* Future Badges */
.future-badge {
  display: inline-block;
  padding: 4px 8px;
  background: #d1ecf1;
  color: #0c5460;
  border-radius: 4px;
  font-size: 0.85em;
  margin: 2px 4px 2px 0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.future-badge:hover {
  background: #bee5eb;
}

.future-badge.future-match {
  background: #cce5ff;
  color: #004085;
  border: 2px solid #007bff;
}

.future-badge.future-partial {
  background: #e2d9f3;
  color: #5a5a5a;
  border: 2px solid #6f42c1;
}

.future-badge.future-none {
  background: #e0e0e0;
  color: #666;
  cursor: default;
}

.future-more-toggle {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.8em;
  color: #0c5460;
  cursor: pointer;
  text-decoration: underline;
}

.future-more-toggle:hover {
  color: #085a68;
}

.future-more-content {
  margin-top: 4px;
  padding-left: 8px;
  border-left: 2px solid #bee5eb;
}

/* Qty Input Inline */
.qty-input-inline {
  width: 50px;
  padding: 2px 4px;
  margin-left: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85em;
  text-align: center;
}

.qty-input-inline:focus {
  outline: none;
  border-color: #4a6830;
  box-shadow: 0 0 0 2px rgba(74, 104, 48, 0.2);
}

/* Floating Order Cart Panel */
.order-cart-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 280px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
}

.order-cart-panel.minimized {
  width: auto;
}

.cart-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 15px;
  background: #4a6830;
  color: #fff;
}

.cart-icon {
  font-size: 1.2em;
}

.cart-title {
  flex: 1;
  font-weight: 600;
}

.cart-minimize {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2em;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.cart-minimize:hover {
  opacity: 0.8;
}

.cart-body {
  padding: 15px;
}

.cart-summary {
  margin-bottom: 12px;
}

.cart-item-count {
  font-weight: 600;
  color: #333;
}

.cart-total-qty {
  font-size: 0.9em;
  color: #666;
}

.cart-breakdown {
  font-size: 0.85em;
  color: #718096;
  margin-top: 4px;
}

.cart-breakdown.cart-count {
  color: #38a169; /* green - items going to cart */
}

.cart-breakdown.waitlist-count {
  color: #3182ce; /* blue - items going to waitlist */
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 10px;
}

.cart-total-amount {
  font-size: 1.2em;
  font-weight: 600;
  color: #4a6830;
}

.cart-price-warning {
  font-size: 0.85em;
  color: #856404;
  background: #fff3cd;
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-actions .btn {
  width: 100%;
  justify-content: center;
}

.cart-clear-link {
  text-align: center;
  font-size: 0.85em;
  color: #666;
}

.cart-clear-link:hover {
  color: #dc3545;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9em;
}

/* Actions Cell */
.actions-cell {
  white-space: nowrap;
}

.actions-cell > * {
  margin-right: 8px;
}

/* Batch Actions */
.batch-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

/* Results Actions */
.results-actions {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  gap: 15px;
  -webkit-box-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
}

/* ============= Notifications ============= */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.3s ease;
  max-width: 400px;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

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

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

.notification button {
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  opacity: 0.7;
  color: inherit;
}

.notification button:hover {
  opacity: 1;
}

/* ============= Footer ============= */
footer {
  background: #f8f9fa;
  padding: 30px 20px;
  margin-top: 40px;
  border-top: 1px solid #e0e0e0;
}

.footer-content {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-section {
  color: #666;
}

.footer-section a {
  color: #4a6830;
  text-decoration: none;
  margin-left: 20px;
}

.footer-section a:hover {
  text-decoration: underline;
}

/* ============= Plant Selector Modal ============= */
.plant-selector-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.plant-selector-modal .modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.plant-selector-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #e0e0e0;
}

.plant-selector-modal .modal-header h3 {
  margin: 0;
  color: #333;
}

.plant-selector-modal .modal-close {
  font-size: 24px;
  cursor: pointer;
  color: #666;
  line-height: 1;
}

.plant-selector-modal .modal-close:hover {
  color: #333;
}

.plant-selector-modal .modal-body {
  padding: 15px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.plant-search-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  margin-bottom: 15px;
  box-sizing: border-box;
}

.plant-search-input:focus {
  outline: none;
  border-color: #4a6830;
}

.plant-search-results {
  max-height: 300px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.plant-option {
  padding: 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.2s;
}

.plant-option:hover {
  background: #f5f5f5;
}

.plant-option:last-child {
  border-bottom: none;
}

.plant-option-name {
  font-size: 14px;
  color: #333;
}

.search-hint, .search-loading, .search-no-results, .search-error {
  padding: 20px;
  text-align: center;
  color: #666;
  font-size: 14px;
}

.search-error {
  color: #d32f2f;
}

/* Change plant link */
.change-plant-link {
  margin-left: 8px;
  color: #888;
  text-decoration: none;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s;
}

.change-plant-link:hover {
  color: #4a6830;
  opacity: 1;
}

/* ============= Mobile Camera Option ============= */
.mobile-camera-option {
  display: none; /* Hidden on desktop */
  text-align: center;
  margin-top: 15px;
}

.mobile-divider {
  display: block;
  color: #888;
  font-size: 0.9em;
  margin-bottom: 10px;
}

.btn-camera {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #17a2b8;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  -webkit-transition: background 0.2s ease;
  transition: background 0.2s ease;
}

.btn-camera:hover {
  background: #138496;
}

.btn-camera svg {
  -webkit-flex-shrink: 0;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

/* ============= Responsive ============= */
@media screen and (max-width: 768px) {
  /* Show camera button on mobile */
  .mobile-camera-option {
    display: block;
  }

  .plant-matcher-container {
    padding: 10px;
  }

  .page-header {
    padding: 15px 12px;
    margin-bottom: 20px;
  }

  .page-header h1 {
    font-size: 1.5em;
  }

  .page-header p {
    font-size: 0.95em;
  }

  .matcher-section {
    padding: 15px;
  }

  .section-header {
    -webkit-box-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
  }

  .section-header h2 {
    font-size: 1.2em;
  }

  .upload-area {
    padding: 30px 20px;
  }

  .results-summary {
    gap: 10px;
  }

  .summary-stat {
    padding: 15px 20px;
    min-width: 100px;
  }

  /* Mobile Card Layout - No horizontal scrolling */
  .results-table-container {
    overflow-x: visible;
  }

  .results-table {
    display: block;
    font-size: 0.9em;
  }

  .results-table thead {
    display: none; /* Hide column headers on mobile */
  }

  .results-table tbody {
    display: block;
  }

  .results-table tr {
    display: block;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }

  .results-table tr:hover {
    background: #fff;
  }

  .results-table td {
    display: block;
    border: none;
    padding: 8px 0;
    text-align: left;
  }

  /* Plant name - full width, prominent */
  .results-table td.plant-cell {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 12px;
    margin-bottom: 8px;
  }

  /* Qty and Size - inline row with labels */
  .results-table td:nth-child(2),
  .results-table td:nth-child(3) {
    display: inline-block;
    width: auto;
    padding-right: 20px;
    font-weight: 500;
  }

  .results-table td:nth-child(2)::before {
    content: 'Qty: ';
    font-weight: 600;
    color: #666;
  }

  .results-table td:nth-child(3)::before {
    content: 'Size: ';
    font-weight: 600;
    color: #666;
  }

  /* Availability - full width, wrap badges */
  .results-table td.availability-cell {
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
    margin-top: 8px;
  }

  /* Actions cell - hidden on mobile (actions in availability badges) */
  .results-table td.actions-cell {
    display: none;
  }

  /* Larger touch targets for badges */
  .selectable-badge,
  .future-badge {
    padding: 8px 12px;
    margin: 4px;
    min-height: 36px;
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    font-size: 0.85em;
  }

  .batch-actions {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
  }

  .batch-actions button {
    width: 100%;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
  }

  /* Stack action buttons vertically */
  .results-actions {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 10px;
  }

  .results-actions button,
  .results-actions a {
    width: 100%;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
  }

  .auth-actions {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
  }

  /* Order cart panel - full width on mobile */
  .order-cart-panel {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
  }

  /* Cart preview dropdown */
  .cart-preview-dropdown {
    width: calc(100vw - 40px);
    max-width: none;
    left: 10px;
    right: 10px;
  }

  .footer-content {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    text-align: center;
  }

  .footer-section a {
    margin: 0 10px;
  }
}

/* Small mobile - 425px and below */
@media screen and (max-width: 425px) {
  .page-header h1 {
    font-size: 1.3em;
  }

  .step-number {
    width: 24px;
    height: 24px;
    font-size: 0.9em;
  }

  .upload-area {
    padding: 20px 15px;
  }

  .upload-hint {
    font-size: 0.8em;
  }
}

/* ============= Modal Overlay (shared) ============= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-overlay .modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  max-width: 90%;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-overlay .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0e0e0;
}

.modal-overlay .modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.25em;
}

.modal-overlay .modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  line-height: 1;
  padding: 0;
}

.modal-overlay .modal-close:hover {
  color: #333;
}

/* ============= Size Picker Modal ============= */
.size-picker-modal {
  max-width: 450px;
}

.size-picker-plant {
  font-weight: 600;
  color: #4a6830;
  margin-bottom: 5px;
}

.size-picker-hint {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 15px;
}

.size-picker-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.size-picker-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.size-picker-option:hover {
  border-color: #4a6830;
  background: #f0f5ec;
}

.size-picker-option .size-name {
  font-weight: 600;
  color: #333;
}

.size-picker-option .size-details {
  font-size: 0.85em;
  color: #666;
}

/* ============= Order Review Modal ============= */
.order-review-modal {
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

.review-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.review-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.review-section-title {
  font-size: 1em;
  font-weight: 600;
  color: #4a6830;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 6px;
}

.review-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-item-name {
  font-weight: 500;
  color: #333;
  font-size: 0.95em;
}

.review-item-size {
  font-size: 0.85em;
  color: #666;
}

.review-item-details {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9em;
}

.review-item-price,
.review-item-date {
  color: #666;
}

.review-item-total,
.review-item-qty {
  font-weight: 600;
  color: #4a6830;
}

.review-item-remove {
  background: none;
  border: none;
  color: #999;
  font-size: 1.2em;
  cursor: pointer;
  padding: 0 5px;
  line-height: 1;
}

.review-item-remove:hover {
  color: #dc3545;
}

.review-section-total {
  text-align: right;
  font-weight: 600;
  color: #4a6830;
  padding-top: 10px;
  font-size: 1.1em;
}

.review-empty {
  color: #999;
  font-style: italic;
  text-align: center;
  padding: 15px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
  margin-top: 15px;
}

.modal-footer .btn-secondary {
  background: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
}

.modal-footer .btn-secondary:hover {
  background: #e0e0e0;
}

.modal-footer .btn-primary {
  background: #4a6830;
  color: white;
  border: none;
}

.modal-footer .btn-primary:hover {
  background: #3d5728;
}

/* ============= Cart Animation & Interactivity ============= */

/* Cart header bounce animation when items added */
@-webkit-keyframes cartBounce {
  0%, 100% { -webkit-transform: scale(1); transform: scale(1); }
  50% { -webkit-transform: scale(1.1); transform: scale(1.1); }
}
@keyframes cartBounce {
  0%, 100% { -webkit-transform: scale(1); transform: scale(1); }
  50% { -webkit-transform: scale(1.1); transform: scale(1.1); }
}

.cart-header.item-added {
  -webkit-animation: cartBounce 0.3s ease;
  animation: cartBounce 0.3s ease;
}

.cart-header.item-added .cart-icon {
  -webkit-animation: cartBounce 0.3s ease;
  animation: cartBounce 0.3s ease;
}

/* Clickable cart summary */
.cart-summary.clickable {
  cursor: pointer;
  padding: 8px;
  margin: -8px -8px 12px -8px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.cart-summary.clickable:hover {
  background-color: #f0f5ec;
}

.cart-summary-hint {
  font-size: 0.75em;
  color: #999;
  margin-top: 4px;
}

/* Selection hint for availability badges */
.selection-hint {
  display: block;
  font-size: 0.75em;
  color: #888;
  margin-top: 6px;
  font-style: italic;
}

/* Pulsing hint on first badge (first-time users) */
@-webkit-keyframes badgePulse {
  0%, 100% { -webkit-box-shadow: 0 0 0 0 rgba(74, 104, 48, 0.4); box-shadow: 0 0 0 0 rgba(74, 104, 48, 0.4); }
  50% { -webkit-box-shadow: 0 0 0 4px rgba(74, 104, 48, 0.2); box-shadow: 0 0 0 4px rgba(74, 104, 48, 0.2); }
}
@keyframes badgePulse {
  0%, 100% { -webkit-box-shadow: 0 0 0 0 rgba(74, 104, 48, 0.4); box-shadow: 0 0 0 0 rgba(74, 104, 48, 0.4); }
  50% { -webkit-box-shadow: 0 0 0 4px rgba(74, 104, 48, 0.2); box-shadow: 0 0 0 4px rgba(74, 104, 48, 0.2); }
}

.selectable-badge.pulse-hint {
  -webkit-animation: badgePulse 1.5s ease-in-out 3;
  animation: badgePulse 1.5s ease-in-out 3;
}

/* Plus icon on badge hover */
.selectable-badge:not(.selected):hover::after {
  content: '+';
  margin-left: 4px;
  font-weight: bold;
  color: #4a6830;
}

.selectable-badge.selected::after {
  content: '✓';
  margin-left: 4px;
  font-weight: bold;
}

/* Cart preview dropdown */
.cart-preview-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: -1px;
}

.cart-preview-header {
  padding: 10px 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 600;
  color: #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-preview-close {
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  color: #666;
  padding: 0;
  line-height: 1;
}

.cart-preview-close:hover {
  color: #333;
}

.cart-preview-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.cart-preview-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  border-bottom: 1px solid #f0f0f0;
}

.cart-preview-item:last-child {
  border-bottom: none;
}

.cart-preview-item-info {
  flex: 1;
  min-width: 0;
}

.cart-preview-item-name {
  font-size: 0.9em;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-preview-item-details {
  font-size: 0.8em;
  color: #666;
}

.cart-preview-item-remove {
  background: none;
  border: none;
  color: #999;
  font-size: 1.1em;
  cursor: pointer;
  padding: 0 5px;
  margin-left: 10px;
}

.cart-preview-item-remove:hover {
  color: #dc3545;
}

.cart-preview-empty {
  padding: 20px;
  text-align: center;
  color: #999;
  font-style: italic;
}

/* Quantity input in review modal */
.review-qty-input {
  width: 60px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9em;
  text-align: center;
  margin-right: 8px;
}

.review-qty-input:focus {
  outline: none;
  border-color: #4a6830;
  box-shadow: 0 0 0 2px rgba(74, 104, 48, 0.2);
}

/* ============= Instructions Modal ============= */

/* Help link in section description */
.help-link {
  color: #4a6830;
  text-decoration: underline;
  font-weight: 500;
  margin-left: 8px;
}

.help-link:hover {
  color: #3d5728;
}

/* Instructions Modal */
.instructions-modal {
  max-width: 550px;
  max-height: 85vh;
  overflow-y: auto;
}

.instructions-modal h4 {
  color: #4a6830;
  margin: 20px 0 12px 0;
  font-size: 1.1em;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 8px;
}

.instructions-modal h4:first-of-type {
  margin-top: 0;
}

.instructions-modal h5 {
  color: #666;
  margin: 12px 0 8px 0;
  font-size: 0.95em;
}

/* AI Disclaimer box */
.ai-disclaimer {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 12px 15px;
  margin-bottom: 15px;
  font-size: 0.9em;
  color: #856404;
}

/* Legend items */
.legend-section {
  margin-bottom: 15px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.legend-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.85em;
  min-width: 80px;
  text-align: center;
}

.legend-badge.perfect-match {
  background: #d4edda;
  color: #155724;
  border: 2px solid #28a745;
}

.legend-badge.partial-match {
  background: #fff3cd;
  color: #856404;
  border: 2px solid #ffc107;
}

.legend-badge.default-badge {
  background: #f8f9fa;
  color: #333;
  border: 1px solid #ccc;
}

.legend-badge.future-match {
  background: #cce5ff;
  color: #004085;
  border: 2px solid #007bff;
}

.legend-badge.future-partial {
  background: #e2d9f3;
  color: #5a5a5a;
  border: 2px solid #6f42c1;
}

.legend-desc {
  flex: 1;
  font-size: 0.9em;
  color: #555;
}

/* Instructions list */
.instructions-list {
  margin: 0;
  padding-left: 20px;
}

.instructions-list li {
  margin-bottom: 8px;
  font-size: 0.9em;
  color: #555;
}

.instructions-list li strong {
  color: #333;
}
