/* ===================================================================
   Digital Loyalty Card System - Core Design System & Global Styles
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800;900&display=swap');

:root {
  /* Brand Accent Primary */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --secondary: #0284c7;
  
  /* Luxury Curated Gradients */
  --royal-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%);
  --royal-glow: 0 4px 14px 0 rgba(79, 70, 229, 0.38);
  
  --gold-primary: #f59e0b;
  --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 60%, #b45309 100%);
  --gold-glow: 0 4px 14px 0 rgba(245, 158, 11, 0.38);
  
  --emerald-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --emerald-glow: 0 4px 14px 0 rgba(16, 185, 129, 0.32);

  --rose-gradient: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  --rose-glow: 0 4px 14px 0 rgba(244, 63, 94, 0.32);

  --card-gold: linear-gradient(135deg, #1e1e24 0%, #2a2b36 50%, #17171d 100%);
  
  /* Neutrals & Surfaces */
  --bg-dark: #0f172a;
  --bg-card-dark: #1e293b;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --border-dark: #334155;
  
  /* Status */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Modern Elevated Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.06);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.03);
  --shadow-card-hover: 0 12px 28px -4px rgba(15, 23, 42, 0.1), 0 2px 6px rgba(15, 23, 42, 0.04);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* Containers */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.mobile-container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: transparent;
  display: flex;
  flex-direction: column;
}

/* Mobile Screen View (< 768px) */
@media (max-width: 767px) {
  html, body {
    width: 100%;
    overflow-x: hidden;
  }
  body.mobile-view {
    background: #f8fafc;
    margin: 0;
    padding: 0;
    min-height: 100vh;
  }
  body.mobile-view .mobile-container {
    max-width: 100%;
    min-height: 100vh;
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
    border: none;
  }
}

/* Full Desktop View (>= 768px) */
@media (min-width: 768px) {
  body.mobile-view {
    background: #f8fafc;
    padding: 0;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  body.mobile-view .mobile-container {
    max-width: 1080px;
    margin: 0 auto;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
    min-height: 100vh;
    overflow: visible;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.72rem 1.35rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  user-select: none;
  position: relative;
  letter-spacing: 0.01em;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary {
  background: var(--royal-gradient);
  color: #ffffff;
  box-shadow: var(--royal-glow);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.48);
  filter: brightness(1.05);
}

.btn-gold {
  background: var(--gold-gradient);
  color: #ffffff;
  font-weight: 700;
  box-shadow: var(--gold-glow);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-gold:hover {
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.48);
  filter: brightness(1.06);
}

.btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

.btn-success {
  background: var(--emerald-gradient);
  color: #ffffff;
  box-shadow: var(--emerald-glow);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-success:hover {
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.45);
  filter: brightness(1.05);
}

.btn-danger {
  background: var(--rose-gradient);
  color: #ffffff;
  box-shadow: var(--rose-glow);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-danger:hover {
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(244, 63, 94, 0.45);
  filter: brightness(1.05);
}

.btn-outline {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  font-weight: 600;
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
  border-radius: 8px;
  gap: 0.35rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.45rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.input-group {
  display: flex;
  align-items: center;
  position: relative;
}

.input-prefix {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.input-with-prefix {
  padding-left: 3.2rem;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 360px;
  border-left: 4px solid var(--primary);
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.72rem;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
  line-height: 1.3;
  white-space: nowrap;
}

.badge-success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-danger {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.badge-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.badge-gold {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: #92400e;
  border: 1px solid #fcd34d;
}

/* Modal Backdrop */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.5rem;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #f8fafc;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleUp { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
