/* ======================================================
   KVALITETSBILER DESIGN SYSTEM
   ======================================================
   A comprehensive design system based on the modern 
   TradeIn interface design language
   ====================================================== */

/* ======================================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ====================================================== */

:root {
    /* === COLORS === */
    /* Primary Brand Colors */
    --primary: #1a2b3c;
    --primary-dark: #152230;
    --primary-light: #10a9e1;
    --primary-muted: rgba(26, 43, 60, 0.6);
    
    /* Secondary Brand Colors */
    --orange: #f97316;
    --orange-light: #fb923c;
    --orange-dark: #ea580c;
    --green: #16a34a;
    --green-light: #22c55e;
    --green-dark: #15803d;
    --brown: #995942;
    
    /* Semantic Colors */
    --color-success: #16a34a;
    --color-warning: #f59e0b;
    --color-error: #dc2626;
    --color-info: #3b82f6;
    
    /* Neutral Colors */
    --color-text: #1f2937;
    --color-text-secondary: #6b7280;
    --color-text-muted: #9ca3af;
    --color-text-inverse: #ffffff;
    
    /* Background Colors */
    --color-bg: #f8fafc;
    --color-bg-secondary: #f1f5f9;
    --color-bg-elevated: #ffffff;
    --color-bg-overlay: rgba(0, 0, 0, 0.5);
    
    /* Border Colors */
    --color-border: #e2e8f0;
    --color-border-secondary: #cbd5e1;
    --color-border-focus: var(--primary-light);
    
    /* Shadow Colors */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 8px 10px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);
    
    /* === TYPOGRAPHY === */
    /* Font Families */
    --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    --font-family-mono: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono", "Courier New", monospace;
    
    /* Font Sizes */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    
    /* Font Weights */
    --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 Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;
    
    /* === SPACING === */
    --spacing-0: 0;
    --spacing-1: 0.25rem;    /* 4px */
    --spacing-2: 0.5rem;     /* 8px */
    --spacing-3: 0.75rem;    /* 12px */
    --spacing-4: 1rem;       /* 16px */
    --spacing-5: 1.25rem;    /* 20px */
    --spacing-6: 1.5rem;     /* 24px */
    --spacing-8: 2rem;       /* 32px */
    --spacing-10: 2.5rem;    /* 40px */
    --spacing-12: 3rem;      /* 48px */
    --spacing-16: 4rem;      /* 64px */
    --spacing-20: 5rem;      /* 80px */
    --spacing-24: 6rem;      /* 96px */
    --spacing-32: 8rem;      /* 128px */
    
    /* === SIZING === */
    /* Border Radius */
    --radius-none: 0;
    --radius-sm: 0.25rem;    /* 4px */
    --radius-base: 0.5rem;   /* 8px */
    --radius-md: 0.625rem;   /* 10px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-2xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;
    
    /* Container Sizes */
    --container-xs: 20rem;    /* 320px */
    --container-sm: 30rem;    /* 480px */
    --container-md: 48rem;    /* 768px */
    --container-lg: 64rem;    /* 1024px */
    --container-xl: 80rem;    /* 1280px */
    --container-2xl: 87.5rem; /* 1400px */
    
    /* === TRANSITIONS === */
    --transition-fast: 0.15s ease-out;
    --transition-base: 0.2s ease-out;
    --transition-slow: 0.3s ease-out;
    
    /* === Z-INDEX === */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 2000;
}

/* ======================================================
   MODERN TYPOGRAPHY SCALE
   ====================================================== */

/* Display Text (Large Headings) */
.text-display-2xl {
    font-size: var(--text-5xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--leading-none);
    letter-spacing: -0.025em;
}

.text-display-xl {
    font-size: var(--text-4xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--leading-tight);
    letter-spacing: -0.025em;
}

.text-display-lg {
    font-size: var(--text-3xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--leading-tight);
}

