/**
 * FoodIQ Design System
 * Version: 1.0.0
 * Date: December 16, 2025
 *
 * This file contains all design tokens (CSS variables) for the FoodIQ application.
 * Based on Corporate Identity Guidelines (CGP).
 *
 * USAGE:
 * Always use CSS variables instead of hardcoded values:
 * ✅ Good: color: var(--color-primary);
 * ❌ Bad:  color: #3a9544;
 *
 * Include this file in the <head> of every page BEFORE other CSS files.
 */

/* ============================================
   ROOT VARIABLES
   ============================================ */

:root {
    /* ========================================
       TYPOGRAPHY - Inter Font Family (CGP)
       ======================================== */

    /* Font Families */
    --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    --font-family-tight: 'Inter Tight', 'Inter', sans-serif;

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

    /* Font Sizes - Desktop (CGP Specifications) */
    --font-size-main-title: 65px;        /* Main title - 65px / 48pt */
    --font-size-h1: 40px;                /* Heading 1 - 40px / 30pt */
    --font-size-h2: 26px;                /* Heading 2 - 26px / 20pt */
    --font-size-h3: 22px;                /* Heading 3 - 22px / 16pt */
    --font-size-large: 22px;             /* Large body - 22px / 16pt */
    --font-size-body: 16px;              /* Body text - 16px / 12pt */
    --font-size-small: 13.5px;           /* Small text - 13.5px / 10pt */
    --font-size-button: 22px;            /* Button text - 22px / 16pt */

    /* Line Heights (responsive to font size) */
    --line-height-tight: 1.2;            /* Headings */
    --line-height-normal: 1.5;           /* Body text */
    --line-height-relaxed: 1.6;          /* Large paragraphs */

    /* ========================================
       COLORS - Brand Colors (CGP)
       ======================================== */

    /* Primary Brand Colors */
    --color-primary: #3a9544;            /* Forcap Green (CGP) */
    --color-accent: #6bb945;             /* Accent Green (CGP) */
    --color-black: #0f0f0f;              /* Black (CGP) */
    --color-white: #ffffff;              /* Pure White */
    --color-white-darker: #F4F5F7;       /* Darker White (CGP) */

    /* Semantic Colors - Success */
    --color-success: var(--color-primary);         /* Use primary green */
    --color-success-light: #e8f5e9;                /* Light green background */
    --color-success-dark: #2e7d32;                 /* Dark green for emphasis */

    /* Semantic Colors - Danger/Error */
    --color-danger: #ef4444;             /* Red for destructive actions */
    --color-danger-light: #fee2e2;       /* Light red background */
    --color-danger-dark: #dc2626;        /* Dark red for emphasis */

    /* Semantic Colors - Warning */
    --color-warning: #f59e0b;            /* Amber/Orange for cautions */
    --color-warning-light: #fef3c7;      /* Light amber background */
    --color-warning-dark: #d97706;       /* Dark amber for emphasis */

    /* Semantic Colors - Info */
    --color-info: #3b82f6;               /* Blue for information */
    --color-info-light: #dbeafe;         /* Light blue background */
    --color-info-dark: #2563eb;          /* Dark blue for emphasis */

    /* Meal Type Colors - Unified System (from e-jedilnik) */
    --color-meal-malica: #F59E0B;               /* Malica - Amber/Orange */
    --color-meal-malica-light: rgba(245, 158, 11, 0.15);  /* Light amber background */
    --color-meal-malica-dark: #92400e;          /* Dark amber text */

    --color-meal-kosilo: #EF4444;               /* Kosilo - Red */
    --color-meal-kosilo-light: rgba(239, 68, 68, 0.15);   /* Light red background */
    --color-meal-kosilo-dark: #991b1b;          /* Dark red text */

    --color-meal-popoldanska: #8B5CF6;          /* Popoldanska malica - Purple */
    --color-meal-popoldanska-light: rgba(139, 92, 246, 0.15); /* Light purple background */
    --color-meal-popoldanska-dark: #5b21b6;     /* Dark purple text */

    --color-meal-zajtrk: #FF8C00;               /* Zajtrk - Dark orange */
    --color-meal-zajtrk-light: #FFE5CC;         /* Light orange background */
    --color-meal-zajtrk-dark: #CC7000;          /* Darker orange text */

    --color-meal-vecerja: #6A5ACD;              /* Večerja - Slate blue */
    --color-meal-vecerja-light: #E6E6FA;        /* Light lavender background */
    --color-meal-vecerja-dark: #4B0082;         /* Dark purple text */

    /* Neutral Colors - Grays (Unified System) */
    --color-gray-50: #fafafa;            /* Lightest gray - backgrounds */
    --color-gray-100: #f5f5f5;           /* Very light gray - hover states */
    --color-gray-200: #e5e5e5;           /* Light gray - borders */
    --color-gray-300: #d4d4d4;           /* Medium-light gray - dividers */
    --color-gray-400: #a3a3a3;           /* Medium gray - disabled text */
    --color-gray-500: #737373;           /* Medium-dark gray - secondary text */
    --color-gray-600: #525252;           /* Dark gray - body text */
    --color-gray-700: #404040;           /* Darker gray - headings */
    --color-gray-800: #262626;           /* Very dark gray - emphasis */
    --color-gray-900: #171717;           /* Almost black */

    /* Text Colors */
    --color-text-primary: var(--color-black);      /* Primary text - CGP black */
    --color-text-secondary: var(--color-gray-600); /* Secondary text */
    --color-text-muted: var(--color-gray-500);     /* Muted text */
    --color-text-disabled: var(--color-gray-400);  /* Disabled text */
    --color-text-inverse: var(--color-white);      /* Text on dark backgrounds */

    /* Background Colors */
    --color-bg-primary: var(--color-white);        /* Primary background */
    --color-bg-secondary: var(--color-white-darker); /* Secondary background - CGP */
    --color-bg-tertiary: var(--color-gray-50);     /* Tertiary background */
    --color-bg-hover: var(--color-gray-100);       /* Hover state background */

    /* Border Colors */
    --color-border-light: var(--color-gray-200);   /* Light borders */
    --color-border-medium: var(--color-gray-300);  /* Medium borders */
    --color-border-dark: var(--color-gray-400);    /* Dark borders */
    --color-border-focus: var(--color-primary);    /* Focus state borders */

    /* ========================================
       SPACING SYSTEM - 8px Base Grid
       ======================================== */

    --spacing-1: 4px;      /* 0.25rem - Micro spacing */
    --spacing-2: 8px;      /* 0.5rem - Tiny spacing */
    --spacing-3: 12px;     /* 0.75rem - Small spacing */
    --spacing-4: 16px;     /* 1rem - Base spacing */
    --spacing-5: 20px;     /* 1.25rem - Medium spacing */
    --spacing-6: 24px;     /* 1.5rem - Large spacing */
    --spacing-8: 32px;     /* 2rem - XL spacing */
    --spacing-10: 40px;    /* 2.5rem - XXL spacing */
    --spacing-12: 48px;    /* 3rem - XXXL spacing */
    --spacing-16: 64px;    /* 4rem - Huge spacing */
    --spacing-20: 80px;    /* 5rem - Massive spacing */

    /* ========================================
       BORDER RADIUS SYSTEM
       ======================================== */

    --radius-sm: 4px;      /* Small radius - inputs, tags */
    --radius-md: 8px;      /* Medium radius - buttons, cards */
    --radius-lg: 12px;     /* Large radius - modals */
    --radius-xl: 16px;     /* Extra large radius - feature cards */
    --radius-2xl: 20px;    /* 2XL radius - special elements */
    --radius-3xl: 24px;    /* 3XL radius - hero sections */
    --radius-full: 9999px; /* Full radius - pills, avatars */

    /* ========================================
       SHADOWS - Elevation System
       ======================================== */

    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Focus Shadow */
    --shadow-focus: 0 0 0 3px rgba(58, 149, 68, 0.2); /* Primary green with transparency */

    /* ========================================
       Z-INDEX SCALE - Layering System
       ======================================== */

    --z-base: 1;           /* Base level */
    --z-dropdown: 1000;    /* Dropdowns, tooltips */
    --z-sticky: 1020;      /* Sticky headers */
    --z-fixed: 1030;       /* Fixed elements */
    --z-modal-backdrop: 1040; /* Modal backdrops */
    --z-modal: 1050;       /* Modals (content modals) */
    --z-popover: 1060;     /* Popovers */
    --z-toast: 1070;       /* Toast notifications */
    --z-system-modal: 99999; /* System modals (warning, success) - always on top */

    /* ========================================
       TRANSITIONS - Animation Timing
       ======================================== */

    --transition-fast: 150ms;          /* Fast transitions - hover states */
    --transition-base: 200ms;          /* Base transitions - most interactions */
    --transition-slow: 300ms;          /* Slow transitions - complex animations */
    --transition-slower: 500ms;        /* Slower transitions - page transitions */

    /* Easing Functions */
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* ========================================
       CONTAINER SIZES - Max Widths
       ======================================== */

    --container-xs: 320px;    /* Extra small - mobile */
    --container-sm: 640px;    /* Small - mobile landscape */
    --container-md: 768px;    /* Medium - tablet */
    --container-lg: 1024px;   /* Large - desktop */
    --container-xl: 1280px;   /* Extra large - wide desktop */
    --container-2xl: 1536px;  /* 2XL - ultra wide */

    /* ========================================
       BREAKPOINTS - Responsive Design
       ======================================== */

    /* NOTE: Breakpoints cannot be used directly in CSS variables,
       but are documented here for reference in media queries */

    /*
    @media (max-width: 640px)  - Mobile
    @media (max-width: 768px)  - Tablet
    @media (max-width: 1024px) - Desktop
    @media (max-width: 1280px) - Large Desktop
    */
}

