/* ============================================================
   ShipTracker Pro — Marvel Group Color Scheme
   Navy #1A1E2E  |  Red #C8102E  |  White #FFFFFF
   Accent teal: #00A89D  |  Light bg: #F4F6FA
   ============================================================ */

:root {
  --st-navy:      #1A1E2E;
  --st-navy-mid:  #252A3D;
  --st-navy-light:#2F3550;
  --st-red:       #C8102E;
  --st-red-hover: #A50D26;
  --st-teal:      #00A89D;
  --st-white:     #FFFFFF;
  --st-bg:        #F4F6FA;
  --st-border:    #E2E6EF;
  --st-text:      #1A1E2E;
  --st-muted:     #6B7280;
  --st-success:   #10B981;
  --st-warning:   #F59E0B;
  --st-font:      'Segoe UI', system-ui, -apple-system, sans-serif;
  --st-radius:    10px;
  --st-shadow:    0 2px 16px rgba(26,30,46,0.10);
}

#shiptracker-app *,
#shiptracker-app *::before,
#shiptracker-app *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#shiptracker-app {
  font-family: var(--st-font);
  color: var(--st-text);
  background: var(--st-bg);
  border-radius: var(--st-radius);
  overflow: hidden;
  min-height: 300px;
}

/* ── Search Bar ── */
.st-search-bar {
  background: var(--st-navy);
  padding: 28px 24px;
}

.st-search-inner {
  display: flex;
  align-items: center;
  background: var(--st-white);
  border-radius: 8px;
  padding: 4px 4px 4px 16px;
  max-width: 640px;
  margin: 0 auto;
  gap: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}

.st-search-inner svg {
  color: var(--st-muted);
  flex-shrink: 0;
}

.st-search-inner input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: var(--st-font);
  color: var(--st-text);
  background: transparent;
  padding: 8px 0;
  min-width: 0;
}

.st-search-inner input::placeholder { color: #B0B7C3; }

#st-search-btn {
  background: var(--st-red);
  color: var(--st-white);
  border: none;
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
#st-search-btn:hover { background: var(--st-red-hover); }

/* ── State Screens ── */
.st-state {
  text-align: center;
  padding: 60px 24px;
}

.st-idle-icon,
.st-error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.st-state h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--st-navy);
  margin-bottom: 10px;
}

.st-state p {
  color: var(--st-muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 420px;
  margin: 0 auto;
}

.st-state a { color: var(--st-red); }

.st-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--st-border);
  border-top-color: var(--st-red);
  border-radius: 50%;
  animation: st-spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes st-spin { to { transform: rotate(360deg); } }

/* ── Status Bar ── */
.st-status-bar {
  background: var(--st-navy);
  color: var(--st-white);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.st-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  display: block;
  margin-bottom: 3px;
}

.st-tracking-id {
  font-size: 18px;
  font-weight: 700;
  color: var(--st-white);
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
}

/* Status badges */
.st-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.st-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.st-badge-transit   { background: rgba(0,168,157,0.15); color: var(--st-teal); border: 1.5px solid var(--st-teal); }
.st-badge-delivered { background: rgba(16,185,129,0.15); color: var(--st-success); border: 1.5px solid var(--st-success); }
.st-badge-shipped   { background: rgba(200,16,46,0.12);  color: var(--st-red);  border: 1.5px solid var(--st-red); }
.st-badge-pending   { background: rgba(245,158,11,0.12); color: var(--st-warning); border: 1.5px solid var(--st-warning); }
.st-badge-default   { background: rgba(107,114,128,0.12); color: var(--st-muted); border: 1.5px solid var(--st-muted); }

/* ── Body Layout ── */
.st-body {
  display: grid;
  grid-template-columns: 420px 1fr;
  min-height: 560px;
}

.st-left {
  padding: 20px;
  overflow-y: auto;
  max-height: 750px;
  background: var(--st-white);
  border-right: 1px solid var(--st-border);
}

.st-right {
  position: relative;
  background: #e5e3df;
}

#st-map {
  width: 100%;
  height: 100%;
  min-height: 520px;
}

/* ── Route Card ── */
.st-route-card {
  background: var(--st-bg);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  padding: 16px;
  margin-bottom: 20px;
}

.st-route-cities {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.st-city {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  max-width: 120px;
}

.st-city strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--st-navy);
  line-height: 1.3;
}

.st-city-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--st-muted);
  display: block;
  margin-bottom: 2px;
}

.st-city-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--st-white);
  box-shadow: 0 0 0 2px currentColor;
}
.st-dot-origin { color: var(--st-teal); background: var(--st-teal); }
.st-dot-dest   { color: var(--st-red);  background: var(--st-red); }

