:root {
  color-scheme: light;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Mobile bottom nav safe area */
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.7s ease-out forwards;
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

.animate-slide-in-left {
  animation: slideInLeft 0.7s ease-out forwards;
}

.animate-slide-in-right {
  animation: slideInRight 0.7s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.5s ease-out forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }

/* Intersection Observer trigger classes */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Mobile menu */
.mobile-menu-open {
  display: block !important;
}

/* Card hover effects */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  border-color: #fed7aa;
}

/* Button transitions */
.btn-primary {
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(249, 115, 22, 0.35);
}

.btn-secondary {
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Form inputs */
.form-input {
  width: 100%;
  min-height: 3rem;
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 0.9rem 1rem;
  color: #111827;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
}

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

/* Dashboard page standardization */
.dashboard-page {
  width: 100%;
  max-width: none !important;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .dashboard-page {
    padding: 2.5rem 2rem;
  }
}

@media (min-width: 1024px) {
  .dashboard-page {
    padding: 2.5rem 2.5rem;
  }
}

/* Page banner */
.page-banner {
  position: relative;
  background: #0f172a center/cover no-repeat;
  overflow: hidden;
}

.page-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
}

/* Icon wrapper */
.icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
}

.icon-wrapper-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  background: #fff7ed;
  color: #f97316;
}

/* Tracking result animation */
@keyframes trackingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.tracking-pulse {
  animation: trackingPulse 2s ease-in-out infinite;
}

/* Primary color utilities */
.bg-primary { background-color: #f97316; }
.bg-primary-dark { background-color: #ea580c; }
.bg-primary-light { background-color: #fff7ed; }
.text-primary { color: #f97316; }
.border-primary { border-color: #f97316; }
.border-primary\/20 { border-color: rgba(249, 115, 22, 0.2); }
.border-primary\/30 { border-color: rgba(249, 115, 22, 0.3); }
.hover\:bg-primary-dark:hover { background-color: #ea580c; }
.hover\:bg-primary-light:hover { background-color: #fff7ed; }
.hover\:text-primary:hover { color: #f97316; }

/* Responsive typography */
@media (max-width: 640px) {
  .floating-cta {
    right: 1rem;
    bottom: 1rem;
  }
  
  /* Admin sidebar link styles */
  .admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #e5e7eb;
    background: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-decoration: none;
  }
  
  .admin-sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
  }
  
  .admin-sidebar-link:active {
    background: rgba(255, 255, 255, 0.12);
  }
  
  .admin-sidebar-logout {
    color: #f87171;
  }
  
  .admin-sidebar-logout:hover {
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
  }
  
  /* Dashboard card and panel standardization */
  .dashboard-card {
    width: 100%;
  }
  
  .dashboard-panel {
    width: 100%;
  }
  
  /* Sidebar grid helper */
  .sidebar-layout {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
  }
  
  @media (min-width: 1024px) {
    .sidebar-layout {
      grid-template-columns: 280px 1fr;
    }
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}
