/**
 * Wahive Design System — Tokens
 * Single source of truth for colors, typography, spacing, and elevation.
 * Load before wahive-auth.css and wahive-dashboard.css.
 */

:root {
    /* Brand */
    --wahive-brand: #ff6600;
    --wahive-brand-hover: #e55a00;
    --wahive-brand-light: #ff8533;
    --wahive-brand-muted: #fff4eb;
    --wahive-brand-subtle: #fff8f2;
    --wahive-brand-ring: rgba(255, 102, 0, 0.18);
    --wahive-brand-gradient: linear-gradient(135deg, #ff8533 0%, #ff6600 45%, #e55a00 100%);

    /* Legacy aliases (deprecated — use --wahive-brand*) */
    --wahive-green: var(--wahive-brand);
    --wahive-green-hover: var(--wahive-brand-hover);
    --wahive-green-light: var(--wahive-brand-muted);
    --wahive-green-muted: var(--wahive-brand-subtle);
    --wahive-orange: var(--wahive-brand);
    --wahive-orange-hover: var(--wahive-brand-hover);
    --wahive-orange-light: var(--wahive-brand-muted);
    --wahive-orange-muted: var(--wahive-brand-subtle);
    --wahive-orange-ring: var(--wahive-brand-ring);
    --wahive-orange-gradient: var(--wahive-brand-gradient);
    --wahive-orange-dark: var(--wahive-brand-hover);

    /* Surfaces */
    --wahive-bg-page: #f4f4f5;
    --wahive-bg-surface: #ffffff;
    --wahive-bg-subtle: #fafafa;
    --wahive-bg: var(--wahive-bg-page);
    --wahive-surface: var(--wahive-bg-surface);
    --wahive-border: #e5e5e5;
    --wahive-border-strong: #d4d4d4;

    /* Text */
    --wahive-text-primary: #0a0a0a;
    --wahive-text-secondary: #525252;
    --wahive-text-muted: #737373;
    --wahive-text-inverse: #ffffff;
    --wahive-text: var(--wahive-text-primary);

    /* Semantic — success uses brand orange (not green) */
    --wahive-success: var(--wahive-brand);
    --wahive-success-bg: var(--wahive-brand-subtle);
    --wahive-warning: #d97706;
    --wahive-warning-bg: #fef3c7;
    --wahive-error: #dc2626;
    --wahive-error-bg: #fee2e2;
    --wahive-info: #2563eb;
    --wahive-info-bg: #dbeafe;

    /* Disabled */
    --wahive-disabled-bg: #f5f5f5;
    --wahive-disabled-text: #a3a3a3;

    /* Typography */
    --wahive-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --wahive-font-size-xs: 0.75rem;
    --wahive-font-size-sm: 0.875rem;
    --wahive-font-size-base: 0.9375rem;
    --wahive-font-size-lg: 1.125rem;
    --wahive-font-size-xl: 1.25rem;
    --wahive-font-size-2xl: 1.5rem;
    --wahive-font-size-3xl: 1.875rem;
    --wahive-font-weight-normal: 400;
    --wahive-font-weight-medium: 500;
    --wahive-font-weight-semibold: 600;
    --wahive-font-weight-bold: 700;
    --wahive-line-height: 1.5;

    /* Spacing (4px base) */
    --wahive-space-1: 0.25rem;
    --wahive-space-2: 0.5rem;
    --wahive-space-3: 0.75rem;
    --wahive-space-4: 1rem;
    --wahive-space-5: 1.25rem;
    --wahive-space-6: 1.5rem;
    --wahive-space-8: 2rem;
    --wahive-space-10: 2.5rem;
    --wahive-space-12: 3rem;

    /* Radius */
    --wahive-radius-sm: 6px;
    --wahive-radius: 8px;
    --wahive-radius-md: 12px;
    --wahive-radius-lg: 14px;
    --wahive-radius-xl: 20px;
    --wahive-radius-full: 9999px;

    /* Shadows */
    --wahive-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --wahive-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --wahive-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --wahive-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.08);
    --wahive-shadow-brand: 0 4px 24px rgba(255, 102, 0, 0.08);

    /* Layout */
    --wahive-sidebar-width: 240px;
    --wahive-sidebar-collapsed: 64px;
    --wahive-header-height: 64px;
    --wahive-content-max: 1400px;
    --wahive-page-padding-x: var(--wahive-space-4);
    --wahive-page-padding-y: var(--wahive-space-6);

    /* Breakpoints (reference only — use in media queries) */
    --wahive-bp-sm: 576px;
    --wahive-bp-md: 768px;
    --wahive-bp-lg: 992px;
    --wahive-bp-xl: 1200px;

    /* Transitions */
    --wahive-transition: 0.15s ease;
    --wahive-transition-slow: 0.25s ease;

    /* Focus ring */
    --wahive-focus-ring: 0 0 0 3px var(--wahive-brand-ring);

    /* Touch target minimum */
    --wahive-touch-min: 44px;
}

/* Dark theme token overrides */
[data-theme="dark"],
.dark-theme {
    --wahive-bg-page: #0a0a0a;
    --wahive-bg-surface: #171717;
    --wahive-bg-subtle: #1f1f1f;
    --wahive-border: #262626;
    --wahive-border-strong: #404040;
    --wahive-text-primary: #fafafa;
    --wahive-text-secondary: #a3a3a3;
    --wahive-text-muted: #737373;
    --wahive-brand-muted: rgba(255, 102, 0, 0.12);
    --wahive-brand-subtle: rgba(255, 102, 0, 0.08);
    --wahive-disabled-bg: #262626;
    --wahive-disabled-text: #525252;
    --wahive-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --wahive-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
}

@media (min-width: 768px) {
    :root {
        --wahive-page-padding-x: var(--wahive-space-6);
    }
}

@media (prefers-color-scheme: dark) {
    [data-theme="system_default"] {
        --wahive-bg-page: #0a0a0a;
        --wahive-bg-surface: #171717;
        --wahive-bg-subtle: #1f1f1f;
        --wahive-border: #262626;
        --wahive-border-strong: #404040;
        --wahive-text-primary: #fafafa;
        --wahive-text-secondary: #a3a3a3;
        --wahive-text-muted: #737373;
        --wahive-brand-muted: rgba(255, 102, 0, 0.12);
        --wahive-brand-subtle: rgba(255, 102, 0, 0.08);
    }
}
