/* =========================================================
   SLWoRLD CARGO — Premium Tracking Page Stylesheet
   Modern split-panel shipment tracker with glassmorphism
   ========================================================= */

/* ── Design Tokens ────────────────────────── */
:root {
  --trk-bg: #f0f4f8;
  --trk-card: #ffffff;
  --trk-card-border: rgba(15, 23, 42, 0.06);
  --trk-text: #0f172a;
  --trk-text-muted: #64748b;
  --trk-text-light: #94a3b8;
  --trk-accent: #2563eb;
  --trk-accent-light: #dbeafe;
  --trk-green: #16a34a;
  --trk-green-light: #dcfce7;
  --trk-orange: #ea580c;
  --trk-orange-light: #fff7ed;
  --trk-radius: 20px;
  --trk-radius-sm: 14px;
  --trk-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  --trk-shadow-lg: 0 25px 60px rgba(15, 23, 42, 0.12);
  --trk-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Page Background ──────────────────────── */
body.tracking-page {
  background: var(--trk-bg) !important;
}

/* ── Utility ──────────────────────────────── */
.hidden { display: none !important; }

/* ── Hero Section ─────────────────────────── */
.tracking-hero-modern {
  background: radial-gradient(ellipse at 70% 10%, rgba(37, 99, 235, 0.18) 0%, rgba(14, 29, 52, 1) 65%),
              radial-gradient(ellipse at 20% 80%, rgba(56, 189, 248, 0.08) 0%, transparent 50%),
              #0e1d34;
  padding: 130px 0 60px 0 !important;
  position: relative;
  overflow: hidden;
}

.tracking-hero-modern::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

/* ── Search Card ──────────────────────────── */
.search-card-premium {
  background: var(--trk-card);
  border: 1px solid var(--trk-card-border);
  border-radius: var(--trk-radius);
  box-shadow: var(--trk-shadow-lg);
  padding: 24px 28px;
  color: var(--trk-text);
  transition: var(--trk-transition);
}

.search-card-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.15);
}

.search-card-premium .input-group {
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.25s ease;
}

.search-card-premium .input-group:focus-within {
  border-color: var(--trk-accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.search-card-premium .input-group-text {
  background: #f8fafc;
  border: none;
  padding: 14px 16px;
  color: var(--trk-accent);
}

.search-card-premium .form-control {
  border: none !important;
  box-shadow: none !important;
  font-size: 16px;
  font-weight: 600;
  color: var(--trk-text);
  padding: 14px 12px;
}

.search-card-premium .form-control::placeholder {
  color: var(--trk-text-light);
  font-weight: 400;
}

.search-card-premium .btn-track {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 0 12px 12px 0 !important;
  transition: var(--trk-transition);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.search-card-premium .btn-track:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateX(2px);
}

.search-card-premium .btn-track:active {
  transform: scale(0.97);
}

/* ── Error Box ────────────────────────────── */
.tracking-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff1f2;
  border: 1.5px solid #fca5a5;
  border-left: 5px solid #ef4444;
  color: #b91c1c;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.5;
  animation: slideInError 0.3s ease;
}

.tracking-error::before {
  content: "⚠️";
  font-size: 1.1rem;
  flex-shrink: 0;
}

@keyframes slideInError {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Results Container ────────────────────── */
.tracking-results {
  padding: 0 !important;
}

#list {
  max-width: 1100px;
  margin: 25px auto 60px;
  position: relative;
  z-index: 2;
}

/* ── Result Card — Split Panel ────────────── */
.result-card {
  background: var(--trk-card);
  border: 1px solid var(--trk-card-border);
  border-radius: var(--trk-radius);
  box-shadow: var(--trk-shadow-lg);
  overflow: hidden;
  animation: cardReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Card Header ──────────────────────────── */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px 28px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--trk-card-border);
}

