/* 
 * WPCargo Tailwind CSS Styles
 * Modern, accessible design with excellent UI/UX
 */

/* Custom CSS for animations and components that extend Tailwind */

/* Animated Status Badge */
@keyframes pulse-glow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 currentColor;
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.2);
  }
}

@keyframes slide-in-right {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fade-in-up {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes bounce-in {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* Status Badge Animations */
.status-delivered {
  animation: pulse-glow 2s infinite;
}

.status-in-transit {
  position: relative;
  overflow: hidden;
}

.status-in-transit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s infinite;
}

.status-pending {
  animation: continuous-bounce 2s infinite;
}

/* Continuous bouncing animation for pending status */
@keyframes continuous-bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

/* Special bouncing for shipment status bar */
.shipment-status-pending {
  animation: status-bounce 1.5s ease-in-out infinite;
}

@keyframes status-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Card Hover Effects */
.info-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-card:hover {
  transform: translateY(-4px);
}

/* Fade in animation for sections */
.fade-in-section {
  animation: fade-in-up 0.6s ease-out forwards;
}

.slide-in-section {
  animation: slide-in-right 0.8s ease-out forwards;
}

/* Loading skeleton for better UX */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Table row animations */
.table-row {
  animation: fade-in-up 0.4s ease-out forwards;
  opacity: 0;
}

.table-row:nth-child(1) { animation-delay: 0.1s; }
.table-row:nth-child(2) { animation-delay: 0.2s; }
.table-row:nth-child(3) { animation-delay: 0.3s; }
.table-row:nth-child(4) { animation-delay: 0.4s; }
.table-row:nth-child(5) { animation-delay: 0.5s; }

/* Progress indicators */
.progress-step {
  position: relative;
}

.progress-step::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -50%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  transform: translateY(-50%);
  opacity: 0;
  animation: fade-in-up 1s ease-out 0.5s forwards;
}

.progress-step:last-child::after {
  display: none;
}

/* Package Totals Animations */
@keyframes float-up {
  0% {
    transform: translateY(20px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes icon-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.package-totals-card {
  animation: float-up 0.7s ease-out forwards;
}

.package-totals-icon {
  transition: all 0.3s ease;
}

.package-totals-icon:hover {
  transform: scale(1.1);
  animation: icon-spin 0.5s ease-in-out;
}

.package-metric {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.package-metric:hover {
  transform: translateY(-2px);
}

.package-metric:hover .package-totals-icon {
  transform: scale(1.15);
}

/* Contact Card Animations */
.contact-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.contact-info-item {
  transition: all 0.2s ease;
}

.contact-info-item:hover {
  transform: translateX(4px);
}

/* Responsive utilities */
@media (max-width: 640px) {
  .mobile-stack > * {
    margin-bottom: 1rem;
  }
  
  .mobile-full {
    width: 100% !important;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-full-width {
    width: 100% !important;
    max-width: none !important;
  }
  
  .print-break-inside {
    break-inside: avoid;
  }
}

/* Accessibility improvements */
.focus-visible:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .status-badge {
    border: 2px solid currentColor;
  }
  
  .info-card {
    border: 1px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
  .dark\:bg-gray-900 {
    background-color: #111827;
  }
  
  .dark\:text-gray-100 {
    color: #f3f4f6;
  }
}

/* Custom components */
.gradient-border {
  position: relative;
  background: white;
  border-radius: 0.75rem;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6, #06b6d4);
  border-radius: inherit;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
}

/* Status-specific colors and animations */
.status-delivered {
  @apply bg-green-100 text-green-800 border-green-200;
}

.status-in-transit {
  @apply bg-blue-100 text-blue-800 border-blue-200;
}

.status-pending {
  @apply bg-yellow-100 text-yellow-800 border-yellow-200;
}

.status-cancelled {
  @apply bg-red-100 text-red-800 border-red-200;
}

.status-on-hold {
  @apply bg-orange-100 text-orange-800 border-orange-200;
}

/* Loading states */
.loading-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: .5;
  }
}