/* ================================================
   SENTINELA - Design System Unificado v2.0
   Sistema de IA para Predicao de Surtos Epidemiologicos
   Atualizado: 2026-01-10
   ================================================ */

:root {
  /* PALETA DE CORES INSTITUCIONAL */
  --color-primary: #1351B4;
  --color-primary-light: #2670E8;
  --color-primary-dark: #0C326F;
  --color-primary-50: #E8F0FE;
  --color-primary-foreground: #FFFFFF;

  --color-secondary: #168821;
  --color-secondary-light: #2BA53C;
  --color-secondary-dark: #0E5A15;
  --color-secondary-50: #E7F5E9;
  --color-secondary-foreground: #FFFFFF;

  /* Cores de Alerta */
  --color-alert-critical: #E52207;
  --color-alert-critical-light: #FEE2E2;
  --color-alert-high: #E86100;
  --color-alert-high-light: #FFEDD5;
  --color-alert-medium: #FFCD07;
  --color-alert-medium-light: #FEF3C7;
  --color-alert-low: #168821;
  --color-alert-low-light: #DCFCE7;

  /* Cores Neutras */
  --color-surface: #FFFFFF;
  --color-surface-foreground: #212529;
  --color-background: #F8F9FA;
  --color-muted: #F3F4F6;
  --color-muted-foreground: #6B7280;
  --color-border: #DEE2E6;
  --color-border-light: #E9ECEF;

  /* TIPOGRAFIA */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --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;

  /* ESPACAMENTOS */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* BORDAS */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;

  /* SOMBRAS */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  --shadow-primary: 0 4px 14px 0 rgb(19 81 180 / 0.25);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-bg-strong: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-blur: 10px;
  --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

  /* TRANSICOES */
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 300ms ease;

  /* LAYOUT */
  --sidebar-width: 280px;
  --sidebar-collapsed: 70px;
  --header-height: 64px;

  /* Z-INDEX */
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-fixed: 30;
  --z-modal-backdrop: 40;
  --z-modal: 50;
  --z-header: 80;
  --z-sidebar: 90;
  --z-notification: 100;
}

/* TEMA ESCURO */
[data-theme="dark"] {
  --color-surface: #1F2937;
  --color-surface-foreground: #F9FAFB;
  --color-background: #111827;
  --color-muted: #374151;
  --color-muted-foreground: #9CA3AF;
  --color-border: #374151;
  --color-primary-50: #1E3A5F;
  --glass-bg: rgba(31, 41, 55, 0.7);
  --glass-bg-strong: rgba(31, 41, 55, 0.85);
  --glass-border: rgba(55, 65, 81, 0.5);
}

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

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: #FFFFFF;
  padding: var(--spacing-sm) var(--spacing-md);
  z-index: 9999;
  transition: top var(--transition-normal);
  text-decoration: none;
}

.skip-link:focus { top: 0; }

.sr-only, .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;
}

/* Tamanho minimo para toque (WCAG 2.1) */
button, .btn, .nav-item, [role="button"] {
  min-height: 44px;
  min-width: 44px;
}

/* Reduzir movimento */
@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;
  }
}

/* INDICADORES DE RISCO (com icones para daltonicos) */
.risk-critical::before { content: "● "; }
.risk-high::before { content: "▲ "; }
.risk-medium::before { content: "◆ "; }
.risk-low::before { content: "○ "; }

/* BREAKPOINTS RESPONSIVOS */
@media (max-width: 320px) {
  :root {
    --font-size-base: 0.875rem;
    --spacing-md: 0.75rem;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0;
    --header-height: 56px;
  }
}

@media (min-width: 2560px) {
  :root {
    --font-size-base: 1.125rem;
    --spacing-md: 1.25rem;
  }
}
