
/* ===================================================================
   SPARE XPRESS - ENHANCED PREMIUM DESIGN SYSTEM
   Version: 2.0 - Modern, Elegant, Professional
   =================================================================== */

/* ===================================================================
   1. PREMIUM COLOR PALETTE & DESIGN TOKENS
   =================================================================== */
:root {
  /* Primary Brand Colors - Premium Blue Gradients */
  --primary-dark: #1a365d;
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-lighter: #60a5fa;
  
  /* Accent Colors - Energetic Gradient */
  --accent-red: #ff6b6b;
  --accent-orange: #ff8c42;
  --accent-gold: #ffd93d;
  
  /* Success & Status Colors */
  --success: #10b981;
  --success-light: #34d399;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  /* Neutral Colors */
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #1a365d 0%, #2563eb 100%);
  --gradient-accent: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-mesh: radial-gradient(at 40% 20%, hsla(217, 100%, 50%, 0.3) 0px, transparent 50%),
                   radial-gradient(at 80% 0%, hsla(189, 100%, 56%, 0.2) 0px, transparent 50%),
                   radial-gradient(at 0% 50%, hsla(263, 100%, 67%, 0.2) 0px, transparent 50%),
                   radial-gradient(at 80% 100%, hsla(240, 100%, 70%, 0.2) 0px, transparent 50%),
                   radial-gradient(at 0% 0%, hsla(217, 100%, 50%, 0.2) 0px, transparent 50%);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.3);
  --shadow-glow-accent: 0 0 30px rgba(255, 107, 107, 0.4);
  
  /* Spacing System */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Typography */
  --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  
  /* Z-Index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ===================================================================
   2. GLOBAL STYLES & RESETS
   =================================================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--gray-50);
  overflow-x: hidden;
}

/* Premium Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--gray-900);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h5 { font-size: clamp(1.1rem, 2vw, 1.25rem); }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

/* Text Gradient Utility */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===================================================================
   3. ENHANCED BUTTON STYLES
   =================================================================== */

.btn {
  font-family: var(--font-primary);
  font-weight: 600;
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.5rem;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width var(--transition- slow), height var(--transition-slow);
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

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

.btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  transform: translateY(-2px);
  color: var(--white);
}

.btn-accent {
  background: var(--gradient-accent);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-accent:hover {
  box-shadow: var(--shadow-xl), var(--shadow-glow-accent);
  transform: translateY(-2px);
  color: var(--white);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-lg);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  border-radius: var(--radius-xl);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Button Animations */
@keyframes button-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

/* ===================================================================
   4. GLASSMORPHISM EFFECTS
   =================================================================== */

.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-xl);
}

.glass-dark {
  background: rgba(26, 54, 93, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-2xl);
}

.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
}

.glass-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-2xl);
  border-color: rgba(37, 99, 235, 0.3);
}

/* ===================================================================
   5. CARD COMPONENTS
   =================================================================== */

.card-modern {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all var(--transition-base);
  border: 1px solid var(--gray-200);
}

.card-modern:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
  border-color: var(--primary-light);
}

.card-product {
  background: var(--white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
  border: 1px solid var(--gray-200);
  position: relative;
}

.card-product::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius-xl);
  opacity: 0;
  transition: opacity var(--transition-base);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(255, 107, 107, 0.1) 100%);
  pointer-events: none;
}

.card-product:hover::after {
  opacity: 1;
}

.card-product:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: var(--shadow-2xl);
  border-color: transparent;
}

/* 3D Tilt Effect */
.card-tilt {
  transform-style: preserve-3d;
  perspective: 1000px;
}

.card-tilt:hover {
  transform: rotateX(2deg) rotateY(-2deg) translateY(-8px);
}

/* ===================================================================
   6. ANIMATED BACKGROUNDS
   =================================================================== */

.bg-mesh-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.bg-mesh-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-mesh);
  animation: mesh-move 20s ease infinite;
  opacity: 0.6;
}

