/* ========================================
   Marketplace Analytics Design Tokens
   CSS Custom Properties (Variables)
   ======================================== */

/* ========================================
   Base / Design Tokens (theme-agnostic)
   ======================================== */
:root {
  /* Border Radius */
  --ma-border-radius-sm: 4px;
  --ma-border-radius-md: 6px;
  --ma-border-radius-lg: 8px;
  --ma-border-radius-xl: 12px;
  --ma-border-radius-pill: 9999px;

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

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

  /* Font Stack */
  --ma-font-stack: "MontserratRegular", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Font Sizes */
  --ma-font-size-xs: 0.6875rem;
  --ma-font-size-sm: 0.75rem;
  --ma-font-size-base: 0.875rem;
  --ma-font-size-md: 1rem;
  --ma-font-size-lg: 1.125rem;

  /* Letter Spacing */
  --ma-letter-spacing-tight: -0.02em;
  --ma-letter-spacing-normal: -0.01em;
  --ma-letter-spacing-wide: 0.025em;
}

/* ========================================
   Light Theme (Default)
   ======================================== */
[data-theme="light"],
:root {
  /* Backgrounds */
  --ma-bg-primary: #f5f7fa;
  --ma-bg-secondary: #ffffff;
  --ma-bg-tertiary: #f9fafb;
  --ma-bg-quaternary: #f8fafc;
  --ma-bg-hover: #f3f4f6;
  --ma-bg-hover-light: #f8f9fa;
  --ma-bg-active: #374151;
  --ma-bg-active-hover: #4b5563;
  --ma-bg-input: #f9fafb;
  --ma-bg-input-focus: #ffffff;
  --ma-bg-overlay: rgba(0, 0, 0, 0.7);
  --ma-bg-tooltip: #1f2937;
  --ma-bg-badge: rgba(255, 255, 255, 0.98);

  /* Borders */
  --ma-border-primary: #e5e7eb;
  --ma-border-secondary: #e2e8f0;
  --ma-border-tertiary: #d1d5db;
  --ma-border-light: #e9ecef;
  --ma-border-medium: #dee2e6;
  --ma-border-focus: #3b82f6;

  /* Text */
  --ma-text-primary: #1f2937;
  --ma-text-secondary: #374151;
  --ma-text-tertiary: #495057;
  --ma-text-muted: #6b7280;
  --ma-text-muted-light: #9ca3af;
  --ma-text-extra-muted: #6c757d;
  --ma-text-inverse: #ffffff;
  --ma-text-dark: #111827;
  --ma-text-deep: #0f172a;
  --ma-text-soft: #666666;
  --ma-text-faded: #999999;
  --ma-text-body: #2d2d2d;

  /* Primary / Accent */
  --ma-primary: #2563eb;
  --ma-primary-hover: #1d4ed8;
  --ma-primary-light: rgba(37, 99, 235, 0.1);
  --ma-primary-focus-ring: rgba(59, 130, 246, 0.15);

  /* Status / Trend */
  --ma-trend-positive: #16a34a;
  --ma-trend-negative: #dc2626;
  --ma-profit-positive: #059669;
  --ma-change-accent: #ff6b35;

  /* Group Colors */
  --ma-group-profit: #66bb6a;
  --ma-group-expenses: #ef5350;
  --ma-group-analytics: #42a5f5;

  /* Badge Colors */
  --ma-badge-success-bg: #dcfce7;
  --ma-badge-success-text: #166534;
  --ma-badge-warning-bg: #fef3c7;
  --ma-badge-warning-text: #92400e;
  --ma-badge-error-bg: #fef2f2;
  --ma-badge-error-text: #991b1b;
  --ma-badge-info-bg: #dbeafe;
  --ma-badge-info-text: #1e40af;
  --ma-badge-secondary-bg: #e2e3e5;
  --ma-badge-secondary-text: #383d41;
  --ma-badge-success-alt-bg: #d4edda;
  --ma-badge-success-alt-text: #155724;

  /* Card Gradients */
  --ma-card-gradient-green: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  --ma-card-gradient-red: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
  --ma-card-gradient-blue: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);

  /* Font Card Gradients */
  --ma-fontcard-gradient-positive: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  --ma-fontcard-gradient-negative: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  --ma-fontcard-gradient-default: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);

  /* Delta Backgrounds */
  --ma-delta-positive-bg: rgba(102, 187, 106, 0.15);
  --ma-delta-negative-bg: rgba(239, 83, 80, 0.15);
  --ma-delta-neutral-bg: rgba(66, 165, 245, 0.15);

  /* Color Strips */
  --ma-strip-profit: #66bb6a;
  --ma-strip-expenses: #ef5350;
  --ma-strip-analytics: #42a5f5;

  /* Error UI */
  --ma-error-ui-bg: #1d1e1c;
  --ma-error-ui-text: #ffffff;
  --ma-error-boundary-bg: #b32121;

  /* Shadows */
  --ma-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --ma-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --ma-shadow-card: 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --ma-shadow-card-hover: 0 12px 24px rgba(0, 0, 0, 0.15), 0 6px 12px rgba(0, 0, 0, 0.1);
  --ma-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
  --ma-shadow-below: 0 -1px 2px rgba(0, 0, 0, 0.2);
  --ma-shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.1);
  --ma-shadow-badge: 0 1px 3px rgba(0, 0, 0, 0.1);

  /* Login */
  --ma-login-form-bg: #f5f7fa;
  --ma-login-alert-bg: #f3f4f6;
  --ma-login-alert-text: #6b7280;
  --ma-login-alert-error-bg: #fef2f2;
  --ma-login-alert-error-text: #dc2626;
  --ma-login-alert-error-border: #fecaca;
  --ma-login-input-border: #d1d5db;
  --ma-login-input-focus-border: #9ca3af;
  --ma-login-input-focus-ring: rgba(156, 163, 175, 0.2);
  --ma-login-button-bg: #6b7280;
  --ma-login-button-hover: #4b5563;
  --ma-login-button-focus-ring: rgba(107, 114, 128, 0.3);
  --ma-login-button-disabled: #d1d5db;

  /* Notification */
  --ma-notification-dropdown-bg: #ffffff;
  --ma-notification-dropdown-border: #e5e7eb;
  --ma-notification-item-border: #e5e7eb;
  --ma-notification-item-hover: #f9fafb;
  --ma-notification-count-bg: #dc2626;
  --ma-notification-count-text: #ffffff;
  --ma-notification-placeholder: #6b7280;
  --ma-notification-sticky-bg: #ffffff;
  --ma-notification-sticky-text: #1f2937;
}

