/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 540px;
  margin: 0 auto;
  padding: 24px 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
.header {
  text-align: center;
  margin-bottom: 24px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
}

.header h1 {
  font-size: 22px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.5px;
}

.tagline {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 2px;
}

/* ===== Card ===== */
.card {
  background: #1e293b;
  border-radius: 16px;
  padding: 28px 24px;
  border: 1px solid #334155;
}

/* ===== Search Card ===== */
.search-card h2 {
  font-size: 20px;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  color: #f8fafc;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input::placeholder {
  color: #475569;
}

.form-group input:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

button[type="submit"] {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: 10px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  margin-top: 4px;
}

button[type="submit"]:hover {
  opacity: 0.9;
}

button[type="submit"]:active {
  transform: scale(0.98);
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(15, 23, 42, 0.3);
  border-top-color: #0f172a;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

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

.error-msg {
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  color: #fca5a5;
  font-size: 14px;
  text-align: center;
}

/* ===== Result Card ===== */
.result-card {
  animation: fadeIn 0.3s ease;
}

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

.back-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 20px;
  transition: color 0.2s;
}

.back-btn:hover {
  color: #f59e0b;
}

/* Order Info */
.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.order-label {
  display: block;
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.order-number {
  font-size: 20px;
  font-weight: 700;
  color: #f59e0b;
}

.type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  margin-left: 8px;
  vertical-align: middle;
}

.type-badge.instock {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.type-badge.preorder {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.progress-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
}

.order-details {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.detail {
  display: flex;
  gap: 12px;
}

.detail-label {
  font-size: 13px;
  color: #64748b;
  min-width: 72px;
  flex-shrink: 0;
}

.detail-value {
  font-size: 14px;
  color: #e2e8f0;
  font-weight: 500;
}

/* ===== Progress Bar ===== */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #334155;
  border-radius: 4px;
  margin-bottom: 28px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #d97706);
  border-radius: 4px;
  transition: width 0.8s ease;
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: #334155;
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
  padding-left: 16px;
}

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

/* Timeline dot */
.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #334155;
  border: 2px solid #334155;
  z-index: 1;
}

/* Completed */
.timeline-item.completed::before {
  background: #22c55e;
  border-color: #22c55e;
}

.timeline-item.completed::after {
  content: '';
  position: absolute;
  left: -16px;
  top: 7px;
  width: 6px;
  height: 3px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
  z-index: 2;
}

/* Current */
.timeline-item.current::before {
  background: #f59e0b;
  border-color: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.05); }
}

/* Upcoming */
.timeline-item.upcoming::before {
  background: #1e293b;
  border-color: #475569;
}

.timeline-item .step-label {
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
}

.timeline-item .step-label-th {
  font-size: 12px;
  color: #64748b;
  margin-top: 1px;
}

.timeline-item.completed .step-label {
  color: #86efac;
}

.timeline-item.current .step-label {
  color: #fbbf24;
  font-weight: 600;
}

.timeline-item.current .step-label-th {
  color: #fbbf24;
  opacity: 0.7;
}

/* ===== Footer ===== */
.footer {
  margin-top: auto;
  padding-top: 32px;
  text-align: center;
  font-size: 12px;
  color: #475569;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .container {
    padding: 16px 12px;
  }

  .card {
    padding: 22px 18px;
  }

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