/* ========================================================
   مؤسسة مدار الأرض للتخليص الجمركي
   نظام الخطوط والتايبوجرافي المعتمد: خط كايرو (Cairo) الاحترافي
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
  --brand-navy: #0A192F;
  --brand-dark: #071224;
  --brand-blue: #1467B3;
  --brand-cyan: #0284C7;
  --brand-sky: #0EA5E9;
  --brand-light-blue: #E0F2FE;
  --brand-soft-gray: #F8FAFC;
  --brand-border: #E2E8F0;
  --surface: #FFFFFF;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.8;
  letter-spacing: normal;
  color: #101F2E;
  background-color: var(--surface);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings: Cairo Typography Hierarchy & Clean Line Heights */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #0A192F;
  line-height: 1.42;
  letter-spacing: normal;
}

p {
  line-height: 1.9;
}

/* Glassmorphism navigation */
.glass-nav {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Hero gradient */
.hero-gradient {
  background: linear-gradient(180deg, rgba(16, 31, 46, 0.72) 0%, rgba(16, 31, 46, 0.45) 50%, rgba(16, 31, 46, 0.88) 100%);
}

/* Tracking Code font */
.font-code-tracking {
  font-family: 'Cairo', ui-monospace, SFMono-Regular, monospace;
  letter-spacing: 0.04em;
}

/* Badge pill */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Subtle modern scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

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

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
  transition: background 0.2s ease;
}

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

/* Status Badges */
.badge-status-in-progress {
  background-color: #E0F2FE;
  color: #0284C7;
  border: 1px solid rgba(2, 132, 199, 0.25);
}

.badge-status-completed {
  background-color: #F0F9FF;
  color: #0369A1;
  border: 1px solid rgba(3, 105, 161, 0.25);
}

.badge-status-action-required {
  background-color: #F8FAFC;
  color: #0A192F;
  border: 1px solid rgba(10, 25, 47, 0.25);
}

/* Table styling */
.shipment-table-cell-status {
  min-width: 200px;
  max-width: 240px;
}

/* ========================================================
   Modern Interactive Micro-Interactions & Scroll Design
   (Stitch & Linear Design Standard)
   ======================================================== */

/* Top Reading Scroll Progress Indicator */
#scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0284C7 0%, #0EA5E9 50%, #1467B3 100%);
  z-index: 99999;
  transform-origin: 0% 50%;
  transform: scaleX(0);
  transition: transform 0.05s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
}

/* Professional Step Pill Badge (Exact user reference: dark capsule + glowing beacon) */
.step-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background-color: #0A1626;
  color: #FFFFFF;
  padding: 0.45rem 1.15rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(10, 22, 38, 0.25);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-badge-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(2, 132, 199, 0.5);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.25);
}

/* Watermark Number behind Step Card */
.step-watermark-num {
  position: absolute;
  top: 0.75rem;
  inset-inline-end: 1.5rem;
  font-size: 5.5rem;
  font-weight: 900;
  line-height: 1;
  color: #F1F5F9;
  user-select: none;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
}

.group:hover .step-watermark-num {
  color: #E2E8F0;
  transform: scale(1.08) translateY(-4px);
}

/* Smooth Scroll Reveal Animations */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Directional Staggered Motion for Cards (Right & Left Glides on Scroll) */
.glide-from-right {
  opacity: 0;
  transform: translateX(45px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.glide-from-left {
  opacity: 0;
  transform: translateX(-45px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.glide-from-center {
  opacity: 0;
  transform: translateY(35px) scale(0.96);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.is-revealed.glide-from-right,
.is-revealed.glide-from-left,
.is-revealed.glide-from-center {
  opacity: 1;
  transform: translateX(0) translateY(0) scale(1);
}

/* Hide scrollbar utility for sleek touch/mouse swipe carousels */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Staggered transition delays */
.delay-100 {
  transition-delay: 100ms;
}

.delay-200 {
  transition-delay: 200ms;
}

.delay-300 {
  transition-delay: 300ms;
}

.delay-400 {
  transition-delay: 400ms;
}

/* Interactive Card Micro-Interactions */
.interactive-card {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.interactive-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 35px -10px rgba(16, 31, 46, 0.08), 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

/* Animated Number Counter Pulse when finished */
.counter-finished {
  animation: counter-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes counter-pop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
    color: #0284C7;
  }

  100% {
    transform: scale(1);
  }
}

/* Floating Back To Top Button */
#back-to-top-btn {
  position: fixed;
  bottom: 2rem;
  inset-inline-end: 2rem;
  z-index: 45;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background-color: rgba(10, 25, 47, 0.92);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

#back-to-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top-btn:hover {
  background-color: #0284C7;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 30px -5px rgba(2, 132, 199, 0.4);
}

/* ========================================================
   Elite Mobile-First Ergonomics & Touch Design
   (Linear & Apple iOS Standard)
   ======================================================== */

* {
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  max-width: 100vw;
  overflow-x: hidden;
  touch-action: manipulation;
}

/* Safe area insets for modern mobile devices (iPhone notch & Dynamic Island) */
.safe-area-bottom {
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.safe-area-top {
  padding-top: max(0.5rem, env(safe-area-inset-top));
}

/* Hide scrollbars while retaining natural touch scrolling */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Active Drawer Open state on body to lock background scroll */
body.drawer-open {
  overflow: hidden !important;
  touch-action: none !important;
}

/* Mobile Slide-Over Drawer States */
#mobile-menu-drawer.is-open {
  opacity: 1 !important;
  pointer-events: auto !important;
}

#mobile-menu-drawer.is-open #mobile-menu-content {
  transform: translateX(0) !important;
}

/* Mobile Screens Optimization (< 768px) */
@media (max-width: 768px) {

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

  /* Body bottom padding on mobile to accommodate fixed bottom dock */
  body {
    padding-bottom: 4.5rem !important;
  }

  /* Adjust floating back-to-top button safely above mobile dock */
  #back-to-top-btn {
    bottom: 5.5rem !important;
    inset-inline-end: 1rem !important;
    width: 40px !important;
    height: 40px !important;
  }
}

/* ========================================================
   Continuous News Ticker Animation (RTL & LTR Seamless Ribbon)
   ======================================================== */
.ticker-wrap {
  width: 100%;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}

.ticker-move {
  display: inline-flex;
  white-space: nowrap;
  animation: ticker-rtl-scroll 24s linear infinite;
  will-change: transform;
}

.ticker-wrap:hover .ticker-move {
  animation-play-state: paused;
}

@keyframes ticker-rtl-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(50%);
  }
}

[dir="ltr"] .ticker-move {
  animation: ticker-ltr-scroll 24s linear infinite;
}

@keyframes ticker-ltr-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}
