/* ========================================
   FLVR FOOD - CSS Variables & Theme System
   Vision Pro Liquid Glass Design
   ======================================== */

/* Import Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ========================================
   Root Variables - Light Mode (Default)
   ======================================== */
:root {
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* Light Mode Colors */
  --flvr-bg: #f8f9fa;
  --flvr-bg-secondary: #ffffff;
  --flvr-bg-tertiary: #f1f3f4;
  
  --flvr-text-primary: #1a1a2e;
  --flvr-text-secondary: #4a4a68;
  --flvr-text-tertiary: #6b6b8a;
  --flvr-text-muted: #8b8ba7;
  
  /* Glass Effects - Light Mode */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-bg-hover: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-border-strong: rgba(255, 255, 255, 0.8);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --glass-shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.12);
  
  /* Accent Colors */
  --flvr-accent: #ff6b35;
  --flvr-accent-light: #ff8c5a;
  --flvr-accent-dark: #e55a2b;
  --flvr-accent-glow: rgba(255, 107, 53, 0.3);
  
  --flvr-secondary: #2d3436;
  --flvr-success: #00b894;
  --flvr-warning: #fdcb6e;
  --flvr-error: #ff7675;
  
  /* Category Colors */
  --color-lamb: #e17055;
  --color-chicken: #fdcb6e;
  --color-beef: #d63031;
  --color-seafood: #0984e3;
  --color-vegetarian: #00b894;
  --color-snacks: #e84393;
  --color-desserts: #a29bfe;
  --color-soups: #74b9ff;
  --color-sides: #55efc4;
  --color-platters: #ff7675;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-3xl: 2rem;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  --transition-bounce: 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Z-index Scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal: 400;
  --z-popover: 500;
  --z-toast: 600;
  
  /* Layout */
  --nav-height: 80px;
  --nav-height-mobile: 70px;
  --max-width: 1400px;
  --content-padding: 1.5rem;
  --content-padding-mobile: 1rem;
}

/* ========================================
   Dark Mode Variables
   ======================================== */
[data-theme="dark"] {
  --flvr-bg: #0a0a0f;
  --flvr-bg-secondary: #12121a;
  --flvr-bg-tertiary: #1a1a25;
  
  --flvr-text-primary: #ffffff;
  --flvr-text-secondary: rgba(255, 255, 255, 0.8);
  --flvr-text-tertiary: rgba(255, 255, 255, 0.6);
  --flvr-text-muted: rgba(255, 255, 255, 0.4);
  
  /* Glass Effects - Dark Mode */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-hover: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-strong: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --glass-shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.5);
}

/* System Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --flvr-bg: #0a0a0f;
    --flvr-bg-secondary: #12121a;
    --flvr-bg-tertiary: #1a1a25;
    
    --flvr-text-primary: #ffffff;
    --flvr-text-secondary: rgba(255, 255, 255, 0.8);
    --flvr-text-tertiary: rgba(255, 255, 255, 0.6);
    --flvr-text-muted: rgba(255, 255, 255, 0.4);
    
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-bg-hover: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-border-strong: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --glass-shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.5);
  }
}

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

html {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-y: scroll;
  height: auto !important;
}

body {
  background-color: var(--flvr-bg);
  color: var(--flvr-text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  transition: background-color var(--transition-base), color var(--transition-base);
}

ion-app {
  display: block;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

/* Override Ionic scroll restrictions */
body.ion-app {
  overflow: visible !important;
  position: static !important;
}

html.ion-theme {
  overflow-x: hidden;
  overflow-y: scroll;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--flvr-text-primary);
}

h1 {
  font-size: var(--font-size-4xl);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--font-size-3xl);
  letter-spacing: -0.01em;
}

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

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

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

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

p {
  color: var(--flvr-text-secondary);
  line-height: var(--line-height-relaxed);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--flvr-accent);
}

/* Responsive Typography */
@media (max-width: 768px) {
  :root {
    --font-size-4xl: 1.875rem;
    --font-size-3xl: 1.5rem;
    --font-size-2xl: 1.25rem;
  }
  
  h1 {
    font-size: var(--font-size-3xl);
  }
  
  h2 {
    font-size: var(--font-size-2xl);
  }
}

/* ========================================
   Selection
   ======================================== */
::selection {
  background-color: var(--flvr-accent-glow);
  color: var(--flvr-text-primary);
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--flvr-bg-tertiary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: var(--flvr-text-muted);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--flvr-text-secondary);
}

/* ========================================
   Focus States (Accessibility)
   ======================================== */
:focus-visible {
  outline: 2px solid var(--flvr-accent);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--flvr-accent);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

/* ========================================
   Reduced Motion
   ======================================== */
@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;
  }
}