.result-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.result-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.result-icon.air {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.result-icon.sea {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
}

.result-icon.default {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.result-tracking-no small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--trk-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.result-tracking-no strong {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--trk-text);
  letter-spacing: -0.02em;
}

.result-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Status Pill ──────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-pill.green {
  background: #dcfce7;
  color: #15803d;
  border-color: rgba(34, 197, 94, 0.2);
}

.status-pill.green::before { content: "✓ "; font-weight: 900; }

.status-pill.blue {
  background: #dbeafe;
  color: #1e40af;
  border-color: rgba(59, 130, 246, 0.2);
}

.status-pill.orange {
  background: #fff7ed;
  color: #c2410c;
  border-color: rgba(249, 115, 22, 0.2);
}

.status-pill.gray {
  background: #f1f5f9;
  color: #475569;
  border-color: rgba(148, 163, 184, 0.2);
}

/* ── Info Badge ───────────────────────────── */
.info-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #f8fafc;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.info-badge.mode-badge {
  background: #ecfeff;
  border-color: #a5f3fc;
  color: #0e7490;
}

/* ── Progress Stepper ─────────────────────── */
.progress-stepper {
  padding: 28px 28px 8px;
  border-bottom: 1px solid var(--trk-card-border);
}

.stepper-track {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  padding: 0 10px;
}

.stepper-track::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 40px;
  right: 40px;
  height: 3px;
  background: #e2e8f0;
  border-radius: 999px;
  z-index: 0;
}

.stepper-fill {
  position: absolute;
  top: 18px;
  left: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--trk-green) 0%, var(--trk-accent) 100%);
  border-radius: 999px;
  z-index: 1;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 2;
  flex: 0 0 auto;
  min-width: 70px;
}

.stepper-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: var(--trk-transition);
}

.stepper-step.active .stepper-dot {
  border-color: var(--trk-green);
  background: var(--trk-green);
  color: #fff;
  box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.12);
}

.stepper-step.current .stepper-dot {
  border-color: var(--trk-accent);
  background: var(--trk-accent);
  color: #fff;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12);
  animation: stepPulse 2s infinite;
}

@keyframes stepPulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12); }
  50% { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0.06); }
}

.stepper-step.inactive .stepper-dot {
  border-color: #e2e8f0;
  background: #fff;
  color: #cbd5e1;
}

.stepper-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--trk-text-light);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.stepper-step.active .stepper-label,
.stepper-step.current .stepper-label {
  color: var(--trk-text);
}

/* ── Split Panel Body ─────────────────────── */
.result-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 420px;
}

.result-left {
  padding: 28px;
  border-right: 1px solid var(--trk-card-border);
  overflow-y: auto;
  max-height: 560px;
}

.result-right {
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  position: relative;
  overflow: hidden;
}

/* ── Package Details Grid ─────────────────── */
.pkg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.pkg-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  transition: var(--trk-transition);
}

.pkg-item:hover {
  border-color: var(--trk-accent);
  background: #eff6ff;
}

.pkg-item .pkg-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--trk-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.pkg-item .pkg-value {
  font-size: 16px;
  font-weight: 900;
  color: var(--trk-text);
}

/* ── Timeline ─────────────────────────────── */
.section-title-sm {
  font-size: 13px;
  font-weight: 800;
  color: var(--trk-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title-sm i {
  color: var(--trk-accent);
}

.timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--trk-green) 0%, #e2e8f0 30%);
  border-radius: 999px;
}

.timeline-item {
  position: relative;
  padding-left: 40px;
  margin-bottom: 20px;
  animation: timelineReveal 0.4s ease forwards;
  opacity: 0;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }
.timeline-item:nth-child(6) { animation-delay: 0.55s; }
.timeline-item:nth-child(7) { animation-delay: 0.6s; }
.timeline-item:nth-child(8) { animation-delay: 0.65s; }
.timeline-item:nth-child(9) { animation-delay: 0.7s; }
.timeline-item:nth-child(10) { animation-delay: 0.75s; }

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

.timeline-item:last-child { margin-bottom: 0; }

.t-dot {
  position: absolute;
  left: 3px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #94a3b8;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #e2e8f0;
  transition: var(--trk-transition);
}

.timeline-item.latest .t-dot {
  background: var(--trk-green);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15);
  animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15); }
  50% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0.06); }
}

.t-content {
  background: #fafbfc;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  padding: 12px 14px;
  transition: var(--trk-transition);
}

.timeline-item.latest .t-content {
  background: #f0fdf4;
  border-color: rgba(22, 163, 74, 0.12);
}