/* Headings */
.text-heading-xl {
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-semibold);
    line-height: var(--leading-tight);
}

.text-heading-lg {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-semibold);
    line-height: var(--leading-tight);
}

.text-heading-md {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-semibold);
    line-height: var(--leading-snug);
}

.text-heading-sm {
    font-size: var(--text-base);
    font-weight: var(--font-weight-semibold);
    line-height: var(--leading-snug);
}

/* Body Text */
.text-body-lg {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-normal);
    line-height: var(--leading-relaxed);
}

.text-body-base {
    font-size: var(--text-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--leading-normal);
}

.text-body-sm {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-normal);
    line-height: var(--leading-normal);
}

/* Small Text */
.text-small {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-normal);
    line-height: var(--leading-snug);
}

.text-caption {
    font-size: var(--text-xs);
    font-weight: var(--font-weight-normal);
    line-height: var(--leading-normal);
}

/* Text Colors */
.text-primary { color: var(--primary); }
.text-primary-light { color: var(--primary-light); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }
.text-info { color: var(--color-info); }
.text-white { color: var(--color-text-inverse); }

/* Font Weights */
.font-light { font-weight: var(--font-weight-light); }
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }
.font-extrabold { font-weight: var(--font-weight-extrabold); }

/* ======================================================
   LAYOUT UTILITIES
   ====================================================== */

/* Container */
.container {
    max-width: var(--container-2xl);
    margin: 0 auto;
    padding-left: var(--spacing-4);
    padding-right: var(--spacing-4);
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }
.container-xl { max-width: var(--container-xl); }

/* Modern Layout Classes */
.page-container {
    max-width: var(--container-2xl);
    padding: 0;
}

.content-wrapper {
    padding: var(--spacing-8) var(--spacing-6);
}

.page-header {
    max-width: 1400px;
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: var(--spacing-6) var(--spacing-4);
    }
}

/* ======================================================
   ACCESSIBILITY & INTERACTION STATES
   ====================================================== */

/* Focus Styles */
.focus-ring {
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: box-shadow var(--transition-fast);
}

.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 169, 225, 0.1);
    border-color: var(--color-border-focus);
}

/* Disabled State */
.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Loading State */
.loading {
    opacity: 0.8;
    pointer-events: none;
}

/* ======================================================
   RESPONSIVE BREAKPOINTS
   ====================================================== */

/* Mobile First Approach */
@media (min-width: 640px) {  /* sm */
    .container {
        padding-left: var(--spacing-6);
        padding-right: var(--spacing-6);
    }
}

@media (min-width: 768px) {  /* md */
    .container {
        padding-left: var(--spacing-8);
        padding-right: var(--spacing-8);
    }
}

@media (min-width: 1024px) { /* lg */
    .container {
        padding-left: var(--spacing-8);
        padding-right: var(--spacing-8);
    }
}

@media (min-width: 1280px) { /* xl */
    .container {
        padding-left: var(--spacing-8);
        padding-right: var(--spacing-8);
    }
}

/* ======================================================
   ANIMATION UTILITIES
   ====================================================== */

.transition-fast { transition: all var(--transition-fast); }
.transition-base { transition: all var(--transition-base); }
.transition-slow { transition: all var(--transition-slow); }

/* Common transform utilities */
.transform { transform: translateZ(0); } /* Enable hardware acceleration */
.hover-lift:hover { transform: translateY(-2px); }
.hover-scale:hover { transform: scale(1.02); }

/* ======================================================
   PRINT STYLES
   ====================================================== */

@media print {
    :root {
        --color-bg: white;
        --color-bg-secondary: white;
        --color-bg-elevated: white;
        --shadow-xs: none;
        --shadow-sm: none;
        --shadow-md: none;
        --shadow-lg: none;
        --shadow-xl: none;
        --shadow-2xl: none;
    }
    
    .no-print { display: none !important; }
    .print-only { display: block !important; }
}
