:root {
  --primary: #ff6b35;
  --secondary: #f7931e;
  --accent: #1fc5ff;
  --bg-dark: #080808;
  --bg-card: rgba(19, 19, 19, 0.86);
  --line: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --text-soft: #bdc2cc;
  --good: #00cc8e;
  --warn: #ff8c42;
  --danger: #ff5e6d;
  --gradient-main: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 10%, rgba(31, 197, 255, 0.18), transparent 36%),
              radial-gradient(circle at 80% 75%, rgba(247, 147, 30, 0.18), transparent 34%),
              linear-gradient(145deg, #050505 0%, #0f0f0f 45%, #060606 100%);
  min-height: 100vh;
}

.container {
  max-width: 1100px;
}

.navbar {
  background: rgba(8, 8, 8, 0.8);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.navbar-logo {
  width: 45px;
  height: 45px;
  object-fit: contain;
}

.navbar-text {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}

.navbar-text span {
  color: var(--primary);
}

.navbar-nav .nav-link {
  color: #d6dae0;
  font-weight: 500;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #fff;
}

.tracking-hero {
  position: relative;
  padding: 130px 0 80px;
  overflow: hidden;
}

.bg-shape {
  position: absolute;
  border-radius: 100%;
  filter: blur(6px);
  opacity: 0.4;
  pointer-events: none;
}

.shape-a {
  width: 280px;
  height: 280px;
  top: 70px;
  right: -90px;
  background: linear-gradient(140deg, rgba(255, 107, 53, 0.75), rgba(247, 147, 30, 0.15));
}

.shape-b {
  width: 220px;
  height: 220px;
  bottom: 25px;
  left: -70px;
  background: linear-gradient(140deg, rgba(31, 197, 255, 0.5), rgba(0, 118, 201, 0.1));
}

.tracking-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  animation: riseIn 0.55s ease;
}

.badge-soft {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(255, 107, 53, 0.14);
  color: #ffd2c0;
  border: 1px solid rgba(255, 107, 53, 0.4);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

.tracking-card h1 {
  margin-top: 1rem;
  margin-bottom: 0.8rem;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.25;
}

.tracking-card p {
  margin: 0;
  color: var(--text-soft);
}

.tracking-form {
  margin-top: 1.8rem;
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.input-wrap {
  position: relative;
}

.input-wrap i {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: #9ea6b0;
}

.form-control {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 12px;
  padding: 0.85rem 1rem 0.85rem 2.35rem;
}

.form-control:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(31, 197, 255, 0.22);
  color: #fff;
}

.form-control::placeholder {
  color: #adb5c0;
}

.helper {
  margin-top: 0.55rem;
  color: #b6bec9;
  font-size: 0.86rem;
}

.btn-track {
  margin-top: 1rem;
  border: none;
  background: var(--gradient-main);
  color: #fff;
  font-weight: 600;
  border-radius: 12px;
  padding: 0.8rem 1.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-track:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(255, 107, 53, 0.25);
}

.status-banner {
  margin-top: 1rem;
  min-height: 1.4rem;
  font-size: 0.95rem;
}

.status-banner.loading {
  color: #d3ecff;
}

.status-banner.success {
  color: #8cf6d4;
}

.status-banner.warning {
  color: #ffd2a5;
}

.status-banner.error {
  color: #ffb0b8;
}

.json-loader {
  display: none;
  margin-top: 0.8rem;
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(31, 197, 255, 0.28);
  background: rgba(31, 197, 255, 0.08);
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
}

.json-loader.active {
  display: flex;
}

.loader-dots {
  display: inline-flex;
  gap: 0.34rem;
  align-items: center;
}

.loader-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #76e2ff;
  animation: pulseDot 0.9s infinite ease-in-out;
}

.loader-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.loader-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.loader-text {
  color: #d7efff;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.results-section {
  margin-top: 2rem;
}

.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.results-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.match-count {
  color: #cfd6df;
  font-size: 0.92rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 460px));
  justify-content: center;
  gap: 1.25rem;
}

