/* NutriWave Design System */
/* Based on specification design tokens */

:root {
  /* Primary Health Colors */
  --health-primary: #22c55e;
  --health-light: #dcfce7;
  --health-success: #10b981;
  --health-warning: #f59e0b;
  --health-danger: #ef4444;

  /* Nutrition Tracking (Sugar as primary example) */
  --sugar-primary: #f59e0b;
  --sugar-light: #fef3c7;
  --sugar-dark: #d97706;

  /* Neutral Palette */
  --neutral-white: #ffffff;
  --neutral-50: #fafaf9;
  --neutral-100: #f5f5f4;
  --neutral-200: #e7e5e4;
  --neutral-300: #d6d3d1;
  --neutral-500: #78716c;
  --neutral-700: #44403c;
  --neutral-900: #1c1917;

  /* Text Colors */
  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --text-tertiary: #a8a29e;
  --text-inverse: #fafaf9;

  /* Background */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f4;

  /* Font System */
  --font-family-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  --font-family-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;

  /* Font Sizes */
  --font-xs: 0.75rem;    /* 12px */
  --font-sm: 0.875rem;   /* 14px */
  --font-base: 1rem;     /* 16px */
  --font-lg: 1.125rem;   /* 18px */
  --font-xl: 1.25rem;    /* 20px */
  --font-2xl: 1.5rem;    /* 24px */
  --font-3xl: 1.875rem;  /* 30px */
  --font-4xl: 2.25rem;   /* 36px */
  --font-5xl: 3rem;      /* 48px */
  --font-6xl: 3.75rem;   /* 60px */

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Spacing System (8px base) */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4rem;     /* 64px */

  /* Border Radius */
  --radius-sm: 0.25rem;  /* 4px */
  --radius-base: 0.5rem; /* 8px */
  --radius-md: 0.75rem;  /* 12px */
  --radius-lg: 1rem;     /* 16px */
  --radius-xl: 1.25rem;  /* 20px */
  --radius-2xl: 1.5rem;  /* 24px */
  --radius-full: 9999px;

  /* Card & Element Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-base: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px 0 rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 12px 0 rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  /* Layout */
  --container-max-width: 1200px;
  --container-padding: var(--space-lg);
  
  /* Breakpoints (for reference in media queries) */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-sans);
  font-size: var(--font-base);
  font-weight: var(--font-normal);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-display);
  font-weight: var(--font-bold);
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

h1 {
  font-size: var(--font-5xl);
}

h2 {
  font-size: var(--font-4xl);
}

h3 {
  font-size: var(--font-3xl);
}

h4 {
  font-size: var(--font-2xl);
}

h5 {
  font-size: var(--font-xl);
}

h6 {
  font-size: var(--font-lg);
}

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

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

a:hover {
  color: var(--health-success);
}

/* Layout Components */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section {
  padding: var(--space-3xl) 0;
}

.bg-secondary {
  background-color: var(--bg-secondary);
}

/* Floating Card System */
.floating-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* Hero Sections with Gradients */
.hero-section {
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(34, 197, 94, 0.08) 25%,
    rgba(16, 185, 129, 0.05) 75%,
    rgba(255, 255, 255, 0.9) 100%);
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0.1) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

/* Sticky Action Pattern */
.sticky-cta {
  position: fixed;
  bottom: var(--space-2xl);
  left: 50%;
  transform: translateX(-50%);
  background: var(--health-primary);
  border-radius: var(--radius-2xl);
  padding: var(--space-md) var(--space-xl);
  box-shadow: var(--shadow-xl);
  z-index: 50;
  display: none;
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) var(--space-xl);
  font-size: var(--font-base);
  font-weight: var(--font-semibold);
  text-decoration: none;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--health-primary);
  color: var(--neutral-white);
}

.btn-primary:hover {
  background-color: var(--health-success);
  color: var(--neutral-white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
  background-color: var(--health-primary);
  color: var(--neutral-white);
}

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

.btn-outline:hover {
  background-color: var(--neutral-100);
  border-color: var(--neutral-500);
  color: var(--text-primary);
}

.btn-large {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--font-lg);
}

.btn-full {
  width: 100%;
}

/* Text Utilities */
.text-gradient {
  background: linear-gradient(135deg, var(--health-primary), var(--health-success));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-center {
  text-align: center;
}

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

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

.text-tertiary {
  color: var(--text-tertiary);
}

/* Grid Systems */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Flexbox Utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

/* Spacing Utilities */
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --container-padding: var(--space-md);
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  h1 {
    font-size: var(--font-4xl);
  }
  
  h2 {
    font-size: var(--font-3xl);
  }
  
  .section {
    padding: var(--space-2xl) 0;
  }
  
  .hero-section {
    min-height: auto;
    padding: var(--space-3xl) 0;
  }
  
  .sticky-cta {
    display: block;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: var(--font-3xl);
  }
  
  h2 {
    font-size: var(--font-2xl);
  }
  
  .btn-large {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-base);
  }
}

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

/* Focus styles for keyboard navigation */
.btn:focus,
a:focus,
button:focus {
  outline: 2px solid var(--health-primary);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .floating-card {
    border: 2px solid var(--neutral-700);
  }
  
  .btn-outline {
    border-width: 3px;
  }
}

/* Print styles */
@media print {
  .sticky-cta,
  .hero-overlay {
    display: none;
  }
  
  .floating-card {
    box-shadow: none;
    border: 1px solid var(--neutral-300);
  }
}