@keyframes mesh-move {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Particle Background Effect */
.bg-particles {
  position: relative;
  background: var(--gradient-hero);
}

.bg-particles::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, white, transparent),
    radial-gradient(2px 2px at 60px 70px, white, transparent),
    radial-gradient(1px 1px at 50px 50px, white, transparent),
    radial-gradient(1px 1px at 130px 80px, white, transparent),
    radial-gradient(2px 2px at 90px 10px, white, transparent);
  background-size: 200px 200px;
  background-repeat: repeat;
  animation: particles 100s linear infinite;
  opacity: 0.3;
}

@keyframes particles {
  from { transform: translateY(0); }
  to { transform: translateY(-200px); }
}

/* ===================================================================
   7. LOADING STATES & SKELETONS
   =================================================================== */

.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 0%, var(--gray-300) 50%, var(--gray-200) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
}

.skeleton-title {
  height: 2rem;
  width: 60%;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
}

.skeleton-image {
  height: 200px;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ===================================================================
   8. SCROLL ANIMATIONS
   =================================================================== */

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* ===================================================================
   9. MICRO-INTERACTIONS
   =================================================================== */

.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.hover-scale {
  transition: transform var(--transition-base);
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-glow {
  transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

/* Click Ripple Effect */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
}

/* ===================================================================
   10. BADGES & TAGS
   =================================================================== */

.badge-modern {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--transition-base);
}

.badge-new {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
  animation: pulse-badge 2s ease infinite;
}

.badge-sale {
  background: linear-gradient(135deg, #ff4757, #ff3838);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
}

.badge-bestseller {
  background: linear-gradient(135deg, #ffd93d, #ff8c42);
  color: var(--gray-900);
  box-shadow: 0 4px 12px rgba(255, 217, 61, 0.3);
}

.badge-stock {
  background: var(--gradient-success);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3); }
  50% { transform: scale(1.05); box-shadow: 0 8px 20px rgba(255, 107, 107, 0.5); }
}

/* ===================================================================
   11. FORM INPUTS
   =================================================================== */

.form-control, .form-select {
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all var(--transition-base);
  background-color: var(--white);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  outline: none;
  transform: translateY(-1px);
}

.form-control::placeholder {
  color: var(--gray-400);
}

.form-label {
  font-family: var(--font-primary);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
  display: block;
}

/* ===================================================================
   12. NAVIGATION ENHANCEMENTS
   =================================================================== */

.navbar {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.navbar-scrolled {
  box-shadow: var(--shadow-lg);
  background: rgba(255, 255, 255, 0.95);
}

.nav-link {
  font-family: var(--font-primary);
  font-weight: 600;
  color: var(--gray-700);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transform: translateX(-50%);
  transition: width var(--transition-base);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

.nav-link:hover {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

/* ===================================================================
   13. MODAL & OVERLAY ENHANCEMENTS
   =================================================================== */

.modal-content {
  border-radius: var(--radius-2xl);
  border: none;
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
}

.modal-header {
  background: var(--gradient-primary);
  border-bottom: none;
  padding: 1.5rem;
}

.modal-title {
  font-family: var(--font-primary);
  font-weight: 700;
  color: var(--white);
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  border-top: 1px solid var(--gray-200);
  padding: 1.5rem;
}

/* ===================================================================
   14. UTILITY CLASSES
   =================================================================== */

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-2xl { box-shadow: var(--shadow-2xl); }
.shadow-glow { box-shadow: var(--shadow-glow); }

/* Border Radius */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Transitions */
.transition { transition: all var(--transition-base); }
.transition-fast { transition: all var(--transition-fast); }
.transition-slow { transition: all var(--transition-slow); }

/* ===================================================================
   15. RESPONSIVE UTILITIES
   =================================================================== */

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  
  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
  
  .glass-card:hover {
    transform: translateY(-4px) scale(1);
  }
  
  .card-product:hover {
    transform: translateY(-8px) scale(1);
  }
}

/* ===================================================================
   16. ACCESSIBILITY
   =================================================================== */

/* Focus Visible Styles */
*:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}