/**
 * Design Tokens - Verafy Cognitive Testing Platform
 *
 * A wellness/vitality + tech/scientific design system for longevity enthusiasts.
 * Conveys: Trust, Clarity, Professionalism, Modern wellness.
 *
 * Usage: Import this file before other stylesheets.
 * Customization: Override any --vf-* variable in your own stylesheet.
 *
 * References:
 * - Color psychology for health apps: https://www.uxmatters.com/mt/archives/2024/07/leveraging-the-psychology-of-color-in-ux-design-for-health-and-wellness-apps.php
 * - jsPsych styling: https://www.jspsych.org/v7/overview/style/
 */

:root {
    /* ===================================
       COLOR PALETTE
       =================================== */

    /* Primary - Tech Purple: Innovation, creativity, premium tech */
    --vf-color-primary: #7C3AED;
    --vf-color-primary-light: #8B5CF6;
    --vf-color-primary-dark: #5B21B6;
    --vf-color-primary-subtle: #EDE9FE;

    /* Secondary - Bright Cyan: Data, science, precision */
    --vf-color-secondary: #06B6D4;
    --vf-color-secondary-light: #22D3EE;
    --vf-color-secondary-dark: #0891B2;

    /* Accent - Mint Green: Growth, optimization, wellness */
    --vf-color-accent: #10B981;
    --vf-color-accent-light: #34D399;
    --vf-color-accent-dark: #059669;

    /* Neutrals - Slate scale for text and UI */
    --vf-color-neutral-900: #0F172A;  /* Headings, emphasis */
    --vf-color-neutral-800: #1E293B;  /* Primary text */
    --vf-color-neutral-700: #334155;  /* Secondary text */
    --vf-color-neutral-600: #475569;  /* Muted text */
    --vf-color-neutral-500: #64748B;  /* Placeholders */
    --vf-color-neutral-400: #94A3B8;  /* Disabled text */
    --vf-color-neutral-300: #CBD5E1;  /* Borders */
    --vf-color-neutral-200: #E2E8F0;  /* Dividers */
    --vf-color-neutral-100: #F1F5F9;  /* Subtle backgrounds */
    --vf-color-neutral-50: #F8FAFC;   /* Card backgrounds */

    /* Backgrounds - Clean tech gradient */
    --vf-color-bg-primary: #FAFBFC;           /* Main background - clean, minimal */
    --vf-color-bg-secondary: #F8FAFC;         /* Secondary - subtle cool tint */
    --vf-color-bg-gradient: linear-gradient(135deg, #FAFBFC 0%, #F8FAFC 50%, #F5F7FA 100%);
    --vf-color-bg-card: #FFFFFF;              /* Cards, modals */
    --vf-color-bg-card-elevated: #FFFFFF;     /* Elevated cards */

    /* Semantic - Feedback colors */
    --vf-color-success: #22C55E;
    --vf-color-success-light: #DCFCE7;
    --vf-color-success-dark: #16A34A;

    --vf-color-error: #EF4444;
    --vf-color-error-light: #FEE2E2;
    --vf-color-error-dark: #DC2626;

    --vf-color-warning: #F59E0B;
    --vf-color-warning-light: #FEF3C7;

    --vf-color-info: #3B82F6;
    --vf-color-info-light: #DBEAFE;

    /* Focus - Accessibility */
    --vf-color-focus: #3B82F6;
    --vf-color-focus-ring: rgba(59, 130, 246, 0.5);

    /* Text on colored backgrounds */
    --vf-color-text-on-primary: #FFFFFF;
    --vf-color-text-on-dark: #FFFFFF;
    --vf-color-text-on-light: var(--vf-color-neutral-800);

    /* ===================================
       TYPOGRAPHY
       =================================== */

    /* Font Family - Open Sans: Hebrew support, highly legible */
    --vf-font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --vf-font-family-hebrew: 'Open Sans', 'Arial Hebrew', 'Noto Sans Hebrew', sans-serif;
    /* Heading Font - Plus Jakarta Sans: Modern SaaS aesthetic */
    --vf-font-family-heading: 'Plus Jakarta Sans', 'Open Sans', -apple-system, sans-serif;

    /* Font Sizes - Modular scale */
    --vf-font-size-xs: 12px;
    --vf-font-size-sm: 14px;
    --vf-font-size-base: 16px;
    --vf-font-size-md: 18px;
    --vf-font-size-lg: 20px;
    --vf-font-size-xl: 24px;
    --vf-font-size-2xl: 28px;
    --vf-font-size-3xl: 32px;
    --vf-font-size-4xl: 40px;

    /* Font Weights */
    --vf-font-weight-normal: 400;
    --vf-font-weight-medium: 500;
    --vf-font-weight-semibold: 600;
    --vf-font-weight-bold: 700;

    /* Line Heights */
    --vf-line-height-tight: 1.2;
    --vf-line-height-snug: 1.375;
    --vf-line-height-normal: 1.5;
    --vf-line-height-relaxed: 1.625;
    --vf-line-height-loose: 1.75;

    /* Letter Spacing */
    --vf-letter-spacing-tight: -0.025em;
    --vf-letter-spacing-normal: 0;
    --vf-letter-spacing-wide: 0.025em;

    /* ===================================
       SPACING
       =================================== */

    --vf-space-1: 4px;
    --vf-space-2: 8px;
    --vf-space-3: 12px;
    --vf-space-4: 16px;
    --vf-space-5: 20px;
    --vf-space-6: 24px;
    --vf-space-8: 32px;
    --vf-space-10: 40px;
    --vf-space-12: 48px;
    --vf-space-16: 64px;

    /* ===================================
       BORDERS & RADIUS
       =================================== */

    --vf-radius-sm: 6px;
    --vf-radius-md: 8px;
    --vf-radius-lg: 12px;
    --vf-radius-xl: 16px;
    --vf-radius-full: 9999px;

    --vf-border-width: 1px;
    --vf-border-color: var(--vf-color-neutral-200);

    /* ===================================
       SHADOWS
       =================================== */

    --vf-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --vf-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --vf-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --vf-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* Card shadows - softer, wellness feel */
    --vf-shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
    --vf-shadow-card-hover: 0 8px 16px rgba(0, 0, 0, 0.12);

    /* ===================================
       TRANSITIONS
       =================================== */

    --vf-transition-fast: 150ms ease;
    --vf-transition-normal: 200ms ease;
    --vf-transition-slow: 300ms ease;

    /* ===================================
       Z-INDEX SCALE
       =================================== */

    --vf-z-base: 0;
    --vf-z-dropdown: 100;
    --vf-z-sticky: 200;
    --vf-z-modal: 300;
    --vf-z-tooltip: 400;

    /* ===================================
       COMPONENT-SPECIFIC TOKENS
       =================================== */

    /* Buttons */
    --vf-btn-padding-x: var(--vf-space-6);
    --vf-btn-padding-y: var(--vf-space-3);
    --vf-btn-font-size: var(--vf-font-size-base);
    --vf-btn-font-weight: var(--vf-font-weight-semibold);
    --vf-btn-radius: var(--vf-radius-lg);

    /* Cards */
    --vf-card-padding: var(--vf-space-6);
    --vf-card-radius: var(--vf-radius-lg);
    --vf-card-bg: var(--vf-color-bg-card);

    /* Inputs */
    --vf-input-padding-x: var(--vf-space-4);
    --vf-input-padding-y: var(--vf-space-3);
    --vf-input-radius: var(--vf-radius-md);
    --vf-input-border: var(--vf-color-neutral-300);
    --vf-input-focus-border: var(--vf-color-primary);

    /* Progress Bar */
    --vf-progress-height: 4px;
    --vf-progress-bg: var(--vf-color-neutral-200);
    --vf-progress-fill: linear-gradient(90deg, var(--vf-color-primary) 0%, var(--vf-color-accent) 100%);
}

/* ===================================
   RTL SUPPORT
   =================================== */

[dir="rtl"] {
    --vf-font-family: var(--vf-font-family-hebrew);
}

/* ===================================
   DARK MODE (Future-ready)
   =================================== */

@media (prefers-color-scheme: dark) {
    :root.auto-dark {
        --vf-color-bg-primary: #0F172A;
        --vf-color-bg-secondary: #1E293B;
        --vf-color-bg-card: #1E293B;
        --vf-color-neutral-800: #E2E8F0;
        --vf-color-neutral-700: #CBD5E1;
        --vf-color-neutral-600: #94A3B8;
    }
}