/* ========================================
   Dark Theme
   ======================================== */
[data-theme="dark"] {
  /* Backgrounds */
  --ma-bg-primary: #0f1117;
  --ma-bg-secondary: #1a1d24;
  --ma-bg-tertiary: #1f222b;
  --ma-bg-quaternary: #16181f;
  --ma-bg-hover: #252830;
  --ma-bg-hover-light: #2d3139;
  --ma-bg-active: #334155;
  --ma-bg-active-hover: #475569;
  --ma-bg-input: #1f222b;
  --ma-bg-input-focus: #2d3139;
  --ma-bg-overlay: rgba(0, 0, 0, 0.85);
  --ma-bg-tooltip: #0f1117;
  --ma-bg-badge: rgba(30, 35, 45, 0.98);

  /* Borders */
  --ma-border-primary: #2d3139;
  --ma-border-secondary: #2a2e37;
  --ma-border-tertiary: #3d4350;
  --ma-border-light: #2a2e37;
  --ma-border-medium: #3d4350;
  --ma-border-focus: #3b82f6;

  /* Text */
  --ma-text-primary: #ececf1;
  --ma-text-secondary: #c7c8d0;
  --ma-text-tertiary: #9ca0aa;
  --ma-text-muted: #8a8d96;
  --ma-text-muted-light: #6b7280;
  --ma-text-extra-muted: #6b7280;
  --ma-text-inverse: #e2e8f0;
  --ma-text-dark: #f1f5f9;
  --ma-text-deep: #ececf1;
  --ma-text-soft: #9ca0aa;
  --ma-text-faded: #6b7280;
  --ma-text-body: #c7c8d0;

  /* Primary / Accent */
  --ma-primary: #3b82f6;
  --ma-primary-hover: #60a5fa;
  --ma-primary-light: rgba(59, 130, 246, 0.15);
  --ma-primary-focus-ring: rgba(59, 130, 246, 0.25);

  /* Status / Trend */
  --ma-trend-positive: #34d399;
  --ma-trend-negative: #f87171;
  --ma-profit-positive: #34d399;
  --ma-change-accent: #fb923c;

  /* Group Colors */
  --ma-group-profit: #66bb6a;
  --ma-group-expenses: #ef5350;
  --ma-group-analytics: #42a5f5;

  /* Badge Colors */
  --ma-badge-success-bg: #064e3b;
  --ma-badge-success-text: #a7f3d0;
  --ma-badge-warning-bg: #78350f;
  --ma-badge-warning-text: #fde68a;
  --ma-badge-error-bg: #7f1d1d;
  --ma-badge-error-text: #fecaca;
  --ma-badge-info-bg: #1e3a8a;
  --ma-badge-info-text: #bfdbfe;
  --ma-badge-secondary-bg: #374151;
  --ma-badge-secondary-text: #d1d5db;
  --ma-badge-success-alt-bg: #064e3b;
  --ma-badge-success-alt-text: #a7f3d0;

  /* Card Gradients */
  --ma-card-gradient-green: linear-gradient(135deg, #1a472a 0%, #14522d 100%);
  --ma-card-gradient-red: linear-gradient(135deg, #471a2a 0%, #521428 100%);
  --ma-card-gradient-blue: linear-gradient(135deg, #1a3a47 0%, #142852 100%);

  /* Font Card Gradients (darker / more saturated) */
  --ma-fontcard-gradient-positive: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  --ma-fontcard-gradient-negative: linear-gradient(135deg, #c2415c 0%, #b91c1c 100%);
  --ma-fontcard-gradient-default: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);

  /* Delta Backgrounds */
  --ma-delta-positive-bg: rgba(102, 187, 106, 0.2);
  --ma-delta-negative-bg: rgba(239, 83, 80, 0.2);
  --ma-delta-neutral-bg: rgba(66, 165, 245, 0.2);

  /* Color Strips */
  --ma-strip-profit: #66bb6a;
  --ma-strip-expenses: #ef5350;
  --ma-strip-analytics: #42a5f5;

  /* Error UI */
  --ma-error-ui-bg: #050505;
  --ma-error-ui-text: #ececf1;
  --ma-error-boundary-bg: #7f1d1d;

  /* Shadows */
  --ma-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --ma-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
  --ma-shadow-card: 0 2px 4px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --ma-shadow-card-hover: 0 12px 24px rgba(0, 0, 0, 0.4), 0 6px 12px rgba(0, 0, 0, 0.3);
  --ma-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
  --ma-shadow-below: 0 -1px 2px rgba(0, 0, 0, 0.3);
  --ma-shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.25);
  --ma-shadow-badge: 0 1px 3px rgba(0, 0, 0, 0.25);

  /* Login */
  --ma-login-form-bg: #0f1117;
  --ma-login-alert-bg: #1f222b;
  --ma-login-alert-text: #c7c8d0;
  --ma-login-alert-error-bg: #471818;
  --ma-login-alert-error-text: #fca5a5;
  --ma-login-alert-error-border: #7f1d1d;
  --ma-login-input-border: #2d3139;
  --ma-login-input-focus-border: #4b5563;
  --ma-login-input-focus-ring: rgba(75, 85, 99, 0.3);
  --ma-login-button-bg: #374151;
  --ma-login-button-hover: #4b5563;
  --ma-login-button-focus-ring: rgba(55, 65, 81, 0.5);
  --ma-login-button-disabled: #2d3139;

  /* Notification */
  --ma-notification-dropdown-bg: #1a1d24;
  --ma-notification-dropdown-border: #2d3139;
  --ma-notification-item-border: #2d3139;
  --ma-notification-item-hover: #252830;
  --ma-notification-count-bg: #f87171;
  --ma-notification-count-text: #1a1d24;
  --ma-notification-placeholder: #8a8d96;
  --ma-notification-sticky-bg: #1a1d24;
  --ma-notification-sticky-text: #ececf1;
}
