/**
 * ECP UI SDK - CSS Custom Properties
 * Unified design tokens for all ECP modules
 * Version: 1.0
 * Compatible with: TTM+, MON+, Rooms, ALM, CMDB, ITSM
 */

:root {
  /* ========== Brand Colors ========== */
  --ecp-primary: #007bff;
  --ecp-primary-hover: #0056b3;
  --ecp-primary-active: #004494;

  --ecp-secondary: #6c757d;
  --ecp-secondary-hover: #545b62;

  --ecp-accent: #17a2b8;
  --ecp-accent-hover: #138496;

  /* ========== Semantic Colors ========== */
  --ecp-success: #28a745;
  --ecp-success-bg: #d4edda;
  --ecp-success-border: #c3e6cb;

  --ecp-warning: #ffc107;
  --ecp-warning-bg: #fff3cd;
  --ecp-warning-border: #ffeaa7;

  --ecp-danger: #dc3545;
  --ecp-danger-bg: #f8d7da;
  --ecp-danger-border: #f5c6cb;

  --ecp-info: #17a2b8;
  --ecp-info-bg: #d1ecf1;
  --ecp-info-border: #bee5eb;

  /* ========== Neutral Colors (Light Theme) ========== */
  --ecp-bg-primary: #ffffff;
  --ecp-bg-secondary: #f8f9fa;
  --ecp-bg-tertiary: #e9ecef;

  --ecp-text-primary: #212529;
  --ecp-text-secondary: #6c757d;
  --ecp-text-muted: #adb5bd;

  --ecp-border-color: #dee2e6;
  --ecp-border-color-light: #e9ecef;

  --ecp-card-bg: #ffffff;
  --ecp-card-shadow: rgba(0, 0, 0, 0.1);

  /* ========== Component-Specific ========== */
  --ecp-header-bg: #ffffff;
  --ecp-header-border: #dee2e6;
  --ecp-header-height: 60px;

  --ecp-sidebar-bg: #343a40;
  --ecp-sidebar-text: #ffffff;
  --ecp-sidebar-width: 250px;

  --ecp-hamburger-bg: #ffffff;
  --ecp-hamburger-hover: #f8f9fa;
  --ecp-hamburger-border: #dee2e6;

  --ecp-modal-bg: #ffffff;
  --ecp-modal-overlay: rgba(0, 0, 0, 0.5);

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

  --ecp-font-size-xs: 0.75rem;    /* 12px */
  --ecp-font-size-sm: 0.875rem;   /* 14px */
  --ecp-font-size-base: 1rem;     /* 16px */
  --ecp-font-size-lg: 1.125rem;   /* 18px */
  --ecp-font-size-xl: 1.25rem;    /* 20px */
  --ecp-font-size-2xl: 1.5rem;    /* 24px */

  --ecp-font-weight-normal: 400;
  --ecp-font-weight-medium: 500;
  --ecp-font-weight-semibold: 600;
  --ecp-font-weight-bold: 700;

  --ecp-line-height-tight: 1.25;
  --ecp-line-height-normal: 1.5;
  --ecp-line-height-relaxed: 1.75;

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

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

  /* ========== Shadows ========== */
  --ecp-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --ecp-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
                   0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --ecp-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
                   0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --ecp-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
                   0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* ========== Transitions ========== */
  --ecp-transition-fast: 150ms ease;
  --ecp-transition-base: 200ms ease;
  --ecp-transition-slow: 300ms ease;

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

/* ========== Dark Mode Overrides ========== */
.dark-mode,
[data-theme="dark"] {
  --ecp-bg-primary: #1a1a1a;
  --ecp-bg-secondary: #2a2a2a;
  --ecp-bg-tertiary: #3a3a3a;

  --ecp-text-primary: #e0e0e0;
  --ecp-text-secondary: #b0b0b0;
  --ecp-text-muted: #808080;

  --ecp-border-color: #404040;
  --ecp-border-color-light: #353535;

  --ecp-card-bg: #2a2a2a;
  --ecp-card-shadow: rgba(0, 0, 0, 0.3);

  --ecp-header-bg: #1a1a1a;
  --ecp-header-border: #404040;

  --ecp-hamburger-bg: #2a2a2a;
  --ecp-hamburger-hover: #353535;
  --ecp-hamburger-border: #404040;

  --ecp-modal-bg: #2a2a2a;
  --ecp-modal-overlay: rgba(0, 0, 0, 0.7);

  /* Adjust semantic colors for dark mode */
  --ecp-success-bg: #1a3d2a;
  --ecp-success-border: #2d5a3d;

  --ecp-warning-bg: #3d3420;
  --ecp-warning-border: #5a4d30;

  --ecp-danger-bg: #3d1a1f;
  --ecp-danger-border: #5a2d32;

  --ecp-info-bg: #1a3033;
  --ecp-info-border: #2d4d52;
}

/* ========== Font Size Preferences ========== */
.font-size-small {
  --ecp-font-size-base: 0.875rem;  /* 14px */
}

.font-size-large {
  --ecp-font-size-base: 1.125rem;  /* 18px */
}

/* ========== Density Preferences ========== */
.density-compact {
  --ecp-space-md: 0.75rem;
  --ecp-space-lg: 1rem;
  --ecp-space-xl: 1.5rem;
}

.density-spacious {
  --ecp-space-md: 1.25rem;
  --ecp-space-lg: 2rem;
  --ecp-space-xl: 2.5rem;
}