.st-route-line-container {
  flex: 1;
  padding: 0 4px;
  position: relative;
}

.st-route-line {
  height: 4px;
  background: var(--st-border);
  border-radius: 2px;
  position: relative;
  overflow: visible;
}

.st-route-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--st-teal), var(--st-red));
  border-radius: 2px;
  transition: width 0.6s ease;
}

.st-truck-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  transition: left 0.6s ease;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.st-route-dates {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--st-text);
}
.st-route-dates-right { text-align: right; }
.st-route-dates span { font-weight: 600; display: block; }

/* ── Section Titles ── */
.st-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--st-muted);
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--st-border);
}

/* ── Timeline ── */
.st-timeline {
  position: relative;
  padding-left: 24px;
}

.st-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--st-border);
  border-radius: 1px;
}

.st-timeline-item {
  position: relative;
  padding: 0 0 18px 14px;
  animation: st-fade-in 0.3s ease forwards;
}
@keyframes st-fade-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

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

.st-tl-dot {
  position: absolute;
  left: -21px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--st-border);
  border: 2px solid var(--st-white);
  box-shadow: 0 0 0 2px var(--st-border);
}
.st-tl-dot.active {
  background: var(--st-teal);
  box-shadow: 0 0 0 3px rgba(0,168,157,0.25);
}

.st-tl-date {
  font-size: 11px;
  color: var(--st-muted);
  margin-bottom: 3px;
}

.st-tl-status {
  font-size: 14px;
  font-weight: 600;
  color: var(--st-navy);
  line-height: 1.35;
  margin-bottom: 2px;
}

.st-tl-location {
  font-size: 12px;
  color: var(--st-muted);
}

.st-tl-note {
  font-size: 12px;
  color: var(--st-muted);
  font-style: italic;
  margin-top: 3px;
  line-height: 1.4;
}

.st-no-data {
  color: var(--st-muted);
  font-size: 13px;
  padding: 12px 0;
}

/* ── Details Grid ── */
.st-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.st-detail-item {
  background: var(--st-bg);
  border: 1px solid var(--st-border);
  border-radius: 8px;
  padding: 10px 12px;
}

.st-detail-item .st-label {
  color: var(--st-muted);
  margin-bottom: 4px;
}

.st-detail-item .st-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--st-navy);
}

/* ── People Cards ── */
.st-people-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}

.st-person-card {
  background: var(--st-bg);
  border: 1px solid var(--st-border);
  border-radius: 8px;
  padding: 12px;
}

.st-person-card .st-person-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--st-muted);
  margin-bottom: 6px;
}

.st-person-card .st-person-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--st-navy);
  margin-bottom: 4px;
}

.st-person-card .st-person-detail {
  font-size: 12px;
  color: var(--st-muted);
  line-height: 1.5;
}

.st-person-card a {
  color: var(--st-red);
  text-decoration: none;
}

/* ── Carrier Card ── */
.st-carrier-card {
  background: var(--st-navy);
  color: var(--st-white);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}

.st-carrier-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--st-navy-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.st-carrier-info { flex: 1; }
.st-carrier-name { font-size: 15px; font-weight: 700; }
.st-carrier-sub  { font-size: 12px; color: rgba(255,255,255,0.55); margin-top: 2px; }

.st-carrier-actions { display: flex; gap: 8px; }
.st-carrier-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.3);
  background: transparent;
  color: var(--st-white);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: background 0.15s;
  text-decoration: none;
}
.st-carrier-btn:hover { background: rgba(255,255,255,0.12); }

/* ── Map Overlay ── */
.st-map-overlay {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--st-white);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  padding: 14px 20px;
  z-index: 10;
  min-width: 280px;
  animation: st-fade-in 0.3s ease;
}

.st-map-overlay-row {
  display: flex;
  gap: 24px;
}

.st-map-stat { text-align: center; }
.st-map-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--st-muted);
  display: block;
  margin-bottom: 4px;
}
.st-map-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--st-navy);
}

/* ── Support Bar ── */
.st-support-bar {
  background: var(--st-navy);
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}
.st-support-bar a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-weight: 600;
}
.st-support-bar a:hover { color: var(--st-white); }

/* ── Responsive ── */
@media (max-width: 860px) {
  .st-body {
    grid-template-columns: 1fr;
  }
  .st-right {
    order: -1;
  }
  #st-map {
    min-height: 320px;
  }
  .st-left {
    max-height: none;
    border-right: none;
    border-top: 1px solid var(--st-border);
  }
  .st-people-grid,
  .st-details-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .st-search-inner { padding: 4px 4px 4px 12px; }
  .st-route-cities { flex-wrap: wrap; justify-content: space-between; }
  .st-route-line-container { width: 100%; order: 3; }
}
