/**
 * Design Tokens - Single Source of Truth
 * Zentrale Definition aller Design-Variablen 
 * Version: 2.0 - Konsolidierte und erweiterte Token
 */

/* Font Import */
@font-face {
    font-family: 'Avenir';
    src: local('Avenir');
    font-weight: 400;
}
@font-face {
    font-family: 'Avenir';
    src: local('Avenir');
    font-weight: 700;
}

:root {
  /* === PRIMARY COLORS === */
  --color-primary: #21588F;
  --color-primary-hover: #1A4773;
  --color-primary-light: #3A6BA3;
  --color-primary-dark: #0F2C45;
  
/* === SECONDARY COLORS === */
--color-secondary: #966489;
--color-secondary-hover: #7a536f;
--color-secondary-light: #b57aa5;
--color-secondary-dark: #5e3b59;

  
  /* === ACCENT COLORS === */
  --color-accent: #3d6911;
  --color-accent-hover: #2F5209;
  --color-accent-light: #4F7F15;
  --color-accent-dark: #1F3408;
  
  /* === SEMANTIC COLORS === */
  --color-success: #28a745;
  --color-warning: #ffc107;
  --color-error: #dc3545;
  --color-info: #17a2b8;
  
  /* === ERWEITERTE SEMANTISCHE FARBEN === */
  --color-dark-red: #8B2635;
  --color-orange: #CC7A00;
  --color-dark-green: #1e7e34;
  
  /* === HEADING COLORS === */
  --color-h1: #2F6592;
  --color-h2: #966489;
  --color-h3: var(--color-primary);
  
  /* === TEXT COLORS === */
  --color-text-primary: #111111;
  --color-text-secondary: #666666;
  --color-text-muted: #999999;
  --color-text-light: #cccccc;
  --color-text-white: #ffffff;
  
  /* === BACKGROUND COLORS === */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f8f9fa;
  --color-bg-tertiary: #e9ecef;
  --color-bg-dark: #343a40;
  
  /* === BORDER COLORS === */
  --color-border-light: #e9ecef;
  --color-border-medium: #dee2e6;
  --color-border-dark: #6c757d;
  --color-border: #d0d0d0; /* Legacy support */
  
  /* === FOCUS & INTERACTION === */
  --color-focus: var(--color-primary);
  --color-hover: var(--color-accent);
  
  /* === CARD & COMPONENT COLORS === */
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(47, 101, 146, 0.2);
  --btn-bg: rgba(255, 255, 255, 0.6);
  --btn-bg-hover: rgba(255, 255, 255, 0.7);
  
  /* === TYPOGRAPHY === */
  --font-family-base: 'Avenir', Montserrat, Corbel, 'URW Gothic', source-sans-pro, sans-serif;
  --font-family-headings: var(--font-family-base);
  --font-family-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  
  /* === FONT SIZES === */
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-md: 1rem;       /* 16px - base */
  --font-size-lg: 1.25rem;    /* 20px */
  --font-size-xl: 1.5rem;     /* 24px */
  --font-size-2xl: 1.875rem;  /* 30px */
  --font-size-3xl: 2.25rem;   /* 36px */
  
/* === RESPONSIVE HEADING SIZES (−30%) === */
--font-size-h1: clamp(1.75rem, 8vw, 2.8rem);
--font-size-h2: clamp(1.4rem, 6vw, 2.1rem);
--font-size-h3: clamp(1.05rem, 4vw, 1.575rem);
--font-size-h4: clamp(0.875rem, 3vw, 1.3125rem);
--font-size-h5: clamp(1rem, 2.5vw, 1.2rem);
--font-size-h6: clamp(0.7rem, 1.5vw, 0.875rem);
  
  /* === LINE HEIGHTS === */
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;
  
  /* === LEGACY LINE HEIGHTS === */
  --line-height-base: 1.8;
  --line-height-h1: 1.15;
  --line-height-h2: 1.2;
  
  /* === SPACING SCALE === */
  --space-0: 0;
  --space-px: 1px;
  --space-0_5: 0.125rem;  /* 2px */
  --space-1: 0.25rem;     /* 4px */
  --space-1_5: 0.375rem;  /* 6px */
  --space-2: 0.5rem;      /* 8px */
  --space-2_5: 0.625rem;  /* 10px */
  --space-3: 0.75rem;     /* 12px */
  --space-3_5: 0.875rem;  /* 14px */
  --space-4: 1rem;        /* 16px */
  --space-5: 1.25rem;     /* 20px */
  --space-6: 1.5rem;      /* 24px */
  --space-7: 1.75rem;     /* 28px */
  --space-8: 2rem;        /* 32px */
  --space-9: 2.25rem;     /* 36px */
  --space-10: 2.5rem;     /* 40px */
  --space-12: 3rem;       /* 48px */
  --space-14: 3.5rem;     /* 56px */
  --space-16: 4rem;       /* 64px */
  --space-20: 5rem;       /* 80px */
  --space-24: 6rem;       /* 96px */
  --space-32: 8rem;       /* 128px */
  --space-40: 10rem;      /* 160px */
  --space-48: 12rem;      /* 192px */
  --space-56: 14rem;      /* 224px */
  --space-64: 16rem;      /* 256px */
  
  /* === LEGACY SPACING === */
  --space-xxs: var(--space-1);
  --space-xs: var(--space-2);
  --space-sm: var(--space-4);
  --space-md: var(--space-6);
  --space-lg: var(--space-8);
  --space-xl: var(--space-12);
  --space-xxl: var(--space-16);
  
  /* === BORDER RADIUS === */
  --radius-none: 0;
  --radius-sm: 0.125rem;   /* 2px */
  --radius-md: 0.375rem;   /* 6px */
  --radius-lg: 0.5rem;     /* 8px */
  --radius-xl: 0.75rem;    /* 12px */
  --radius-2xl: 1rem;      /* 16px */
  --radius-3xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;
  
  /* === SHADOWS === */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
  --shadow-none: 0 0 #0000;
  
  /* === TRANSITIONS === */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
  
  /* === Z-INDEX LAYERS === */
  --z-index-dropdown: 1000;
  --z-index-sticky: 1020;
  --z-index-fixed: 1030;
  --z-index-modal-backdrop: 1040;
  --z-index-modal: 1050;
  --z-index-popover: 1060;
  --z-index-tooltip: 1070;
  
  /* === BREAKPOINTS (für @container queries) === */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
}

