@import './vars.css';

.tracking-page {
  padding: 0 0 80px;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.tracking-hero {
  position: relative;
  min-height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 40px 60px;
  overflow: hidden;
  background: var(--ethereal-obsidian);
  isolation: isolate;
}

.tracking-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 30% 40%, rgba(230,26,26,.12), transparent 60%),
    radial-gradient(ellipse 70% 50% at 70% 60%, oklch(58% .22 348 / .1), transparent 55%),
    radial-gradient(ellipse 50% 50% at 50% 90%, rgba(124,58,237,.08), transparent 50%);
  animation: heroAmbience 18s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes heroAmbience {
  0%   { opacity: .6; filter: hue-rotate(0deg); }
  50%  { opacity: 1;  filter: hue-rotate(8deg); }
  100% { opacity: .7; filter: hue-rotate(-4deg); }
}

.tracking-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--bg), transparent);
  z-index: 1;
  pointer-events: none;
}

.track-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 0;
  will-change: transform;
}

.track-orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(230,26,26,.18), transparent 70%);
  top: -80px;
  right: -60px;
  filter: blur(60px);
  animation: orbFloat1 20s ease-in-out infinite;
}

.track-orb-2 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, oklch(58% .22 348 / .14), transparent 70%);
  bottom: -40px;
  left: -40px;
  filter: blur(50px);
  animation: orbFloat2 24s ease-in-out infinite;
}

.track-orb-3 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(124,58,237,.12), transparent 70%);
  top: 30%;
  left: 50%;
  filter: blur(40px);
  animation: orbFloat3 16s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  50%     { transform: translate3d(-40px,30px,0) scale(1.15); }
}
@keyframes orbFloat2 {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  50%     { transform: translate3d(30px,-25px,0) scale(1.1); }
}
@keyframes orbFloat3 {
  0%,100% { transform: translate3d(0,0,0) scale(.9); opacity: .5; }
  50%     { transform: translate3d(-20px,-15px,0) scale(1.2); opacity: .9; }
}

.track-scanlines {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .05;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(255,255,255,.4) 3px, rgba(255,255,255,.4) 4px);
  mix-blend-mode: overlay;
}

.track-noise {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.tracking-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.track-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  animation: fadeSlideUp .8s var(--bloom-ease) both;
}

.track-eyebrow-tag {
  font-family: var(--fc);
  font-style: italic;
  font-weight: 900;
  font-size: .66rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #fff;
  background: var(--p5);
  padding: 5px 14px 5px 16px;
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
  transform: skewX(-6deg);
}

.track-eyebrow-tag > span { transform: skewX(6deg); display: inline-block; }

.track-hero-title {
  font-family: var(--fd);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -.03em;
  margin-bottom: 16px;
  animation: fadeSlideUp .8s var(--bloom-ease) .12s both;
}

.track-hero-title .g-txt {
  background: linear-gradient(135deg, #fff 0%, oklch(58% .22 348) 40%, var(--p5) 70%, oklch(58% .22 348) 100%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: txt-shine 5s linear infinite;
}

@keyframes txt-shine { to { background-position: 250% center; } }

.track-hero-sub {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255,255,255,.6);
  max-width: 440px;
  margin: 0 auto 32px;
  text-wrap: pretty;
  animation: fadeSlideUp .8s var(--bloom-ease) .24s both;
}

.tracking-search-bar {
  display: flex;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
  animation: fadeSlideUp .8s var(--bloom-ease) .36s both;
}

.tracking-search-bar .form-input {
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--rs);
  padding: 14px 18px;
  color: #fff;
  font-size: .92rem;
  font-family: var(--fb);
  outline: none;
  transition: border-color .25s, box-shadow .25s;
  backdrop-filter: blur(12px);
}

.tracking-search-bar .form-input::placeholder {
  color: rgba(255,255,255,.3);
}

.tracking-search-bar .form-input:focus {
  border-color: var(--p5);
  box-shadow: 0 0 0 3px rgba(230,26,26,.15), 0 4px 24px rgba(230,26,26,.12);
}

.tracking-search-bar .btn {
  padding: 14px 28px;
  border-radius: var(--rs);
  font-weight: 700;
  font-size: .88rem;
  white-space: nowrap;
  border: none;
  font-family: var(--fb);
  background: linear-gradient(135deg, var(--p5d), var(--p5));
  color: #fff;
  box-shadow: 0 4px 20px rgba(230,26,26,.35);
  transition: transform .25s var(--ease), box-shadow .25s;
}

.tracking-search-bar .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(230,26,26,.5);
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.track-hero-glow-line {
  position: absolute;
  bottom: 0;
  left: -5%;
  right: -5%;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, rgba(230,26,26,.15) 10%, var(--p5) 30%, oklch(58% .22 348) 50%, var(--p5) 70%, rgba(230,26,26,.15) 90%, transparent 100%);
  filter: drop-shadow(0 0 8px rgba(230,26,26,.5));
  z-index: 2;
}