.result-card {
  background: rgba(15, 15, 15, 0.9);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.35rem;
  animation: riseIn 0.45s ease;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.result-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.result-title {
  font-size: 1.18rem;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  text-align: left;
}

.result-title i {
  color: var(--accent);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.detail-item {
  display: flex;
  gap: 0.4rem;
  line-height: 1.5;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  padding-top: 0.56rem;
}

.detail-item:first-child {
  border-top: none;
  padding-top: 0;
}

.detail-key {
  color: #f2f5f8;
  font-weight: 600;
  min-width: 108px;
  font-size: 0.98rem;
}

.detail-value {
  color: #c7ced7;
  overflow-wrap: anywhere;
  font-size: 0.98rem;
}

.total-value {
  color: #b2f7dc;
  font-weight: 600;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.35rem 0.78rem;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-progress {
  background: rgba(0, 204, 142, 0.16);
  color: #95f0ce;
  border-color: rgba(0, 204, 142, 0.34);
}

.status-shipping {
  background: rgba(0, 204, 142, 0.16);
  color: #95f0ce;
  border-color: rgba(0, 204, 142, 0.34);
}

.status-completed {
  background: rgba(0, 204, 142, 0.16);
  color: #95f0ce;
  border-color: rgba(0, 204, 142, 0.34);
}

.status-cancelled {
  background: rgba(0, 204, 142, 0.16);
  color: #95f0ce;
  border-color: rgba(0, 204, 142, 0.34);
}

.status-default {
  background: rgba(0, 204, 142, 0.16);
  color: #95f0ce;
  border-color: rgba(0, 204, 142, 0.34);
}

.timeline-graph {
  --progress: 0%;
  position: relative;
  margin: 0.25rem 0 1rem;
  padding: 0.3rem 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.timeline-track,
.timeline-fill {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 16px;
  height: 3px;
  border-radius: 999px;
}

.timeline-track {
  background: rgba(157, 168, 179, 0.25);
}

.timeline-fill {
  width: var(--progress);
  right: auto;
  background: linear-gradient(90deg, #44d8a3 0%, #00cc8e 100%);
  box-shadow: 0 0 10px rgba(0, 204, 142, 0.4);
}

.timeline-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.timeline-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1d2228;
  color: #9ea8b3;
  border: 1px solid rgba(157, 168, 179, 0.45);
  margin-bottom: 0.35rem;
}

.timeline-dot i {
  font-size: 0.78rem;
}

.timeline-label {
  font-size: 0.72rem;
  color: #aab4bf;
  line-height: 1.2;
}

.timeline-node.done .timeline-dot,
.timeline-node.current .timeline-dot {
  background: rgba(0, 204, 142, 0.2);
  color: #9df3d2;
  border-color: rgba(0, 204, 142, 0.65);
}

.timeline-node.current .timeline-dot {
  box-shadow: 0 0 0 3px rgba(0, 204, 142, 0.18);
}

.timeline-node.done .timeline-label,
.timeline-node.current .timeline-label {
  color: #c9f6e5;
}

.timeline-graph.is-cancelled .timeline-fill {
  display: none;
}

.timeline-graph.is-cancelled .timeline-dot {
  background: rgba(255, 94, 109, 0.1);
  color: #ffb8bf;
  border-color: rgba(255, 94, 109, 0.35);
}

.timeline-graph.is-cancelled .timeline-label {
  color: #ffbec4;
}

.timeline-cancelled {
  margin: 0.25rem 0 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #ffbec4;
  font-size: 0.84rem;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 1rem;
  color: #d0d5dd;
  background: rgba(255, 255, 255, 0.03);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseDot {
  0%,
  80%,
  100% {
    transform: scale(0.72);
    opacity: 0.45;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .tracking-hero {
    padding-top: 105px;
  }

  .tracking-card {
    padding: 1.3rem;
    border-radius: 18px;
  }

  .tracking-card h1 {
    font-size: 1.55rem;
  }

  .result-headline {
    flex-direction: column;
    align-items: flex-start;
  }

  .timeline-graph {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 0.8rem;
  }

  .timeline-track,
  .timeline-fill {
    display: none;
  }

  .results-grid {
    grid-template-columns: minmax(280px, 1fr);
  }

  .result-card {
    padding: 1.1rem;
  }
}