/* === DARK MODE SUPPORT === */
/* Automatic dark mode (system preference) */
@media (prefers-color-scheme: dark) {
  :root {
    /* Dark mode background colors */
    --color-bg-primary: #1a1a1a;
    --color-bg-secondary: #2d2d2d;
    --color-bg-tertiary: #404040;
    
    /* Improved text colors for better contrast */
    --color-text-primary: #f5f5f5;      /* Erhöht von #ffffff für weniger Blendung */
    --color-text-secondary: #d4d4d4;    /* Erhöht von #cccccc - WCAG AA konform */
    --color-text-muted: #a8a8a8;        /* Erhöht von #999999 - WCAG AA konform */
    
    /* Heading colors - angepasst für Dark Mode */
    --color-h1: #7fa8d1;                /* Helleres Blau statt #2F6592 */
    --color-h2: #c794bb;                /* Helleres Lila statt #966489 */
    --color-h3: #6b9bd3;                /* Helleres Primary-Blau */
    
    /* Primary colors - WCAG 3 konform für besseren Kontrast */
    --color-primary: #4a7ba7;           /* WCAG 3 konform: 4.8:1 auf #ffffff */
    --color-primary-hover: #5a8bb7;
    --color-primary-light: #6b9bd3;
    
    /* Secondary colors - aufgehellt */
    --color-secondary: #c794bb;         /* Aufgehellt von #966489 */
    --color-secondary-hover: #d4a9cc;
    --color-secondary-light: #e0c0d9;
    
    /* Accent colors - aufgehellt */
    --color-accent: #7db33f;            /* Aufgehellt von #3d6911 */
    --color-accent-hover: #94c456;
    
    /* Border colors */
    --color-border-light: #404040;
    --color-border-medium: #555555;
    --color-border-dark: #666666;
    
    /* Card and component backgrounds */
    --card-bg: rgba(45, 45, 45, 0.9);
    --card-border: rgba(255, 255, 255, 0.1);
    --btn-bg: rgba(255, 255, 255, 0.1);
    --btn-bg-hover: rgba(255, 255, 255, 0.2);
  }
}

