/* =====================================================
   Beto Lo Trae - Main Stylesheet
   Entry Point for All CSS
   ===================================================== */

/* ===========================================
   TAILWIND DIRECTIVES
   Using CDN in base.html, no local import needed
   =========================================== */

/* ===========================================
   DESIGN TOKENS
   =========================================== */

@import url("./tokens.ffa442f6d7da.css");

/* ===========================================
   UTILITIES
   =========================================== */

@import url("./utilities/animations.5ab10b83f351.css");
@import url("./utilities/glass.d69055995847.css");

/* ===========================================
   BASE STYLES
   =========================================== */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Base body styles */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Headings use Nunito */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid #06B6D4;
  outline-offset: 2px;
}

/* Selection colors */
::selection {
  background-color: rgba(6, 182, 212, 0.2);
  color: inherit;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-track {
  background: #1f2937;
}

.dark ::-webkit-scrollbar-thumb {
  background: #4b5563;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* ===========================================
   CUSTOM UTILITY CLASSES
   =========================================== */

/* Text shadow utilities for hero sections - WCAG 2.2 contrast improvement */
.text-shadow-hero {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.text-shadow-lg {
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Text gradient */
.text-gradient {
  background: linear-gradient(135deg, #06B6D4 0%, #34D399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-reverse {
  background: linear-gradient(135deg, #34D399 0%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-accent {
  background: linear-gradient(135deg, #FB923C 0%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hide scrollbar but keep functionality */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Aspect ratios */
.aspect-bento-wide {
  aspect-ratio: 2 / 1;
}

.aspect-bento-tall {
  aspect-ratio: 1 / 2;
}

.aspect-bento-square {
  aspect-ratio: 1 / 1;
}

/* Safe area padding for mobile notches */
.safe-area-inset {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ===========================================
   STATUS BADGES - Package States
   =========================================== */

.badge-prealerta {
  background-color: rgba(139, 92, 246, 0.1);
  color: #7C3AED;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-recibido-miami {
  background-color: rgba(6, 182, 212, 0.1);
  color: #0891B2;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.badge-enviado {
  background-color: rgba(251, 146, 60, 0.1);
  color: #EA580C;
  border: 1px solid rgba(251, 146, 60, 0.2);
}

.badge-en-aduana {
  background-color: rgba(245, 158, 11, 0.1);
  color: #D97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-listo-entrega {
  background-color: rgba(52, 211, 153, 0.1);
  color: #059669;
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.badge-entregado {
  background-color: rgba(55, 65, 81, 0.9);
  color: #FFFFFF;
  border: 1px solid rgba(55, 65, 81, 1);
}

/* Dark mode badges */
.dark .badge-prealerta {
  background-color: rgba(139, 92, 246, 0.2);
  color: #A78BFA;
}

.dark .badge-recibido-miami {
  background-color: rgba(6, 182, 212, 0.2);
  color: #22D3EE;
}

.dark .badge-enviado {
  background-color: rgba(251, 146, 60, 0.2);
  color: #FDBA74;
}

.dark .badge-en-aduana {
  background-color: rgba(245, 158, 11, 0.2);
  color: #FCD34D;
}

.dark .badge-listo-entrega {
  background-color: rgba(52, 211, 153, 0.2);
  color: #6EE7B7;
}

/* ===========================================
   PAYMENT STATUS
   =========================================== */

.badge-paid {
  background-color: rgba(52, 211, 153, 0.1);
  color: #059669;
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.badge-pending {
  background-color: rgba(239, 68, 68, 0.1);
  color: #DC2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-verifying {
  background-color: rgba(251, 146, 60, 0.1);
  color: #EA580C;
  border: 1px solid rgba(251, 146, 60, 0.2);
}

/* ===========================================
   BUTTON VARIANTS
   =========================================== */

.btn-primary {
  background: linear-gradient(135deg, #06B6D4 0%, #0891B2 100%);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(6, 182, 212, 0.4);
}

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

.btn-secondary {
  background: linear-gradient(135deg, #34D399 0%, #10B981 100%);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(52, 211, 153, 0.4);
}

.btn-accent {
  background: linear-gradient(135deg, #FB923C 0%, #F97316 100%);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(251, 146, 60, 0.4);
}

.btn-outline {
  background: transparent;
  color: #06B6D4;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid #06B6D4;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-outline:hover {
  background: #06B6D4;
  color: white;
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: #374151;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-ghost:hover {
  background: rgba(6, 182, 212, 0.1);
  color: #06B6D4;
}

.dark .btn-ghost {
  color: #E5E7EB;
}

.dark .btn-ghost:hover {
  background: rgba(6, 182, 212, 0.2);
  color: #22D3EE;
}

/* ===========================================
   FORM ELEMENTS
   =========================================== */

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 2px solid #E5E7EB;
  background: white;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input:focus {
  border-color: #06B6D4;
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.15);
  outline: none;
}

.form-input::placeholder {
  color: #9CA3AF;
}

.dark .form-input {
  background: #374151;
  border-color: #4B5563;
  color: white;
}

.dark .form-input:focus {
  border-color: #06B6D4;
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.2);
}

.dark .form-input::placeholder {
  color: #9CA3AF;
}

/* Floating label input */
.form-floating {
  position: relative;
}

.form-floating input {
  padding-top: 1.625rem;
  padding-bottom: 0.625rem;
}

.form-floating label {
  position: absolute;
  top: 0;
  left: 1rem;
  height: 100%;
  padding: 1rem 0;
  pointer-events: none;
  border: 1px solid transparent;
  transform-origin: 0 0;
  transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out;
  color: #6B7280;
}

.form-floating input:focus ~ label,
.form-floating input:not(:placeholder-shown) ~ label {
  opacity: 0.65;
  transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
  color: #06B6D4;
}

/* ===========================================
   CARD STYLES
   =========================================== */

.card {
  background: white;
  border-radius: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.dark .card {
  background: #1F2937;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.card-bordered {
  border: 1px solid #E5E7EB;
}

.dark .card-bordered {
  border-color: #374151;
}

/* ===========================================
   TABLE STYLES
   =========================================== */

.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-modern thead {
  background: #F9FAFB;
}

.dark .table-modern thead {
  background: #1F2937;
}

.table-modern th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #E5E7EB;
}

.dark .table-modern th {
  color: #E5E7EB;
  border-bottom-color: #374151;
}

.table-modern td {
  padding: 1rem;
  border-bottom: 1px solid #F3F4F6;
}

.dark .table-modern td {
  border-bottom-color: #374151;
}

.table-modern tbody tr {
  transition: background 0.2s ease;
}

.table-modern tbody tr:hover {
  background: rgba(6, 182, 212, 0.05);
}

.dark .table-modern tbody tr:hover {
  background: rgba(6, 182, 212, 0.1);
}

/* ===========================================
   TIMELINE COMPONENT
   =========================================== */

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #E5E7EB;
}

.dark .timeline::before {
  background: #374151;
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.25rem;
  width: 1rem;
  height: 1rem;
  background: white;
  border: 3px solid #06B6D4;
  border-radius: 50%;
  z-index: 1;
}

.timeline-item.active::before {
  background: #06B6D4;
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.2);
}

.timeline-item.completed::before {
  background: #34D399;
  border-color: #34D399;
}

.dark .timeline-item::before {
  background: #1F2937;
}

/* ===========================================
   LOADING STATES
   =========================================== */

.loading-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid #E5E7EB;
  border-top-color: #06B6D4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-dots {
  display: inline-flex;
  gap: 0.25rem;
}

.loading-dots span {
  width: 0.5rem;
  height: 0.5rem;
  background: #06B6D4;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

/* ===========================================
   RESPONSIVE UTILITIES
   =========================================== */

/* Container with max-width */
.container-narrow {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.container-wide {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Mobile-first visibility */
@media (max-width: 639px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 640px) {
  .show-mobile-only {
    display: none !important;
  }
}

/* ===========================================
   PRINT STYLES
   =========================================== */

@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  .glass,
  .glass-card,
  .glass-navbar {
    background: white !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    border: 1px solid #E5E7EB !important;
  }
}