.timeline-item:hover .t-content {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.t-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.t-status {
  font-size: 14px;
  font-weight: 800;
  color: var(--trk-text);
}

.timeline-item.latest .t-status {
  color: var(--trk-green);
}

.t-time {
  font-size: 11px;
  color: var(--trk-text-light);
  white-space: nowrap;
  font-weight: 600;
}

.t-loc, .t-remark {
  font-size: 12px;
  color: var(--trk-text-muted);
  line-height: 1.5;
}

.t-remark { margin-top: 2px; }

/* ── Route Visualization (Right Panel) ────── */
.route-visual {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.route-visual h4 {
  font-size: 14px;
  font-weight: 800;
  color: var(--trk-text);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.route-svg-wrap {
  width: 100%;
  position: relative;
  margin-bottom: 20px;
}

.route-svg-wrap svg {
  width: 100%;
  height: auto;
}

/* SVG Route Animation */
.route-path {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawRoute 2s ease forwards 0.5s;
}

@keyframes drawRoute {
  to { stroke-dashoffset: 0; }
}

.route-dot-animated {
  animation: moveDot 3s ease-in-out infinite 2.5s;
}

@keyframes moveDot {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* Route Info Cards */
.route-endpoints {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.route-point {
  flex: 1;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  transition: var(--trk-transition);
}

.route-point:hover {
  border-color: var(--trk-accent);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
}

.route-point .rp-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.route-point .rp-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--trk-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.route-point .rp-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--trk-text);
}

/* Carrier Info Card */
.carrier-card {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(135deg, #0e1d34 0%, #1e3a5f 100%);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  color: #fff;
}

.carrier-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.carrier-info {
  flex: 1;
}

.carrier-info small {
  font-size: 11px;
  opacity: 0.7;
  font-weight: 600;
}

.carrier-info strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  margin-top: 2px;
}

/* ── Card Footer ──────────────────────────── */
.result-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 28px;
  background: #fafbfc;
  border-top: 1px solid var(--trk-card-border);
}

.result-footer .carrier-text {
  font-size: 13px;
  color: var(--trk-text-muted);
  font-weight: 600;
}

.result-footer .carrier-text strong {
  color: var(--trk-text);
}

.btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: var(--trk-transition);
  border: none;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.25);
}

.btn-wa:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.35);
  color: #fff !important;
}

.btn-wa:active {
  transform: scale(0.97);
}

/* ── Shipping Info Strip ──────────────────── */
.shipping-info-strip {
  background: var(--trk-card);
  border: 1px solid var(--trk-card-border);
  border-radius: var(--trk-radius-sm);
  padding: 16px 24px;
  box-shadow: var(--trk-shadow);
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 991px) {
  .result-body {
    grid-template-columns: 1fr;
  }

  .result-left {
    border-right: none;
    border-bottom: 1px solid var(--trk-card-border);
    max-height: none;
  }

  .result-right {
    padding: 24px 20px;
  }

  #list {
    margin-top: -20px;
  }
}

@media (max-width: 767px) {
  .tracking-hero-modern {
    padding: 95px 0 35px 0 !important;
  }

  .search-card-premium {
    padding: 18px !important;
    border-radius: 16px;
  }

  .search-card-premium .btn-track {
    padding: 12px 18px;
    font-size: 14px;
  }

  #list {
    margin: -10px 12px 40px;
  }

  .result-header {
    padding: 18px 18px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .result-tracking-no strong {
    font-size: 1.15rem;
  }

  .progress-stepper {
    padding: 20px 16px 8px;
    overflow-x: auto;
  }

  .stepper-track {
    min-width: 380px;
    padding: 0 5px;
  }

  .result-left, .result-right {
    padding: 18px;
  }

  .result-footer {
    padding: 14px 18px;
    flex-direction: column;
    gap: 12px;
  }

  .btn-wa {
    width: 100%;
    justify-content: center;
  }

  .pkg-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .route-endpoints {
    flex-direction: column;
  }

  .t-head {
    flex-direction: column;
    gap: 2px;
  }

  .carrier-card {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
}

@media (max-width: 400px) {
  .search-card-premium .input-group {
    flex-wrap: nowrap;
  }

  .search-card-premium .btn-track {
    padding: 12px 14px;
    font-size: 13px;
  }

  .stepper-step {
    min-width: 58px;
  }

  .stepper-dot {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}