/**
 * TheTrueTomato AI Concierge - Design System
 * Mobile-First, Modern, Latest-Generation CSS
 */

:root {
  /* ============================================
     COLOR PALETTE - Derived from Natural Ingredients
     ============================================ */
  
  /* Tomato Reds - Primary Brand Colors */
  --tomato-red-primary: #C1292E;
  --tomato-red-dark: #8A1C1F;
  --tomato-red-light: #E85D5D;
  --tomato-red-subtle: #FFF5F5;
  
  /* Spice Tones - Warm Accents */
  --spice-warm: #D4A574;
  --spice-deep: #8B4513;
  --spice-gold: #F4C430;
  
  /* Himalayan Pink - Soft Accents */
  --himalayan-pink: #E8B4B8;
  
  /* Fresh Green - Freshness Indicators */
  --fresh-green: #7CB342;
  --success-green: #22C55E;
  
  /* Neutrals */
  --natural-cream: #F5F2F0;
  --text-primary: #1A1A1A;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --border-color: #E5E5E5;
  
  /* ============================================
     GRADIENTS
     ============================================ */
  
  --gradient-hero: linear-gradient(135deg, #C1292E 0%, #8A1C1F 100%);
  --gradient-card: linear-gradient(180deg, #FFFFFF 0%, #FFF5F5 100%);
  --gradient-spice: linear-gradient(90deg, #D4A574 0%, #F4C430 100%);
  --gradient-depth: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.05) 100%);
  
  /* Gradient Mesh Backgrounds */
  --gradient-mesh-default: 
    radial-gradient(at 20% 30%, rgba(193, 41, 46, 0.15) 0px, transparent 50%),
    radial-gradient(at 80% 70%, rgba(212, 165, 116, 0.15) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(232, 180, 184, 0.1) 0px, transparent 50%);
  
  /* ============================================
     TYPOGRAPHY - Fluid & Responsive
     ============================================ */
  
  /* Font Families */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  
  /* Fluid Type Scale using clamp() */
  --text-xs: clamp(0.69rem, 0.66rem + 0.13vw, 0.75rem);      /* 11px - 12px */
  --text-sm: clamp(0.81rem, 0.77rem + 0.22vw, 0.94rem);      /* 13px - 15px */
  --text-base: clamp(1rem, 0.96rem + 0.22vw, 1.13rem);       /* 16px - 18px */
  --text-lg: clamp(1.13rem, 1.06rem + 0.33vw, 1.31rem);      /* 18px - 21px */
  --text-xl: clamp(1.31rem, 1.2rem + 0.54vw, 1.63rem);       /* 21px - 26px */
  --text-2xl: clamp(1.5rem, 1.33rem + 0.87vw, 2rem);         /* 24px - 32px */
  --text-3xl: clamp(2rem, 1.61rem + 1.96vw, 3.16rem);        /* 32px - 50px */
  
  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;
  
  /* Line Heights */
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.6;
  --leading-loose: 1.8;
  
  /* ============================================
     SPACING SYSTEM
     ============================================ */
  
  --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.5rem;    /* 8px */
  --radius-md: 1rem;      /* 16px */
  --radius-lg: 1.5rem;    /* 24px */
  --radius-xl: 2rem;      /* 32px */
  --radius-full: 9999px;  /* Pill shape */
  
  /* ============================================
     SHADOWS & DEPTH
     ============================================ */
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.20);
  
  /* Brand-Colored Shadows */
  --shadow-tomato: 0 8px 24px rgba(193, 41, 46, 0.3);
  --shadow-spice: 0 4px 16px rgba(212, 165, 116, 0.2);
  
  /* ============================================
     ANIMATION TIMING
     ============================================ */
  
  --duration-fast: 0.2s;
  --duration-normal: 0.4s;
  --duration-slow: 0.6s;
  --duration-slower: 1s;
  
  /* Easing Functions */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in-out: ease-in-out;
  --ease-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* ============================================
     Z-INDEX SCALE
     ============================================ */
  
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 900;
  --z-modal: 1000;
  --z-toast: 1100;
}

/* ============================================
   GLOBAL RESETS & BASE STYLES
   ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--natural-cream);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   TYPOGRAPHY UTILITIES
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-md);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

p {
  margin-bottom: var(--space-md);
}

a {
  color: var(--tomato-red-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

a:hover {
  color: var(--tomato-red-dark);
}

/* ============================================
   MOBILE-FIRST TOUCH OPTIMIZATIONS
   ============================================ */

/* Remove tap highlight on mobile */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* Ensure touch targets are minimum 48x48px */
button,
a,
input,
select,
textarea,
[role="button"],
[tabindex="0"] {
  min-height: 48px;
  min-width: 48px;
  touch-action: manipulation;
}

/* Smooth momentum scrolling on iOS */
.scroll-container {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ============================================
   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);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flex Utilities */
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Font Weights */
.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

/* Colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tomato { color: var(--tomato-red-primary); }
.text-green { color: var(--fresh-green); }

.bg-tomato { background-color: var(--tomato-red-primary); }
.bg-cream { background-color: var(--natural-cream); }
.bg-white { background-color: #FFFFFF; }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-tomato { box-shadow: var(--shadow-tomato); }

/* Border Radius */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ============================================
   RESPONSIVE BREAKPOINTS (Mobile-First)
   ============================================ */

/* Small devices (landscape phones, 640px and up) */
@media (min-width: 640px) {
  :root {
    --container-padding: var(--space-lg);
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  :root {
    --container-padding: var(--space-xl);
  }
}

/* Large devices (desktops, 1024px and up) */
@media (min-width: 1024px) {
  :root {
    --container-padding: var(--space-2xl);
  }
}

/* Extra large devices (large desktops, 1280px and up) */
@media (min-width: 1280px) {
  :root {
    --container-padding: var(--space-3xl);
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--tomato-red-primary);
  outline-offset: 2px;
}

/* Reduced 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;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --text-primary: #000000;
    --text-secondary: #333333;
    --border-color: #000000;
  }
}
