/* ========================================
   INVESTLAB - DESIGN SYSTEM
   Sistema de Design Profissional v3.0
   Tokens de Design e Variáveis CSS
   ======================================== */

/* ========== ESPAÇAMENTOS ========== */
:root {
    /* Sistema de espaçamento baseado em 4px */
    --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 */
    
    /* Espaçamentos semânticos */
    --spacing-xs: var(--spacing-1);
    --spacing-sm: var(--spacing-2);
    --spacing-md: var(--spacing-4);
    --spacing-lg: var(--spacing-6);
    --spacing-xl: var(--spacing-8);
    --spacing-2xl: var(--spacing-12);
    --spacing-3xl: var(--spacing-16);
}

/* ========== TIPOGRAFIA ========== */
:root {
    /* Escala tipográfica */
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;  /* 14px */
    --font-size-base: 1rem;    /* 16px */
    --font-size-lg: 1.125rem;  /* 18px */
    --font-size-xl: 1.25rem;   /* 20px */
    --font-size-2xl: 1.5rem;   /* 24px */
    --font-size-3xl: 1.875rem; /* 30px */
    --font-size-4xl: 2.25rem;  /* 36px */
    
    /* Pesos de fonte */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Line heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Letter spacing */
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
}

/* ========== CORES - BACKGROUNDS ========== */
:root {
    /* Backgrounds principais */
    --bg-primary: #111827;        /* gray-900 */
    --bg-secondary: #1f2937;      /* gray-800 */
    --bg-tertiary: #374151;       /* gray-700 */
    --bg-elevated: #1f2937;       /* gray-800 para cards */
    
    /* Backgrounds de componentes */
    --bg-card: #1f2937;
    --bg-card-hover: #374151;
    --bg-input: #374151;
    --bg-input-hover: #4b5563;
    --bg-sidebar: #111827;
    --bg-header: #1f2937;
}

/* ========== CORES - TEXTOS ========== */
:root {
    /* Textos principais */
    --text-primary: #f9fafb;      /* white/gray-50 */
    --text-secondary: #e5e7eb;    /* gray-200 */
    --text-tertiary: #9ca3af;     /* gray-400 */
    --text-disabled: #6b7280;     /* gray-500 */
    
    /* Textos em fundos escuros */
    --text-on-dark: #f9fafb;
    --text-on-dark-secondary: #d1d5db; /* gray-300 */
    --text-on-dark-tertiary: #9ca3af;  /* gray-400 */
}

/* ========== CORES - BORDAS ========== */
:root {
    --border-default: #374151;    /* gray-700 */
    --border-hover: #4b5563;     /* gray-600 */
    --border-focus: #3b82f6;      /* blue-500 */
    --border-error: #ef4444;      /* red-500 */
    --border-success: #10b981;    /* green-500 */
}

/* ========== CORES - ESTADOS SEMÂNTICOS ========== */
:root {
    /* Success */
    --color-success: #10b981;     /* green-500 */
    --color-success-dark: #059669; /* green-600 */
    --color-success-light: #34d399; /* green-400 */
    --bg-success: #064e3b;         /* green-900 */
    --text-success: #6ee7b7;      /* green-300 */
    
    /* Error/Danger */
    --color-error: #ef4444;        /* red-500 */
    --color-error-dark: #dc2626;   /* red-600 */
    --color-error-light: #f87171; /* red-400 */
    --bg-error: #7f1d1d;          /* red-900 */
    --text-error: #fca5a5;        /* red-300 */
    
    /* Warning */
    --color-warning: #f59e0b;      /* yellow-500 */
    --color-warning-dark: #d97706; /* yellow-600 */
    --color-warning-light: #fbbf24; /* yellow-400 */
    --bg-warning: #78350f;         /* yellow-900 */
    --text-warning: #fcd34d;      /* yellow-300 */
    
    /* Info */
    --color-info: #3b82f6;         /* blue-500 */
    --color-info-dark: #2563eb;    /* blue-600 */
    --color-info-light: #60a5fa;   /* blue-400 */
    --bg-info: #1e3a8a;            /* blue-900 */
    --text-info: #93c5fd;          /* blue-300 */
    
    /* Neutral */
    --color-neutral: #6b7280;      /* gray-500 */
    --color-neutral-dark: #4b5563; /* gray-600 */
    --color-neutral-light: #9ca3af; /* gray-400 */
}

