/* CENTRINEXUS - SHARED THEME VARIABLES & DESIGN TOKENS
============================================================================
This file contains the core design tokens and theme variables for CentriNexus.
Import this file first in any stylesheet. Reference variables using var(--variable-name).
============================================================================
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

:root {
  /* Brand & Primary Colors (Unified Teal/Coral Palette) */
  --primary: #3f9aae; /* Teal */
  --primary-hover: #358293;
  --primary-light: #eff6ff;
  --primary-rgb: 63, 154, 174;

  --cnx-primary: #3f9aae;
  --cnx-primary-dark: #358293;
  --cnx-primary-light: #e0f2f5;
  --cnx-primary-glow: rgba(63, 154, 174, 0.15);
  --cnx-secondary: #6a6d70;
  --cnx-success: #107f3e;
  --cnx-warning: #e76500;
  --cnx-error: #bb0000;
  --cnx-accent: #f96e5b; /* Keeping for backward compatibility */
  --cnx-cream: #ffe2af;
  --cnx-mint: #79c9c5;
  --cnx-background: #f7f7f7;
  --cnx-surface: #f7f7f7;
  --cnx-text: #32363a;
  --cnx-text-light: #6a6d70;
  --cnx-border: #d9d9d9;
  --cnx-hover: #f5f5f5;

  /* Semantic Colors */
  --success: #059669;
  --success-bg: #d1fae5;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #f96e5b; /* Aligned with Error */
  --danger-bg: #fee2e2;
  --info: #3f9aae; /* Aligned with Primary */
  --info-bg: #eff6ff;

  /* Neutrals & Surfaces (Default: Light Theme) */
  --bg-body: #ffffff;
  --bg-surface: var(--cnx-surface);
  --bg-card: var(--cnx-surface);
  --bg-input: var(--bg-surface);
  --bg-input-hover: var(--bg-surface);
  --bg-sidebar: var(--cnx-background);
  --bg-hover: var(--cnx-hover);
  --bg-active: var(--cnx-hover);
  --bg-glass: rgba(14, 14, 17, 0.7);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --glass-fx: blur(20px) saturate(180%);

  /* Text */
  --text-main: var(--cnx-text);
  --text-muted: var(--cnx-text-light);
  --text-subtle: var(--cnx-text-light);
  --text-inverse: #000000;

  /* Borders - Base variable defined first */
  --cnx-border: #d9d9d9;
  --border-color: var(--cnx-border);
  --border-light: var(--cnx-border);
  --border-dim: rgba(255, 255, 255, 0.08);
  --border-light-alt: rgba(255, 255, 255, 0.15);
  --sidebar-border: #d1d5db;

  /* Header & Sidebar */
  --header-bg: #2c3e50;
  --header-text: #ffffff;
  --sidebar-text: #374151;
  --sidebar-hover: #f3f4f6;
  --sidebar-active-bg: var(--primary-light);
  --sidebar-active-border: var(--primary);

  /* Typography */
  --font-main:
    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Space Mono', 'JetBrains Mono', 'Courier New', monospace;

  /* Font Sizes - Standard naming convention */
  --font-size-3xl-small: 9px;
  --font-size-xx-small: 10px;
  --font-size-x-small: 11px;
  --font-size-small: 12px;
  --font-size-medium: 14px; /* Base size */
  --font-size-large: 16px;
  --font-size-x-large: 18px;
  --font-size-xx-large: 20px;
  --font-size-3x-large: 24px;
  --font-size-4x-large: 30px;
  --font-size-5x-large: 36px;

  /* Aliases for backward compatibility */
  --font-size-xs: var(--font-size-x-small);
  --font-size-sm: var(--font-size-small);
  --font-size-base: var(--font-size-medium);
  --font-size-md: var(--font-size-large);
  --font-size-lg: var(--font-size-x-large);
  --font-size-xl: var(--font-size-xx-large);
  --font-size-2xl: var(--font-size-3x-large);
  --font-size-3xl: var(--font-size-3x-large);
  --font-size-4xl: var(--font-size-4x-large);
  --font-size-5xl: var(--font-size-5x-large);

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

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 20px;
  --spacing-2xl: 24px;
  --spacing-3xl: 32px;

  /* Borders & Radius */
  --border-radius-sm: 3px;
  --border-radius-md: 4px;
  --border-radius-lg: 6px;
  --border-radius-xl: 8px;
  --border-radius-2xl: 12px;
  --border-width: 1px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

  /* Layout */
  --header-height: 48px;
  --sidebar-width: 240px;
  --content-max-width: 1250px;

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

  /* Grid */
  --grid-color: rgba(255, 255, 255, 0.03);

  /* --- ERP Specific Tokens (Migrated from erp-modern.css) --- */
  --erp-header-bg: #2c3e50;
  --erp-header-text: #ffffff;
  --action-bar-height: 54px;
}

[data-theme='dark'] {
  --bg-body: #0f172a;
  --bg-surface: #1e293b;
  --bg-card: #141418;
  --bg-input: #0f172a;
  --bg-input-hover: #1e293b;
  --bg-sidebar: #1e293b;
  --bg-hover: #334155;
  --bg-active: #475569;
  --bg-glass: rgba(14, 14, 17, 0.7);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --text-inverse: #ffffff;
  --border-color: #334155;
  --border-light: #475569;
  --cnx-border: #334155;
  --sidebar-text: #e2e8f0;
  --sidebar-hover: #334155;
  --sidebar-active-bg: #1e40af;
  --sidebar-active-border: #3b82f6;
  --cnx-primary-light: rgba(63, 154, 174, 0.15);
  --cnx-text: #f1f5f9;
  --cnx-text-light: #94a3b8;
  --cnx-background: #0f172a;
  --cnx-surface: #1e293b;
  --cnx-hover: #334155;
}

/*
============================================================================
ACCESSIBILITY - REDUCED MOTION
============================================================================
Respects user's motion preferences for vestibular disorders
WCAG 2.1 Level AA Compliance
============================================================================
*/
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/*
============================================================================
UTILITY CLASSES
============================================================================
*/
.u-mb-1 {
  margin-bottom: 8px !important;
}
.u-mb-2 {
  margin-bottom: 16px !important;
}
.u-mt-1 {
  margin-top: 8px !important;
}
.u-mt-2 {
  margin-top: 16px !important;
}
.u-flex {
  display: flex !important;
}
.u-center {
  justify-content: center !important;
  align-items: center !important;
}
