/**
 * Quantierra UI Design Tokens
 *
 * CSS custom properties for consistent styling across components.
 * These tokens are designed to be overridable by consuming applications
 * to enable theming and customization.
 *
 * IMPORTANT: Keep in sync with ../quantierra-ui/src/styles/tokens.css
 */

:root {
  /* ==========================================================================
     Colors - Surfaces
     ========================================================================== */
  --color-surface-canvas: #f8fafc;
  --color-surface-primary: #ffffff;
  --color-surface-secondary: #f1f5f9;
  --color-surface-elevated: #ffffff;
  --color-surface-inverse: #0f172a;

  /* ==========================================================================
     Colors - Accent
     ========================================================================== */
  --color-accent-primary: #2563eb;
  --color-accent-muted: #93c5fd;

  /* ==========================================================================
     Colors - Text
     ========================================================================== */
  --color-text-primary: #0f172a;
  --color-text-secondary: #64748b;
  --color-text-tertiary: #94a3b8;
  --color-text-inverse: #ffffff;
  --color-text-link: var(--color-accent-primary);

  /* ==========================================================================
     Colors - Border
     ========================================================================== */
  --color-border-default: #e2e8f0;
  --color-border-subtle: #f1f5f9;
  --color-border-strong: #94a3b8;
  --color-border-focus: var(--color-accent-primary);

  /* ==========================================================================
     Colors - Status
     ========================================================================== */
  --color-status-success: #22c55e;
  --color-status-success-muted: #bbf7d0;
  --color-status-warning: #f59e0b;
  --color-status-warning-muted: #fde68a;
  --color-status-danger: #ef4444;
  --color-status-danger-muted: #fecaca;
  --color-status-info: var(--color-accent-primary);
  --color-status-info-muted: #bfdbfe;

  /* ==========================================================================
     Badge Colors - WCAG 2.1 AA compliant (4.5:1 contrast minimum)
     ========================================================================== */
  --color-badge-primary-bg: rgba(59, 130, 246, 0.15);
  --color-badge-primary-text: #1e40af; /* blue-800: 7.25:1 contrast */
  --color-badge-success-bg: rgba(34, 197, 94, 0.15);
  --color-badge-success-text: #166534; /* green-800: 7.28:1 contrast */
  --color-badge-warning-bg: rgba(245, 158, 11, 0.15);
  --color-badge-warning-text: #92400e; /* amber-800: 5.74:1 contrast */
  --color-badge-danger-bg: rgba(239, 68, 68, 0.15);
  --color-badge-danger-text: #991b1b; /* red-800: 7.22:1 contrast */
  --color-badge-info-bg: rgba(59, 130, 246, 0.15);
  --color-badge-info-text: #1e40af; /* blue-800: 7.25:1 contrast */

  /* ==========================================================================
     Colors - Map Data Visualization
     ========================================================================== */
  --color-map-primary: #ff7800; /* Orange - primary data layer */
  --color-map-secondary: #ff00ff; /* Magenta - secondary data layer */
  --color-map-tertiary: #007ba7; /* Teal - tertiary data layer */
  --color-map-background: #e9e8e0; /* Beige - map background */
  --color-map-highlight: #22c55e; /* Green - highlighted features */

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

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

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

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

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

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

  /* ==========================================================================
     Elevation (Box Shadows)
     ========================================================================== */
  --elevation-none: none;
  --elevation-low: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --elevation-medium:
    0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --elevation-high:
    0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --elevation-overlay: 0 25px 50px -12px rgb(0 0 0 / 0.25);

  /* ==========================================================================
     Motion
     ========================================================================== */
  --motion-duration-instant: 0ms;
  --motion-duration-fast: 100ms;
  --motion-duration-short: 150ms;
  --motion-duration-standard: 200ms;
  --motion-duration-long: 300ms;
  --motion-duration-slow: 500ms;

  --motion-easing-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --motion-easing-decelerate: cubic-bezier(0, 0, 0.2, 1);
  --motion-easing-accelerate: cubic-bezier(0.4, 0, 1, 1);

  /* ==========================================================================
     Z-Index Scale
     ========================================================================== */
  --z-index-base: 0;
  --z-index-dropdown: 1000;
  --z-index-sticky: 1020;
  --z-index-fixed: 1030;
  --z-index-modal-backdrop: 1040;
  --z-index-modal: 1050;
  --z-index-popover: 1060;
  --z-index-tooltip: 1070;

  /* ==========================================================================
     Focus States
     ========================================================================== */
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;
  --focus-ring-color: var(--color-accent-primary);
}

/* Dark theme variant - can be applied with data-theme="dark" or class="dark" */
:root[data-theme="dark"],
.dark {
  --color-surface-canvas: #0f172a;
  --color-surface-primary: #1e293b;
  --color-surface-secondary: #334155;
  --color-surface-elevated: #1e293b;
  --color-surface-inverse: #f8fafc;

  --color-accent-primary: #60a5fa;
  --color-accent-muted: #1e40af;

  --color-text-primary: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-tertiary: #64748b;
  --color-text-inverse: #0f172a;
  --color-text-link: #60a5fa;

  --color-border-default: #334155;
  --color-border-subtle: #1e293b;
  --color-border-strong: #64748b;
  --color-border-focus: #60a5fa;

  --elevation-low: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --elevation-medium:
    0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --elevation-high:
    0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);

  /* Badge Colors - Dark mode WCAG 2.1 AA compliant */
  --color-badge-primary-bg: rgba(96, 165, 250, 0.2);
  --color-badge-primary-text: #93c5fd; /* blue-300: 8.59:1 contrast on dark bg */
  --color-badge-success-bg: rgba(74, 222, 128, 0.2);
  --color-badge-success-text: #86efac; /* green-300: 10.4:1 contrast on dark bg */
  --color-badge-warning-bg: rgba(251, 191, 36, 0.2);
  --color-badge-warning-text: #fcd34d; /* amber-300: 11.4:1 contrast on dark bg */
  --color-badge-danger-bg: rgba(248, 113, 113, 0.2);
  --color-badge-danger-text: #fca5a5; /* red-300: 9.18:1 contrast on dark bg */
  --color-badge-info-bg: rgba(96, 165, 250, 0.2);
  --color-badge-info-text: #93c5fd; /* blue-300: 8.59:1 contrast on dark bg */
}

/* ==========================================================================
   Sidebar Logo - matches quantierra-ui demo
   ========================================================================== */

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.sidebar-logo .logo-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
}

/* Light sidebar variant */
qre-sidebar[variant="light"] .logo-text {
  color: var(--color-text-primary);
}
