/**
 * CSS Variables - Sistema de Concesiones Comerciales
 * Based on DESIGN_GUIDELINES.md
 */

:root {
    /* Colors - Primary */
    --primary: #0066cc;
    --primary-dark: #004c99;
    --primary-light: #cce5ff;

    /* Colors - Secondary */
    --secondary: #6c757d;

    /* Colors - Semantic */
    --success: #28a745;
    --success-light: #d4edda;
    --danger: #dc3545;
    --danger-light: #f8d7da;
    --warning: #ffc107;
    --warning-light: #fff3cd;
    --info: #17a2b8;
    --info-light: #d1ecf1;

    /* Grays */
    --gray-50: #f8f9fa;
    --gray-100: #e9ecef;
    --gray-200: #dee2e6;
    --gray-300: #ced4da;
    --gray-400: #adb5bd;
    --gray-500: #868e96;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    /* Background */
    --bg-body: #f0f2f5;
    --bg-white: #ffffff;
    --bg-card: #ffffff;

    /* Borders */
    --border-color: var(--gray-300);
    --border-color-light: var(--gray-200);
    --border-radius: 4px;
    --border-radius-lg: 6px;

    /* Shadows */
    --box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    --box-shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
    --box-shadow-lg: 0 4px 6px rgba(0,0,0,0.1);
    --box-shadow-xl: 0 4px 12px rgba(0,0,0,0.15);

    /* Typography */
    --font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-fallback: Verdana, sans-serif;

    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-md: 13px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 24px;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;

    /* Spacing tokens (in px) */
    --space-1: 4px;
    --space-2: 6px;
    --space-3: 8px;
    --space-4: 10px;
    --space-5: 12px;
    --space-6: 14px;
    --space-7: 16px;
    --space-8: 20px;

    /* Layout */
    --header-height: 48px;
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 60px;
    --container-max-width: 1600px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Z-index layers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;

    /* Text colors (for theme switching) */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-tertiary: var(--gray-500);
    --text-muted: var(--gray-400);

    /* Additional backgrounds */
    --bg-secondary: var(--gray-100);
    --bg-hover: var(--gray-50);
    --bg-input: #ffffff;

    /* Table specific */
    --table-header-bg: var(--gray-100);
    --table-row-hover: var(--gray-50);
    --table-border: var(--gray-200);
}

/* Dark Mode */
[data-theme="dark"] {
    /* Colors - Primary (slightly adjusted for dark) */
    --primary: #4da3ff;
    --primary-dark: #2196f3;
    --primary-light: #1a3a5c;

    /* Colors - Semantic (adjusted for dark backgrounds) */
    --success: #4caf50;
    --success-light: #1b3d1e;
    --danger: #f44336;
    --danger-light: #3d1b1b;
    --warning: #ffb300;
    --warning-light: #3d3319;
    --info: #29b6f6;
    --info-light: #1a3340;

    /* Grays (inverted) */
    --gray-50: #1a1a1a;
    --gray-100: #242424;
    --gray-200: #2d2d2d;
    --gray-300: #3d3d3d;
    --gray-400: #5c5c5c;
    --gray-500: #7a7a7a;
    --gray-600: #999999;
    --gray-700: #b3b3b3;
    --gray-800: #cccccc;
    --gray-900: #e6e6e6;

    /* Background */
    --bg-body: #121212;
    --bg-white: #1e1e1e;
    --bg-card: #1e1e1e;
    --bg-secondary: #242424;
    --bg-hover: #2a2a2a;
    --bg-input: #2d2d2d;

    /* Borders */
    --border-color: #3d3d3d;
    --border-color-light: #333333;

    /* Shadows (more subtle in dark mode) */
    --box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    --box-shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --box-shadow-lg: 0 4px 6px rgba(0,0,0,0.3);
    --box-shadow-xl: 0 4px 12px rgba(0,0,0,0.4);

    /* Text colors */
    --text-primary: #e6e6e6;
    --text-secondary: #b3b3b3;
    --text-tertiary: #999999;
    --text-muted: #666666;

    /* Table specific */
    --table-header-bg: #242424;
    --table-row-hover: #2a2a2a;
    --table-border: #333333;
}

/* Dark mode specific element adjustments */
[data-theme="dark"] .header-logo img,
[data-theme="dark"] .auth-header img {
    filter: brightness(0) invert(1);
}
