/* --- CSS Variables (Nxt-Gen Design System) --- */
:root {
  --purple-h: 243;
  --purple-s: 100%;
  --purple-l: 69%;
  --purple: hsl(var(--purple-h), var(--purple-s), var(--purple-l));
  --purple-light: hsl(var(--purple-h), var(--purple-s), 76%);
  --purple-dark: hsl(var(--purple-h), var(--purple-s), 56%);
  
  --red-h: 0;
  --red-s: 100%;
  --red-l: 71%;
  --red: hsl(var(--red-h), var(--red-s), var(--red-l));
  
  --green: hsl(141, 78%, 60%);
  --blue: hsl(199, 94%, 59%);
  
  --bg-dark: #05050e;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-glass: rgba(255, 255, 255, 0.05);
  
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.45);

  --border-glass: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(108, 99, 255, 0.2);

  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 50px -10px rgba(108, 99, 255, 0.4);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 36px;

  --transition: 0.4s cubic-bezier(0.2, 0, 0.2, 1);
  --transition-fast: 0.2s cubic-bezier(0.2, 0, 0.2, 1);

  --font-main: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* --- Animated Background --- */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(ellipse at 20% 20%, #0f0a2e 0%, #0A0A1A 50%, #0a1a0f 100%);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, #6C63FF 0%, transparent 70%);
  top: -200px; left: -200px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #FF6B6B 0%, transparent 70%);
  bottom: -100px; right: -100px;
  animation-delay: -7s;
}

.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #43E97B 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
  opacity: 0.15;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 30px) scale(0.95); }
}

/* --- Gradient Text --- */
.gradient-text {
  background: linear-gradient(135deg, var(--purple), var(--red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 1.5rem;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
  backdrop-filter: blur(0px);
}

.navbar.scrolled {
  background: rgba(10, 10, 26, 0.8);
  backdrop-filter: blur(20px);
  border-bottom-color: var(--border-subtle);
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-main);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  transition: var(--transition-fast);
}

.nav-logo:hover { opacity: 0.85; }

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  background: rgba(108, 99, 255, 0.12);
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: 10px;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }

.btn-nav-login {
  padding: 0.5rem 1.2rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.btn-nav-login:hover { background: var(--bg-glass); }

.btn-nav-signup {
  padding: 0.5rem 1.4rem;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(108, 99, 255, 0.4);
  transition: var(--transition-fast);
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.btn-nav-signup:hover {
  background: linear-gradient(135deg, var(--purple-light), var(--purple));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: 8px;
}

.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition-fast);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(10, 10, 26, 0.95);
  backdrop-filter: blur(20px);
  gap: 0.5rem;
}

.mobile-menu a {
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.mobile-menu a:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }

.mobile-menu.open { display: flex; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
}

/* --- Global Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: white;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(108, 99, 255, 0.4);
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.35);
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108, 99, 255, 0.5);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: transparent;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  transition: var(--transition);
  cursor: pointer;
}

.btn-ghost:hover {
  background: var(--bg-glass);
  border-color: rgba(255,255,255,0.25);
  transform: translateY(-2px);
}

/* --- Glassmorphism Card --- */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(108, 99, 255, 0.4); border-radius: 3px; }

/* --- Toast Notification --- */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  background: rgba(20, 20, 40, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  font-size: 0.95rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(67, 233, 123, 0.4); }
.toast.error { border-color: rgba(255, 107, 107, 0.4); }

/* --- Status Badges --- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.85rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.status-delivered { background: rgba(67, 233, 123, 0.15); color: #43E97B; border: 1px solid rgba(67, 233, 123, 0.3); }
.status-transit { background: rgba(56, 189, 248, 0.15); color: #38BDF8; border: 1px solid rgba(56, 189, 248, 0.3); }
.status-pending { background: rgba(247, 151, 30, 0.15); color: #F7971E; border: 1px solid rgba(247, 151, 30, 0.3); }
.status-out { background: rgba(108, 99, 255, 0.15); color: #8B85FF; border: 1px solid rgba(108, 99, 255, 0.3); }

/* --- Particle Field --- */
.particle-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px; height: 2px;
  background: white;
  border-radius: 50%;
  opacity: 0;
  animation: particleFade var(--duration, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes particleFade {
  0% { opacity: 0; transform: translateY(0) scale(0.5); }
  50% { opacity: 0.6; transform: translateY(-20px) scale(1); }
  100% { opacity: 0; transform: translateY(-40px) scale(0.5); }
}

/* Print Styles */
@media print {
  body > *:not(#printableArea) { display: none !important; }
  #printableArea { display: block !important; }
  .printable-area { display: block !important; }
}

.printable-area {
  display: none;
  background: white;
  color: #1a1a2e;
  padding: 40px;
  font-family: var(--font-main);
}

.print-header {
  border-bottom: 3px solid #6C63FF;
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.print-header h2 { font-size: 1.4rem; color: #1a1a2e; margin-bottom: 4px; }
.print-header p { color: #666; font-size: 0.9rem; }

.print-body { margin-bottom: 40px; }

.print-footer {
  border-top: 1px solid #eee;
  padding-top: 16px;
  color: #999;
  font-size: 0.85rem;
  text-align: center;
}

.print-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
}

.print-detail-row .pk { color: #666; font-weight: 500; }
.print-detail-row .pv { color: #1a1a2e; font-weight: 600; }

.print-timeline { margin-top: 24px; }
.print-timeline h3 { font-size: 1.1rem; color: #1a1a2e; margin-bottom: 16px; }
.print-tl-item { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.print-tl-dot { width: 12px; height: 12px; border-radius: 50%; background: #6C63FF; margin-top: 4px; flex-shrink: 0; }

.print-tl-event { font-weight: 600; color: #1a1a2e; }
.print-tl-time { font-size: 0.85rem; color: #666; }

