/* ===== IMPORTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  --primary: #0ea5e9;
  --primary-dark: #0369a1;
  --primary-light: #7dd3fc;
  --primary-bg: #e0f2fe;
  --success: #10b981;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
}

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ===== MAIN CONTAINER ===== */
.tracking-container {
  width: 100%;
  max-width: 600px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.tracking-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--success));
}

/* ===== HEADER ===== */
.tracking-header {
  text-align: center;
  margin-bottom: 32px;
}

.header-logo {
  width: 56px;
  height: 56px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.header-logo svg {
  width: 28px;
  height: 28px;
}

.tracking-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.tracking-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ===== SEARCH BOX ===== */
.search-box {
  margin-bottom: 24px;
}

.search-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.search-input-wrapper {
  display: flex;
  gap: 12px;
}

.search-input {
  flex: 1;
  padding: 14px 20px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 500;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
  text-transform: uppercase;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-bg);
}

.search-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
}

.btn-search {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0 28px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-search:hover {
  background: var(--primary-dark);
}

.search-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
}

/* ===== RESULT AREA ===== */
.result-area {
  margin-top: 32px;
  border-top: 1px solid var(--border-color);
  padding-top: 32px;
  animation: fadeIn 0.4s ease;
}

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

.state-container {
  text-align: center;
  padding: 24px 0;
}

.error-state .state-icon {
  width: 48px;
  height: 48px;
  background: #fee2e2;
  color: #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0 auto 16px;
}

.error-state h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.error-state p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ===== TRACKING SUCCESS RESULT ===== */
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--primary-bg);
  color: var(--primary-dark);
  border-radius: 20px;
  margin-bottom: 8px;
}

.result-title h3 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.result-status {
  background: #d1fae5;
  color: #047857;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.result-status::before {
  content: '';
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
}

/* TIMELINE */
.timeline {
  position: relative;
  margin-bottom: 32px;
  padding-left: 12px;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 15px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  padding-left: 32px;
  margin-bottom: 24px;
}

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

.timeline-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-color);
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--border-color);
  z-index: 1;
}

.timeline-item.active .timeline-dot {
  background: var(--success);
  box-shadow: 0 0 0 2px var(--success);
}

.timeline-item.rejected .timeline-dot {
  background: #ef4444; /* red */
  box-shadow: 0 0 0 2px #ef4444;
}

.timeline-content h4 {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.timeline-item.active .timeline-content h4 {
  color: var(--text-primary);
}

.timeline-item.rejected .timeline-content h4 {
  color: #ef4444;
}

.timeline-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* DETAILS */
.result-details {
  background: var(--bg-body);
  border-radius: var(--radius-md);
  padding: 20px;
}

.result-details h4 {
  font-size: 0.9rem;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 8px;
}

.detail-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-label {
  color: var(--text-secondary);
}

.detail-value {
  font-weight: 600;
  text-align: right;
}

/* ===== NAVIGATION & FOOTER ===== */
.navigation-links {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.navigation-links a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.navigation-links a:hover {
  text-decoration: underline;
}

.tracking-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* SPINNER */
.spinner {
  width: 32px;
  height: 32px;
  border: 4px solid var(--primary-bg);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

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

@media (max-width: 480px) {
  .tracking-container {
    padding: 24px;
  }
  
  .search-input-wrapper {
    flex-direction: column;
  }
  
  .btn-search {
    padding: 14px;
  }
}