.tracking-body {
  max-width: 1100px;
  margin: -40px auto 0;
  padding: 0 40px;
  position: relative;
  z-index: 5;
}

.track-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  align-items: start;
}

.track-card {
  background: linear-gradient(135deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: 0 8px 40px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.06);
  overflow: hidden;
  transition: border-color .4s, box-shadow .4s, transform .5s var(--ease);
  opacity: 0;
  transform: translateY(20px);
  animation: cardReveal .7s var(--bloom-ease) both;
}

.track-card:nth-child(1) { animation-delay: .1s; }
.track-card:nth-child(2) { animation-delay: .2s; }
.track-card:nth-child(3) { animation-delay: .3s; }
.track-card:nth-child(4) { animation-delay: .4s; }

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(28px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.track-card:hover {
  border-color: rgba(230,26,26,.25);
  box-shadow: 0 16px 60px rgba(168,16,16,.2), inset 0 1px 0 rgba(255,255,255,.1);
}

.track-card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.track-card-title {
  font-family: var(--fd);
  font-size: 1.05rem;
  font-weight: 700;
}

.track-card-body { padding: 22px; }

.tracking-header { display: none; }

.tracking-timeline { position: relative; padding: 8px 0; }

.timeline-line {
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255,255,255,.06);
  border-radius: 1px;
}

.timeline-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  background: linear-gradient(180deg, var(--p5), oklch(58% .22 348), var(--mn));
  transition: height 1.2s var(--bloom-ease);
  border-radius: 1px;
  box-shadow: 0 0 10px rgba(230,26,26,.3);
}

.timeline-step {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 16px 0;
  position: relative;
  opacity: 0;
  transform: translateX(-10px);
  animation: stepSlideIn .5s var(--bloom-ease) both;
}

.timeline-step:nth-child(2) { animation-delay: .15s; }
.timeline-step:nth-child(3) { animation-delay: .25s; }
.timeline-step:nth-child(4) { animation-delay: .35s; }
.timeline-step:nth-child(5) { animation-delay: .45s; }
.timeline-step:nth-child(6) { animation-delay: .55s; }
.timeline-step:nth-child(7) { animation-delay: .65s; }
.timeline-step:nth-child(8) { animation-delay: .75s; }
.timeline-step:nth-child(9) { animation-delay: .85s; }

@keyframes stepSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.timeline-node {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  border: 2px solid rgba(255,255,255,.08);
  background: rgba(11,5,22,.85);
  position: relative;
  z-index: 1;
  transition: all .4s var(--bloom-ease);
}

.timeline-step.complete .timeline-node {
  border-color: var(--mn);
  background: rgba(0,212,170,.12);
  box-shadow: 0 0 16px rgba(0,212,170,.25);
}

.timeline-step.active .timeline-node {
  border-color: var(--p5);
  background: rgba(230,26,26,.12);
  box-shadow: 0 0 20px rgba(230,26,26,.3);
  animation: nodeGlow 2.5s ease-in-out infinite;
}

@keyframes nodeGlow {
  0%, 100% { box-shadow: 0 0 16px rgba(230,26,26,.3); }
  50%      { box-shadow: 0 0 32px rgba(230,26,26,.55); }
}

.timeline-content { flex: 1; padding-top: 10px; }
.timeline-label { font-size: .95rem; font-weight: 600; margin-bottom: 3px; text-transform: capitalize; }
.timeline-time { font-size: .78rem; color: rgba(255,255,255,.38); }

.map-placeholder {
  height: 220px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(45,27,94,.5), rgba(26,10,46,.7));
  border: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  position: relative;
  overflow: hidden;
}

.map-ping {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--p5);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 16px rgba(230,26,26,.5);
}

.map-ping::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--p5);
  animation: mapPing 2s ease-out infinite;
}

@keyframes mapPing {
  0% { transform: scale(1); opacity: .7; }
  100% { transform: scale(2.8); opacity: 0; }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 100px;
  font-family: var(--fc);
  font-style: italic;
  font-weight: 700;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid;
}

.status-new { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.15); color: rgba(255,255,255,.6); }
.status-processing { background: rgba(56,189,248,.1); border-color: rgba(56,189,248,.25); color: #38bdf8; }
.status-packed { background: rgba(124,58,237,.1); border-color: rgba(124,58,237,.25); color: #a78bfa; }
.status-shipped { background: rgba(230,26,26,.1); border-color: rgba(230,26,26,.3); color: var(--p5l); }
.status-delivered { background: rgba(0,212,170,.1); border-color: rgba(0,212,170,.25); color: var(--mn); }
.status-cancelled { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.25); color: #ef4444; }

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: .88rem;
}

.detail-row + .detail-row { border-top: 1px solid rgba(255,255,255,.04); }

.detail-label { color: rgba(255,255,255,.45); font-weight: 500; }
.detail-value { font-weight: 600; }

.track-issue-card {
  background: linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--r);
  padding: 22px;
  margin-top: 20px;
}

