/* Food Transparency Portal - Custom Styles */

/* Custom variables for consistent theming */
:root {
  --fresh-green: #10B981;
  --earth-brown: #8B4513;
  --sky-blue: #3B82F6;
  --warm-orange: #F59E0B;
}

/* Base styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Loading animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: .5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* QR Scanner styles */
#qrReader {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

#qrReader video {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

/* Tab styles */
.tab-button {
  transition: all 0.2s ease-in-out;
}

.tab-button:hover {
  background-color: rgba(16, 185, 129, 0.1);
}

/* Product cards */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Custom hover effects */
.hover-scale:hover {
  transform: scale(1.02);
}

/* Gradient backgrounds */
.bg-gradient-green {
  background: linear-gradient(135deg, var(--fresh-green) 0%, #059669 100%);
}

.bg-gradient-blue {
  background: linear-gradient(135deg, var(--sky-blue) 0%, #2563EB 100%);
}

/* Custom buttons */
.btn-primary {
  @apply bg-fresh-green text-white px-6 py-3 rounded-lg font-semibold hover:bg-green-600 transition-colors;
}

.btn-secondary {
  @apply bg-white text-fresh-green px-6 py-3 rounded-lg font-semibold border-2 border-fresh-green hover:bg-fresh-green hover:text-white transition-colors;
}

/* Supply chain timeline */
.timeline-dot {
  box-shadow: 0 0 0 4px white;
}

/* Certification badges */
.certification-badge {
  @apply inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-green-100 text-green-800;
}

/* Alert styles */
.alert-critical {
  @apply bg-red-100 border-red-500 text-red-900;
}

.alert-high {
  @apply bg-orange-100 border-orange-500 text-orange-900;
}

.alert-medium {
  @apply bg-yellow-100 border-yellow-500 text-yellow-900;
}

.alert-low {
  @apply bg-blue-100 border-blue-500 text-blue-900;
}

/* Rating stars */
.rating-stars .fa-star {
  transition: color 0.2s ease;
}

/* Responsive utilities */
@media (max-width: 640px) {
  .mobile-stack > * {
    width: 100% !important;
    margin-bottom: 0.5rem;
  }
  
  .mobile-hide {
    display: none;
  }
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--fresh-green);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #059669;
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
  }
}

/* Focus states for accessibility */
button:focus,
input:focus,
select:focus {
  outline: 2px solid var(--fresh-green);
  outline-offset: 2px;
}

/* Loading overlay */
.loading-overlay {
  backdrop-filter: blur(4px);
}

/* Hero section enhancements */
.hero-gradient {
  background: linear-gradient(135deg, #f0f9ff 0%, #ecfdf5 50%, #fefce8 100%);
}

/* Card hover effects */
.card-hover {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Animation classes */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.3s ease-in-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Supply chain journey enhancements */
.journey-step {
  position: relative;
  padding-left: 3rem;
}

.journey-step::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 2rem;
  bottom: -1rem;
  width: 2px;
  background: var(--fresh-green);
  opacity: 0.3;
}

.journey-step:last-child::before {
  display: none;
}

/* Progress indicators */
.progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--fresh-green) 0%, var(--sky-blue) 100%);
  transition: width 0.3s ease;
}

/* Quality score indicators */
.quality-excellent { color: #059669; }
.quality-good { color: #10b981; }
.quality-average { color: #f59e0b; }
.quality-poor { color: #ef4444; }
.quality-critical { color: #dc2626; }

/* Mobile-specific enhancements */
@media (max-width: 768px) {
  .mobile-text-sm {
    font-size: 0.875rem;
  }
  
  .mobile-p-4 {
    padding: 1rem;
  }
  
  .mobile-mb-4 {
    margin-bottom: 1rem;
  }
}