/* ============================================
   MOBILE TYPOGRAPHY (CGP Responsive Sizes)
   ============================================ */

@media (max-width: 768px) {
    :root {
        --font-size-main-title: 40px;    /* Mobile: 40px */
        --font-size-h1: 26px;            /* Mobile: 26px */
        --font-size-h2: 22px;            /* Mobile: 22px */
        --font-size-h3: 20px;            /* Mobile: 20px */
        --font-size-large: 16px;         /* Mobile: 16px */
        --font-size-body: 14px;          /* Mobile: 14px */
        --font-size-small: 11px;         /* Mobile: 11px */
        --font-size-button: 18px;        /* Mobile: 18px */
    }
}

/* ============================================
   UTILITY CLASSES - Typography
   ============================================ */

.text-main-title {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-main-title);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
}

.text-h1 {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-h1);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
}

.text-h2 {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
}

.text-h3 {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
}

.text-large {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-large);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
}

.text-body {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
}

.text-small {
    font-family: var(--font-family-tight);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
}

/* ============================================
   UTILITY CLASSES - Colors
   ============================================ */

.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-info { color: var(--color-info); }
.text-muted { color: var(--color-text-muted); }

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

/* ============================================
   BASE STYLES - Apply to All Elements
   ============================================ */

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-secondary);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, .h1 {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-h1);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin: 0 0 var(--spacing-4) 0;
}

h2, .h2 {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin: 0 0 var(--spacing-4) 0;
}

h3, .h3 {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin: 0 0 var(--spacing-3) 0;
}

/* Paragraphs */
p {
    margin: 0 0 var(--spacing-4) 0;
}

/* Links */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast) var(--ease-out);
}

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

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

/* ============================================
   DESIGN SYSTEM NOTES
   ============================================

   This design system is based on the FoodIQ Corporate Identity Guidelines (CGP).

   KEY PRINCIPLES:
   1. Always use CSS variables instead of hardcoded values
   2. Follow the 8px spacing grid
   3. Use semantic color names (success, danger) not color names (green, red)
   4. Mobile-first responsive design
   5. Maintain accessibility (focus states, contrast ratios)

   MIGRATION GUIDE:
   - Replace #3a9544 → var(--color-primary)
   - Replace #6bb945 → var(--color-accent)
   - Replace #0f0f0f → var(--color-black)
   - Replace hardcoded font sizes → var(--font-size-*)
   - Replace hardcoded spacing → var(--spacing-*)
   - Replace hardcoded border-radius → var(--radius-*)

   ============================================ */
