/**
 * SplitBill - CSS Custom Properties
 * Light Mode (default) and Dark Mode via prefers-color-scheme
 */

:root {
    /* ===================
       Color Palette - Light Mode
       =================== */

    /* Primary Colors */
    --color-primary: #4a90d9;
    --color-primary-light: #6ba3e0;
    --color-primary-dark: #3a7bc8;
    --color-primary-contrast: #ffffff;

    /* Secondary Colors */
    --color-secondary: #6c757d;
    --color-secondary-light: #868e96;
    --color-secondary-dark: #545b62;
    --color-secondary-contrast: #ffffff;

    /* Accent Colors */
    --color-accent: #28a745;
    --color-accent-light: #48b461;
    --color-accent-dark: #1e7e34;

    /* Semantic Colors */
    --color-success: #28a745;
    --color-success-light: #d4edda;
    --color-success-dark: #1e7e34;

    --color-warning: #ffc107;
    --color-warning-light: #fff3cd;
    --color-warning-dark: #d39e00;

    --color-danger: #dc3545;
    --color-danger-light: #f8d7da;
    --color-danger-dark: #c82333;

    --color-info: #17a2b8;
    --color-info-light: #d1ecf1;
    --color-info-dark: #117a8b;

    /* Background colors for semantic states */
    --color-success-bg: rgba(40, 167, 69, 0.1);
    --color-warning-bg: rgba(255, 193, 7, 0.1);
    --color-danger-bg: rgba(220, 53, 69, 0.1);
    --color-info-bg: rgba(23, 162, 184, 0.1);

    /* Background Colors */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f8f9fa;
    --color-bg-tertiary: #e9ecef;
    --color-bg-elevated: #ffffff;

    /* Text Colors */
    --color-text-primary: #212529;
    --color-text-secondary: #6c757d;
    --color-text-muted: #adb5bd;
    --color-text-inverse: #ffffff;

    /* Border Colors */
    --color-border: #dee2e6;
    --color-border-light: #e9ecef;
    --color-border-dark: #ced4da;
    --color-border-focus: var(--color-primary);

    /* ===================
       Spacing
       =================== */
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-2xl: 3rem;     /* 48px */
    --spacing-3xl: 4rem;     /* 64px */

    /* ===================
       Border Radius
       =================== */
    --radius-sm: 0.25rem;    /* 4px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-full: 9999px;

    /* ===================
       Shadows
       =================== */
    --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-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    --shadow-focus: 0 0 0 3px rgba(74, 144, 217, 0.25);

    /* ===================
       Typography
       =================== */
    --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;

    --font-size-xs: 0.75rem;   /* 12px */
    --font-size-sm: 0.875rem;  /* 14px */
    --font-size-md: 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 */

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

    /* ===================
       Transitions
       =================== */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* ===================
       Z-Index Scale
       =================== */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;

    /* ===================
       Layout
       =================== */
    --header-height: 60px;
    --nav-height: 64px;
    --sidebar-width: 280px;
    --container-max-width: 1200px;
    --content-max-width: 800px;
}

/* ===================
   Dark Mode
   =================== */
@media (prefers-color-scheme: dark) {
    :root {
        /* Primary Colors - adjusted for dark mode */
        --color-primary: #5a9fe0;
        --color-primary-light: #7ab3e8;
        --color-primary-dark: #4a8fd0;

        /* Background Colors */
        --color-bg-primary: #1a1a2e;
        --color-bg-secondary: #16213e;
        --color-bg-tertiary: #0f3460;
        --color-bg-elevated: #1f2937;

        /* Text Colors */
        --color-text-primary: #f3f4f6;
        --color-text-secondary: #9ca3af;
        --color-text-muted: #6b7280;
        --color-text-inverse: #1a1a2e;

        /* Border Colors */
        --color-border: #374151;
        --color-border-light: #4b5563;
        --color-border-dark: #1f2937;

        /* Semantic Colors - adjusted for dark backgrounds */
        --color-success-light: #064e3b;
        --color-warning-light: #78350f;
        --color-danger-light: #7f1d1d;
        --color-info-light: #0c4a6e;

        /* Shadows - adjusted for dark mode */
        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
        --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.3);
        --shadow-focus: 0 0 0 3px rgba(90, 159, 224, 0.35);
    }
}

/* ===================
   Manual Dark Mode Toggle (optional class-based)
   =================== */
.dark-mode {
    /* Primary Colors - adjusted for dark mode */
    --color-primary: #5a9fe0;
    --color-primary-light: #7ab3e8;
    --color-primary-dark: #4a8fd0;

    /* Background Colors */
    --color-bg-primary: #1a1a2e;
    --color-bg-secondary: #16213e;
    --color-bg-tertiary: #0f3460;
    --color-bg-elevated: #1f2937;

    /* Text Colors */
    --color-text-primary: #f3f4f6;
    --color-text-secondary: #9ca3af;
    --color-text-muted: #6b7280;
    --color-text-inverse: #1a1a2e;

    /* Border Colors */
    --color-border: #374151;
    --color-border-light: #4b5563;
    --color-border-dark: #1f2937;

    /* Semantic Colors */
    --color-success-light: #064e3b;
    --color-warning-light: #78350f;
    --color-danger-light: #7f1d1d;
    --color-info-light: #0c4a6e;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.3);
    --shadow-focus: 0 0 0 3px rgba(90, 159, 224, 0.35);
}
