/* Entregadores App - Production CSS v4.0 - Tailwind Inline */

/* Mobile-first responsive design improvements */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  scroll-behavior: smooth;
  font-size: 14px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f9fafb;
  overscroll-behavior: none;
  overflow-x: hidden;
  color: #030213;
}

/* PWA specific styles */
@media screen and (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Improve touch targets for mobile */
button, [role="button"], a {
  min-height: 44px;
  min-width: 44px;
}

/* Focus styles for better accessibility */
*:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

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

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Loading animations */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Utility Classes */
.shimmer {
  animation: shimmer 1.5s ease-in-out infinite;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
}

.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

.slide-up {
  animation: slideInUp 0.3s ease-out;
}

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

.loading-spinner {
  animation: spin 1s linear infinite;
  border: 2px solid #f3f4f6;
  border-top: 2px solid #2563eb;
  border-radius: 50%;
  width: 40px;
  height: 40px;
}

/* Safe Area Utilities */
.safe-area-top {
  padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

/* Prevent zoom on form inputs on iOS */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
textarea {
  font-size: 16px;
}

/* Tailwind-like Utility Classes */
.min-h-screen { min-height: 100vh; }
.h-screen { height: 100vh; }
.h-full { height: 100%; }
.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-sm { max-width: 24rem; }

.bg-gray-50 { background-color: #f9fafb; }
.bg-white { background-color: #ffffff; }
.bg-blue-600 { background-color: #2563eb; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-orange-100 { background-color: #fed7aa; }
.bg-green-100 { background-color: #dcfce7; }
.bg-green-500 { background-color: #22c55e; }
.bg-red-100 { background-color: #fee2e2; }
.bg-red-500 { background-color: #ef4444; }
.bg-gray-100 { background-color: #f3f4f6; }

.text-white { color: #ffffff; }
.text-gray-600 { color: #4b5563; }
.text-gray-500 { color: #6b7280; }
.text-gray-300 { color: #d1d5db; }
.text-red-700 { color: #b91c1c; }
.text-blue-600 { color: #2563eb; }

.border { border-width: 1px; border-color: rgba(0, 0, 0, 0.1); }
.border-b { border-bottom-width: 1px; border-bottom-color: rgba(0, 0, 0, 0.1); }
.rounded-lg { border-radius: 0.5rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-full { border-radius: 9999px; }

.shadow-sm { 
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); 
}
.shadow-md { 
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); 
}

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pb-20 { padding-bottom: 5rem; }

.m-0 { margin: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }

.flex { display: flex; }
.grid { display: grid; }
.block { display: block; }
.inline-flex { display: inline-flex; }
.hidden { display: none; }

.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }

.w-3 { width: 0.75rem; }
.w-5 { width: 1.25rem; }
.w-10 { width: 2.5rem; }
.w-16 { width: 4rem; }
.h-3 { height: 0.75rem; }
.h-5 { height: 1.25rem; }
.h-10 { height: 2.5rem; }
.h-16 { height: 4rem; }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }

.text-center { text-align: center; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-10 { z-index: 10; }

.cursor-pointer { cursor: pointer; }

/* Input Styles */
.input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  background: #f3f3f5;
  font-size: 16px;
  transition: border-color 0.2s ease;
}

.input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

/* Button Styles */
.btn-primary {
  background: #2563eb;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: #374151;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn-success {
  background: #16a34a;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-success:hover {
  background: #15803d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

/* Badge Styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-pending {
  background: #fed7aa;
  color: #9a3412;
}

.badge-delivered {
  background: #bbf7d0;
  color: #166534;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

/* Card Styles */
.card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.card-pending {
  border-left: 4px solid #f97316;
  background: linear-gradient(to right, #fff7ed, #ffffff);
}

.card-delivered {
  border-left: 4px solid #16a34a;
  background: linear-gradient(to right, #f0fdf4, #ffffff);
}

/* Container */
.container {
  max-width: 768px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  padding: 1rem 1.5rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  pointer-events: auto;
  animation: slideInUp 0.3s ease-out;
  max-width: 400px;
  word-wrap: break-word;
}

.toast-success {
  border-left: 4px solid #16a34a;
  background: linear-gradient(to right, #f0fdf4, #ffffff);
}

.toast-error {
  border-left: 4px solid #dc2626;
  background: linear-gradient(to right, #fef2f2, #ffffff);
}

.toast-warning {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(to right, #fffbeb, #ffffff);
}

.toast-info {
  border-left: 4px solid #3b82f6;
  background: linear-gradient(to right, #eff6ff, #ffffff);
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
  .btn-mobile {
    min-height: 48px;
    padding: 12px 16px;
  }
  
  .container {
    padding: 0 0.75rem;
  }
  
  .grid-auto-fit {
    grid-template-columns: 1fr;
  }
  
  .btn-primary,
  .btn-secondary,
  .btn-success {
    width: 100%;
    justify-content: center;
  }
}

@media screen and (max-width: 480px) {
  .text-2xl { font-size: 1.25rem; }
  .text-xl { font-size: 1.125rem; }
  .p-8 { padding: 1.5rem; }
  .mb-8 { margin-bottom: 1.5rem; }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #0f172a;
    color: #f8fafc;
  }
  
  .bg-white { background-color: #1e293b; }
  .bg-gray-50 { background-color: #0f172a; }
  .card { 
    background: #1e293b;
    border-color: #334155;
  }
  .input { 
    background: #334155;
    border-color: #475569;
    color: #f8fafc;
  }
  .text-gray-600 { color: #94a3b8; }
  .text-gray-500 { color: #64748b; }
  .border { border-color: #334155; }
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #000;
  }
}

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

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .border { border-color: #000000; }
  .btn-primary { border: 2px solid #000000; }
  .card { border-color: #000000; }
}