* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% 0%, #e8f0ff 0, transparent 35%),
    radial-gradient(circle at 100% 100%, #eef5ff 0, transparent 35%), #f7f9fc;
  color: #172033;
  padding: 40px 20px;
  -webkit-tap-highlight-color: transparent;
}

.container {
  width: 100%;
  max-width: 800px;
  margin: auto;
}

/* Back link */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover {
  color: #1d4ed8;
}

/* Header */

.header {
  text-align: center;
  margin-bottom: 28px;
}

.logo {
  width: 120px;
  height: auto;
}

.header h1 {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.header p {
  color: #6b7280;
  font-size: 15px;
}

/* Search card */

.search-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  padding: 26px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
}

.search-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #334155;
}

.search-row {
  display: flex;
  gap: 10px;
}

.search-input {
  flex: 1;
  height: 64px;
  border: 1.5px solid #dbe1ea;
  border-radius: 16px;
  padding: 0 18px;
  font-size: 17px;
  outline: none;
  color: #172033;
  background: white;
  transition: 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.search-button {
  height: 64px;
  padding: 0 28px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
}

.search-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
}

.search-button:active {
  transform: none;
}

.search-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.search-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Message */

.message {
  display: none;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
}

.message.error {
  display: block;
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.message.info {
  display: block;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Result */

.result {
  display: none;
  margin-top: 22px;
  background: white;
  border: 1px solid #e6eaf0;
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

.result-header {
  padding: 24px 26px;
  border-bottom: 1px solid #edf0f4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.result-title {
  font-size: 18px;
  font-weight: 800;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 12px;
  font-weight: 700;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

/* Shipment summary */

.shipment-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 22px 26px;
}

.info-box {
  background: #f8fafc;
  border: 1px solid #edf0f4;
  border-radius: 16px;
  padding: 17px;
  min-width: 0;
}

.info-label {
  color: #7b8495;
  font-size: 12px;
  margin-bottom: 7px;
}

.info-value {
  color: #172033;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Route */

.route-box {
  margin: 0 26px 22px;
  padding: 18px;
  border-radius: 17px;
  background: linear-gradient(135deg, #f8fbff, #f1f5ff);
  border: 1px solid #dce7ff;
}

.route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.route-point {
  flex: 1;
}

.route-label {
  font-size: 11px;
  color: #7b8495;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.route-value {
  font-size: 16px;
  font-weight: 800;
}

.route-arrow {
  color: #2563eb;
  font-size: 22px;
  font-weight: 700;
}

/* Timeline */

.timeline-section {
  padding: 0 26px 30px;
}

.timeline-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 20px;
}

.timeline {
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: #e2e8f0;
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 17px;
  margin-bottom: 22px;
}

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

.timeline-dot {
  position: relative;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  border: 6px solid #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.timeline-item:first-child .timeline-dot {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.timeline-content {
  flex: 1;
  background: #fafbfc;
  border: 1px solid #edf0f4;
  border-radius: 16px;
  padding: 15px 17px;
}

.timeline-date {
  font-size: 12px;
  color: #7b8495;
  margin-bottom: 6px;
}

.timeline-location {
  font-size: 16px;
  font-weight: 800;
  color: #172033;
  margin-bottom: 8px;
}

.timeline-status {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

/* No history */

.no-history {
  padding: 18px;
  border-radius: 14px;
  background: #f8fafc;
  color: #7b8495;
  font-size: 14px;
  text-align: center;
}

/* Footer */

.footer {
  text-align: center;
  margin-top: 25px;
  color: #98a1b2;
  font-size: 12px;
}

/* Loading */

.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 7px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile */

@media (max-width: 640px) {
  body {
    padding: 24px 14px;
  }

  .back-link {
    margin-bottom: 14px;
  }

  .search-card {
    padding: 22px;
    border-radius: 20px;
  }

  .search-label {
    font-size: 15px;
    margin-bottom: 12px;
  }

.search-row {
        flex-direction: row;
        gap: 10px;
    }

    .search-input {
        flex: 1;
        min-width: 0;
        width: auto;
        height: 60px;
        font-size: 18px;
        padding: 0 16px;
    }

    .search-button {
        width: auto;
        height: 60px;
        padding: 0 22px;
        font-size: 17px;
        flex-shrink: 0;
    }

  .shipment-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 18px 20px;
  }

  .info-box {
    padding: 13px 14px;
    border-radius: 14px;
  }

  .info-value {
    font-size: 14px;
  }

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

  .status-badge {
    white-space: nowrap;
  }

  .route-box {
    margin: 0 20px 20px;
  }

  .timeline-section {
    padding: 0 20px 24px;
  }

  .route {
    gap: 10px;
  }

  .route-label {
    font-size: 10px;
  }

  .route-value {
    font-size: 14px;
  }

  .route-arrow {
    font-size: 18px;
  }

  .header h1 {
    font-size: 29px;
  }

  .timeline-content {
    padding: 13px 15px;
  }
}

/* Very small screens: single-column info boxes so long names/AWB stay readable */
@media (max-width: 380px) {
    .shipment-info {
        grid-template-columns: 1fr;
    }

    .search-card {
        padding: 17px;
    }

    .search-row {
        gap: 8px;
    }

    .search-input {
        height: 56px;
        font-size: 16px;
        padding: 0 12px;
    }

    .search-button {
        height: 56px;
        padding: 0 16px;
        font-size: 16px;
    }
}