/* ========== CORES - AÇÕES ========== */
:root {
    /* Primary Action */
    --color-primary: #3b82f6;      /* blue-500 */
    --color-primary-dark: #2563eb; /* blue-600 */
    --color-primary-light: #60a5fa; /* blue-400 */
    --bg-primary: #1e40af;          /* blue-800 */
    --text-primary-action: #ffffff;
    
    /* Secondary Action */
    --color-secondary: #7c3aed;    /* purple-500 */
    --color-secondary-dark: #6d28d9; /* purple-600 */
    --bg-secondary: #374151;        /* gray-700 */
    --text-secondary-action: #e5e7eb;
    
    /* Danger Action */
    --color-danger: #ef4444;        /* red-500 */
    --color-danger-dark: #dc2626;  /* red-600 */
    --bg-danger: #7f1d1d;          /* red-900 */
    --text-danger-action: #ffffff;
}

/* ========== SOMBRAS ========== */
:root {
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Sombras coloridas */
    --shadow-primary: 0 4px 6px rgba(59, 130, 246, 0.25);
    --shadow-success: 0 4px 6px rgba(16, 185, 129, 0.25);
    --shadow-error: 0 4px 6px rgba(239, 68, 68, 0.25);
    --shadow-warning: 0 4px 6px rgba(245, 158, 11, 0.25);
}

/* ========== BORDAS E RADIUS ========== */
:root {
    --radius-sm: 0.5rem;   /* 8px */
    --radius-md: 0.75rem;  /* 12px */
    --radius-lg: 1rem;     /* 16px */
    --radius-xl: 1.125rem; /* 18px */
    --radius-2xl: 1.5rem;  /* 24px */
    --radius-full: 9999px;
    
    /* Radius semânticos */
    --radius-button: var(--radius-md);
    --radius-input: var(--radius-md);
    --radius-card: var(--radius-lg);
    --radius-card-premium: var(--radius-xl);
}

/* ========== TRANSIÇÕES ========== */
:root {
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Transições semânticas */
    --transition-button: var(--transition-base);
    --transition-card: var(--transition-slow);
    --transition-input: var(--transition-fast);
}

/* ========== Z-INDEX ========== */
:root {
    --z-base: 0;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ========== BREAKPOINTS (para referência) ========== */
:root {
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1536px;
}

/* ========== COMPONENTES ESPECÍFICOS ========== */

/* Metric Card - Para valores financeiros */
:root {
    --metric-card-bg: var(--bg-secondary);
    --metric-card-border: var(--border-default);
    --metric-card-padding: var(--spacing-6);
    --metric-label-size: var(--font-size-sm);
    --metric-label-color: var(--text-tertiary);
    --metric-value-size: var(--font-size-3xl);
    --metric-value-weight: var(--font-weight-bold);
    --metric-value-color: var(--text-primary);
}

/* Data Table - Para tabelas */
:root {
    --table-header-bg: var(--bg-tertiary);
    --table-header-text: var(--text-primary);
    --table-row-bg: transparent;
    --table-row-bg-alt: rgba(55, 65, 81, 0.3); /* gray-700 com opacidade */
    --table-row-hover: rgba(55, 65, 81, 0.5);
    --table-border: var(--border-default);
    --table-padding: var(--spacing-4);
}

/* Chart Container - Para gráficos */
:root {
    --chart-container-bg: var(--bg-secondary);
    --chart-container-border: var(--border-default);
    --chart-container-padding: var(--spacing-6);
    --chart-min-height: 20rem; /* 320px */
    --chart-title-size: var(--font-size-xl);
    --chart-title-weight: var(--font-weight-bold);
}

/* Input - Para campos de formulário */
:root {
    --input-bg: var(--bg-input);
    --input-border: var(--border-default);
    --input-text: var(--text-primary);
    --input-placeholder: var(--text-tertiary);
    --input-padding: var(--spacing-3) var(--spacing-4);
    --input-focus-border: var(--border-focus);
    --input-focus-ring: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Button - Para botões */
:root {
    --button-padding-sm: var(--spacing-2) var(--spacing-3);
    --button-padding-md: var(--spacing-3) var(--spacing-6);
    --button-padding-lg: var(--spacing-4) var(--spacing-8);
    --button-radius: var(--radius-button);
    --button-font-weight: var(--font-weight-semibold);
    --button-font-size: var(--font-size-sm);
    --button-transition: var(--transition-button);
}

/* Badge - Para status e tags */
:root {
    --badge-padding: var(--spacing-1) var(--spacing-2);
    --badge-radius: var(--radius-full);
    --badge-font-size: var(--font-size-xs);
    --badge-font-weight: var(--font-weight-semibold);
}

