/**
 * Salon POS Qatar - macOS-Style Design System Tokens
 * Strictly adheres to 8px spacing, CSS logical properties, and WCAG 2.2 AA contrast.
 */

:root {
    /* 1. Typography */
    --font-sans: system-ui, -apple-system, "SF Pro Text", "Inter", "Segoe UI", sans-serif;
    --font-arabic: "IBM Plex Sans Arabic", "Noto Sans Arabic", "Tajawal", system-ui, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --font-tabular: tabular-nums;

    /* Type Scale */
    --text-2xs: 0.6875rem; /* 11px */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.8125rem;  /* 13px */
    --text-base: 0.875rem; /* 14px - macOS standard */
    --text-md: 1rem;       /* 16px */
    --text-lg: 1.125rem;   /* 18px */
    --text-xl: 1.375rem;   /* 22px */
    --text-2xl: 1.625rem;  /* 26px */
    --text-3xl: 2rem;      /* 32px */

    /* 2. Spacing Scale (8px Grid) */
    --space-0-5: 0.25rem; /* 4px */
    --space-1: 0.5rem;    /* 8px */
    --space-1-5: 0.75rem; /* 12px */
    --space-2: 1rem;      /* 16px */
    --space-2-5: 1.25rem; /* 20px */
    --space-3: 1.5rem;    /* 24px */
    --space-4: 2rem;      /* 32px */
    --space-5: 2.5rem;    /* 40px */
    --space-6: 3rem;      /* 48px */
    --space-8: 4rem;      /* 64px */

    /* 3. Radius Scale */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;    /* Base controls radius */
    --radius-card: 14px;  /* Cards & Modals */
    --radius-lg: 18px;
    --radius-full: 9999px;

    /* 4. Layered Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.09), 0 4px 10px rgba(0, 0, 0, 0.04);
    --shadow-sheet: 0 24px 48px -12px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);

    /* 5. Transitions */
    --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-normal: 220ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-sheet: 320ms cubic-bezier(0.22, 1, 0.36, 1);

    /* 6. Light Theme (Default) */
    --color-bg-app: #f4f5f8;
    --color-bg-canvas: #ffffff;
    --color-surface: #ffffff;
    --color-surface-subtle: #f8f9fa;
    --color-surface-hover: #f1f3f6;
    --color-surface-active: #e9ecef;

    /* Vibrancy / Translucency (macOS style) */
    --color-vibrancy-sidebar: rgba(255, 255, 255, 0.72);
    --color-vibrancy-header: rgba(255, 255, 255, 0.82);
    --color-vibrancy-popover: rgba(255, 255, 255, 0.94);
    --blur-vibrancy: blur(20px) saturate(190%);

    /* Borders */
    --color-border: #e2e5ea;
    --color-border-subtle: #edf0f4;
    --color-border-strong: #cbd2d9;
    --color-border-focus: #0071e3; /* macOS blue accent */

    /* Text */
    --color-text-primary: #1d1d1f;
    --color-text-secondary: #6e6e73;
    --color-text-tertiary: #86868b;
    --color-text-quaternary: #aeaeb2;
    --color-text-inverted: #ffffff;

    /* Legacy compatibility mappings */
    --color-primary: #1d1d1f;
    --color-primary-light: #2c2f38;
    --color-bg: #f4f5f8;
    --color-text-main: #1d1d1f;
    --color-text-muted: #6e6e73;

    /* Brand & Accent */
    --color-accent: #0071e3;          /* macOS Accent Blue */
    --color-accent-hover: #0077ed;
    --color-accent-soft: rgba(0, 113, 227, 0.1);
    --color-accent-gold: #c59b6d;     /* Champagne Rose Gold */
    --color-accent-gold-soft: rgba(197, 155, 109, 0.12);

    /* Status Colors with Pairings (Light) */
    --color-success: #1a8754;
    --color-success-bg: #eaf6ee;
    --color-success-border: #bee2cd;
    --color-success-text: #0f5132;
    --color-success-soft: #eaf6ee;

    --color-warning: #b76e00;
    --color-warning-bg: #fff8e6;
    --color-warning-border: #ffe299;
    --color-warning-text: #7a4600;
    --color-warning-soft: #fff8e6;

    --color-danger: #d92d20;
    --color-danger-bg: #fef3f2;
    --color-danger-border: #fecdca;
    --color-danger-text: #912018;
    --color-danger-soft: #fef3f2;

    --color-info: #026aa2;
    --color-info-bg: #f0f9ff;
    --color-info-border: #b9e6fe;
    --color-info-text: #004e76;
    --color-info-soft: #f0f9ff;

    --color-neutral: #55575e;
    --color-neutral-bg: #f2f3f5;
    --color-neutral-border: #dcdfe3;
    --color-neutral-text: #37393f;
}

/* 7. Dark Theme */
[data-theme="dark"] {
    --color-bg-app: #121316;
    --color-bg-canvas: #1a1b1e;
    --color-surface: #202227;
    --color-surface-subtle: #262930;
    --color-surface-hover: #2c2f38;
    --color-surface-active: #343842;

    --color-vibrancy-sidebar: rgba(24, 26, 31, 0.75);
    --color-vibrancy-header: rgba(26, 27, 30, 0.85);
    --color-vibrancy-popover: rgba(32, 34, 39, 0.94);
    --blur-vibrancy: blur(24px) saturate(200%);

    --color-border: #2e323b;
    --color-border-subtle: #252830;
    --color-border-strong: #3d434f;
    --color-border-focus: #2997ff;

    --color-text-primary: #f5f5f7;
    --color-text-secondary: #a1a1a6;
    --color-text-tertiary: #86868b;
    --color-text-quaternary: #636366;
    --color-text-inverted: #121316;

    --color-primary: #f5f5f7;
    --color-primary-light: #2c2f38;
    --color-bg: #121316;
    --color-text-main: #f5f5f7;
    --color-text-muted: #a1a1a6;

    --color-accent: #2997ff;
    --color-accent-hover: #40a9ff;
    --color-accent-soft: rgba(41, 151, 255, 0.16);

    /* Status Colors with Pairings (Dark) */
    --color-success: #34c759;
    --color-success-bg: rgba(52, 199, 89, 0.16);
    --color-success-border: rgba(52, 199, 89, 0.3);
    --color-success-text: #70e68e;
    --color-success-soft: rgba(52, 199, 89, 0.16);

    --color-warning: #ff9f0a;
    --color-warning-bg: rgba(255, 159, 10, 0.16);
    --color-warning-border: rgba(255, 159, 10, 0.3);
    --color-warning-text: #ffc066;
    --color-warning-soft: rgba(255, 159, 10, 0.16);

    --color-danger: #ff453a;
    --color-danger-bg: rgba(255, 69, 58, 0.16);
    --color-danger-border: rgba(255, 69, 58, 0.3);
    --color-danger-text: #ff8580;
    --color-danger-soft: rgba(255, 69, 58, 0.16);

    --color-info: #0a84ff;
    --color-info-bg: rgba(10, 132, 255, 0.16);
    --color-info-border: rgba(10, 132, 255, 0.3);
    --color-info-text: #70b3ff;
    --color-info-soft: rgba(10, 132, 255, 0.16);

    --color-neutral: #8e8e93;
    --color-neutral-bg: rgba(142, 142, 147, 0.16);
    --color-neutral-border: rgba(142, 142, 147, 0.3);
    --color-neutral-text: #d1d1d6;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.45), 0 4px 10px rgba(0, 0, 0, 0.3);
    --shadow-sheet: 0 24px 48px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
}