.track-issue-card h3 {
  font-size: .92rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.track-issue-card p {
  font-size: .8rem;
  color: rgba(255,255,255,.45);
  margin-bottom: 14px;
  line-height: 1.6;
}

.track-issue-card .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 20px;
  border-radius: var(--rs);
  font-size: .84rem;
  font-weight: 600;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
  transition: all .25s;
  font-family: var(--fb);
  text-decoration: none;
}

.track-issue-card .btn-ghost:hover {
  background: rgba(230,26,26,.1);
  border-color: rgba(230,26,26,.3);
  color: #fff;
}

.my-orders-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 40px 0;
}

.my-orders-title {
  font-family: var(--fd);
  font-size: 1.3rem;
  font-weight: 900;
  margin-bottom: 20px;
}

.my-order-row {
  background: linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--rs);
  padding: 18px 22px;
  cursor: pointer;
  transition: all .25s var(--ease);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.my-order-row:hover {
  border-color: rgba(230,26,26,.3);
  transform: translateX(4px);
  box-shadow: 0 6px 24px rgba(168,16,16,.15);
}

.my-order-row + .my-order-row { margin-top: 10px; }

[data-theme="light"] .tracking-hero { background: var(--bg2); }
[data-theme="light"] .tracking-hero::before { opacity: .3; }
[data-theme="light"] .track-hero-title { color: var(--text); }
[data-theme="light"] .track-hero-title .g-txt { background: linear-gradient(135deg, var(--text) 0%, var(--p5) 40%, oklch(58% .22 348) 100%); background-size: 250% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
[data-theme="light"] .track-hero-sub { color: rgba(26,18,32,.55); }
[data-theme="light"] .tracking-hero::after { background: linear-gradient(to top, var(--bg), transparent); }
[data-theme="light"] .tracking-search-bar .form-input { background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.12); color: var(--text); }
[data-theme="light"] .tracking-search-bar .form-input::placeholder { color: rgba(26,18,32,.3); }
[data-theme="light"] .track-card { background: rgba(255,255,255,.7); border-color: rgba(0,0,0,.08); backdrop-filter: blur(16px); box-shadow: 0 4px 24px rgba(0,0,0,.06); }
[data-theme="light"] .track-card:hover { border-color: rgba(230,26,26,.25); box-shadow: 0 8px 32px rgba(0,0,0,.1); }
[data-theme="light"] .track-card-hd { border-bottom-color: rgba(0,0,0,.06); }
[data-theme="light"] .timeline-line { background: rgba(0,0,0,.06); }
[data-theme="light"] .timeline-node { background: rgba(255,255,255,.9); border-color: rgba(0,0,0,.08); }
[data-theme="light"] .timeline-time { color: rgba(26,18,32,.4); }
[data-theme="light"] .detail-label { color: rgba(26,18,32,.45); }
[data-theme="light"] .detail-row + .detail-row { border-top-color: rgba(0,0,0,.06); }
[data-theme="light"] .track-issue-card { background: rgba(0,0,0,.02); border-color: rgba(0,0,0,.06); }
[data-theme="light"] .track-issue-card p { color: rgba(26,18,32,.45); }
[data-theme="light"] .track-issue-card .btn-ghost { background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.08); color: rgba(26,18,32,.65); }
[data-theme="light"] .my-order-row { background: rgba(0,0,0,.02); border-color: rgba(0,0,0,.06); }
[data-theme="light"] .my-order-row:hover { border-color: rgba(230,26,26,.25); }
[data-theme="light"] .map-placeholder { background: linear-gradient(135deg, rgba(245,240,235,.8), rgba(237,230,223,.9)); border-color: rgba(0,0,0,.06); }
[data-theme="light"] .status-new { background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.1); color: rgba(26,18,32,.5); }

@media (max-width: 900px) {
  .track-grid { grid-template-columns: 1fr; }
  .tracking-hero { min-height: 44vh; padding: 100px 20px 50px; }
  .tracking-body { padding: 0 20px; margin-top: -30px; }
  .my-orders-section { padding: 32px 20px 0; }
}

@media (max-width: 560px) {
  .tracking-hero { min-height: 38vh; padding: 90px 16px 40px; }
  .track-hero-title { font-size: clamp(1.6rem, 8vw, 2.2rem); }
  .tracking-body { padding: 0 16px; }
  .tracking-search-bar { flex-direction: column; }
  .tracking-search-bar .btn { width: 100%; }
  .track-card-hd { padding: 14px 16px; }
  .track-card-body { padding: 16px; }
  .my-orders-section { padding: 24px 16px 0; }
}
