/* ===== CSS VARIABLES ===== */
:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --card: #1a1a24;
  --card-hover: #22222e;
  --border: #2a2a38;
  --fg: #ffffff;
  --fg-muted: #8b8b9e;
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.3);
  --success: #10b981;
  --danger: #ef4444;
}

/* ===== BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
}

.points-font {
  font-family: 'Space Grotesk', sans-serif;
}

/* ===== LAYOUT ===== */
.app-container {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
}

.relative { position: relative; }
.z-10 { z-index: 10; }

/* ===== BACKGROUND EFFECTS ===== */
.bg-gradient-mesh {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-gradient-mesh::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
  animation: meshMove 20s ease-in-out infinite;
}

@keyframes meshMove {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-5%, -5%) rotate(5deg); }
}

.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ===== PAGE TRANSITIONS ===== */
.page {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  padding-bottom: 100px;
}

.page.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.card:hover {
  background: var(--card-hover);
  border-color: rgba(245, 158, 11, 0.3);
}

/* ===== POINTS DISPLAY ===== */
.points-display {
  background: linear-gradient(135deg, var(--card) 0%, rgba(245, 158, 11, 0.1) 100%);
  border: 1px solid rgba(245, 158, 11, 0.2);
  position: relative;
  overflow: hidden;
}

.points-display::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

/* ===== TIER BADGES ===== */
.tier-badge {
  position: relative;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tier-silver {
  background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
  color: #1a1a24;
}

.tier-gold {
  background: linear-gradient(135deg, #ffd700 0%, #ffb800 100%);
  color: #1a1a24;
}

.tier-platinum {
  background: linear-gradient(135deg, #e5e5e5 0%, #b8b8b8 100%);
  color: #1a1a24;
  box-shadow: 0 0 20px rgba(229, 229, 229, 0.3);
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ===== STAMP CARD ===== */
.stamp {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  transition: all 0.3s ease;
}

.stamp.collected {
  background: var(--accent);
  border: 2px solid var(--accent);
  animation: stampCollect 0.5s ease;
}

@keyframes stampCollect {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ===== QR CODE ===== */
.qr-container {
  background: white;
  padding: 16px;
  border-radius: 12px;
  display: inline-block;
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: rgba(18, 18, 26, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 8px 16px 20px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
  color: var(--fg-muted);
}

.nav-item:hover {
  background: rgba(245, 158, 11, 0.1);
}

.nav-item.active {
  color: var(--accent);
}

.nav-item.active svg {
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.5));
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #d97706 100%);
  color: #1a1a24;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'DM Sans', sans-serif;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--fg);
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'DM Sans', sans-serif;
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.1);
}

/* ===== SPIN WHEEL ===== */
.spin-wheel-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto;
}

.spin-wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.3);
}

.wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 30px solid var(--accent);
  z-index: 10;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: var(--card);
  border-radius: 50%;
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  z-index: 5;
  cursor: pointer;
  transition: all 0.3s ease;
}

.wheel-center:hover {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ===== NOTIFICATION BADGE ===== */
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 380px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ===== TOAST NOTIFICATION ===== */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  width: calc(100% - 40px);
  max-width: 390px;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: none;
  align-items: center;
  gap: 12px;
  animation: toastIn 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.toast.show {
  display: flex;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--fg-muted);
}

.scroll-hide {
  scrollbar-width: none;
}

.scroll-hide::-webkit-scrollbar {
  display: none;
}

/* ===== ANIMATION UTILITIES ===== */
.fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== REWARD ITEM ===== */
.reward-item {
  position: relative;
  overflow: hidden;
}

.reward-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s ease;
}

.reward-item:hover::before {
  left: 100%;
}

/* ===== SPECIAL CARDS ===== */
.birthday-card {
  border-color: rgba(236, 72, 153, 0.3);
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
}

.expiring-card {
  border-color: rgba(239, 68, 68, 0.3);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, transparent 100%);
}

.voucher-card {
  background: linear-gradient(90deg, var(--card) 0%, rgba(245, 158, 11, 0.05) 100%);
}

.referral-card {
  background: linear-gradient(135deg, var(--card) 0%, rgba(59, 130, 246, 0.1) 100%);
}

/* ===== STEP NUMBER ===== */
.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

/* ===== BENEFIT ICON ===== */
.benefit-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== UTILITY CLASSES (TAILWIND-LIKE) ===== */
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }

.m-0 { margin: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.-ml-2 { margin-left: -0.5rem; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.inline-block { display: inline-block; }
.grid { display: grid; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; } /* FIXED */
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-amber-400 { color: #fbbf24; }
.text-amber-500 { color: #f59e0b; }
.text-blue-400 { color: #60a5fa; }
.text-emerald-400 { color: #34d399; }
.text-red-400 { color: #f87171; }
.text-purple-400 { color: #c084fc; }
.text-black { color: #000000; }

.bg-amber-500 { background-color: #f59e0b; }
.bg-white\/5 { background-color: rgba(255, 255, 255, 0.05); }
.bg-amber-500\/20 { background-color: rgba(245, 158, 11, 0.2); }
.bg-emerald-500\/20 { background-color: rgba(16, 185, 129, 0.2); }
.bg-purple-500\/20 { background-color: rgba(168, 85, 247, 0.2); }
.bg-blue-500\/20 { background-color: rgba(59, 130, 246, 0.2); }
.bg-red-500\/20 { background-color: rgba(239, 68, 68, 0.2); }
.bg-yellow-500\/20 { background-color: rgba(234, 179, 8, 0.2); }
.bg-pink-500\/20 { background-color: rgba(236, 72, 153, 0.2); }

.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-40 { width: 10rem; }
.w-full { width: 100%; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-20 { height: 5rem; }
.h-40 { height: 10rem; }
.h-full { height: 100%; }
.min-w-\[160px\] { min-width: 160px; }

.max-w-\[380px\] { max-width: 380px; }

.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }

.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

.whitespace-nowrap { white-space: nowrap; }

.tracking-widest { letter-spacing: 0.1em; }

.border { border-width: 1px; }
.border-2 { border-width: 2px; }

.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

.cursor-pointer { cursor: pointer; }

.hover\:bg-white\/5:hover { background-color: rgba(255, 255, 255, 0.05); }

.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); }
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); }
.from-amber-400 { --tw-gradient-from: #fbbf24; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(251, 191, 36, 0)); }
.from-amber-500 { --tw-gradient-from: #f59e0b; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(245, 158, 11, 0)); }
.to-orange-500 { --tw-gradient-to: #f97316; }
.to-yellow-400 { --tw-gradient-to: #facc15; }
.from-green-500\/20 { --tw-gradient-from: rgba(34, 197, 94, 0.2); }
.to-emerald-500\/20 { --tw-gradient-to: rgba(16, 185, 129, 0.2); }
.from-pink-500\/20 { --tw-gradient-from: rgba(236, 72, 153, 0.2); }
.to-rose-500\/20 { --tw-gradient-to: rgba(244, 63, 94, 0.2); }