/* === MANUAL DARK MODE OVERRIDE === */
/* Override automatic detection when user manually selects dark mode */
[data-theme="dark"] {
  /* Dark mode background colors */
  --color-bg-primary: #1a1a1a;
  --color-bg-secondary: #2d2d2d;
  --color-bg-tertiary: #404040;
  
  /* Improved text colors for better contrast */
  --color-text-primary: #f5f5f5;      /* Erhöht von #ffffff für weniger Blendung */
  --color-text-secondary: #d4d4d4;    /* Erhöht von #cccccc - WCAG AA konform */
  --color-text-muted: #a8a8a8;        /* Erhöht von #999999 - WCAG AA konform */
  
  /* Heading colors - angepasst für Dark Mode */
  --color-h1: #7fa8d1;                /* Helleres Blau statt #2F6592 */
  --color-h2: #c794bb;                /* Helleres Lila statt #966489 */
  --color-h3: #6b9bd3;                /* Helleres Primary-Blau */
  
  /* Primary colors - WCAG 3 konform für besseren Kontrast */
  --color-primary: #4a7ba7;           /* WCAG 3 konform: 4.8:1 auf #ffffff */
  --color-primary-hover: #5a8bb7;
  --color-primary-light: #6b9bd3;
  
  /* Secondary colors - aufgehellt */
  --color-secondary: #c794bb;         /* Aufgehellt von #966489 */
  --color-secondary-hover: #d4a9cc;
  --color-secondary-light: #e0c0d9;
  
  /* Accent colors - aufgehellt */
  --color-accent: #7db33f;            /* Aufgehellt von #3d6911 */
  --color-accent-hover: #94c456;
  
  /* Border colors */
  --color-border-light: #404040;
  --color-border-medium: #555555;
  --color-border-dark: #666666;
  
  /* Card and component backgrounds */
  --card-bg: rgba(45, 45, 45, 0.9);
  --card-border: rgba(255, 255, 255, 0.1);
  --btn-bg: rgba(255, 255, 255, 0.1);
  --btn-bg-hover: rgba(255, 255, 255, 0.2);
}

/* === MANUAL LIGHT MODE OVERRIDE === */
/* Ensure light mode when user manually selects it (even if system prefers dark) */
[data-theme="light"] {
  /* Override any dark mode styles back to light */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f8f9fa;
  --color-bg-tertiary: #e9ecef;
  
  /* Light mode text colors */
  --color-text-primary: #111111;
  --color-text-secondary: #666666;
  --color-text-muted: #999999;
  --color-text-light: #cccccc;
  --color-text-white: #ffffff;
  
  /* Original heading colors */
  --color-h1: #2F6592;
  --color-h2: #966489;
  --color-h3: var(--color-primary);
  
  /* Original primary colors */
  --color-primary: #21588F;
  --color-primary-hover: #1A4773;
  --color-primary-light: #3A6BA3;
  
  /* Original secondary colors */
  --color-secondary: #966489;
  --color-secondary-hover: #7a536f;
  --color-secondary-light: #b57aa5;
  
  /* Original accent colors */
  --color-accent: #3d6911;
  --color-accent-hover: #2F5209;
  
  /* Light mode borders */
  --color-border-light: #e9ecef;
  --color-border-medium: #dee2e6;
  --color-border-dark: #6c757d;
  
  /* Light mode card backgrounds */
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(47, 101, 146, 0.2);
  --btn-bg: rgba(255, 255, 255, 0.6);
  --btn-bg-hover: rgba(255, 255, 255, 0.7);
}

/* === UTILITY CLASSES === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--breakpoint-xl);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}