/*
 * Solverly Design Tokens
 * =====================
 * CSS variables aligned with landing.html color palette
 * This is the single source of truth for all colors in the app
 */

:root {
  /* ========================
   * BACKGROUNDS
   * Aligned with landing.html
   * ======================== */
  --bg-deep: #09090b;
  --bg-primary: #0a0a0f;      /* Same as landing --bg-dark */
  --bg-secondary: #12121a;    /* Same as landing --bg-card */
  --bg-elevated: #1a1a24;
  --bg-card-alt: #0d0d14;     /* Same as landing --bg-card-alt */
  --bg-overlay: rgba(0, 0, 0, 0.7);  /* Dark overlay for image captions, modals */

  /* ========================
   * BORDERS
   * ======================== */
  --border: #27272a;
  --border-subtle: #1e1e28;
  --border-hover: #3f3f46;

  /* ========================
   * TEXT
   * Aligned with landing.html
   * ======================== */
  --text-primary: #ffffff;    /* Same as landing */
  --text-secondary: #94a3b8;  /* Same as landing */
  --text-muted: #64748b;      /* Same as landing */
  --text-inverse: #0a0a0f;

  /* ========================
   * ACCENT COLORS
   * ALIGNED WITH LANDING PAGE
   * ======================== */
  --accent: #00d4aa;          /* Same as landing --accent-primary (teal) */
  --accent-hover: #00b894;
  --accent-soft: rgba(0, 212, 170, 0.12);
  --accent-secondary: #6366f1; /* Same as landing --accent-secondary (indigo) */
  --accent-secondary-hover: #4f46e5;
  --accent-secondary-soft: rgba(99, 102, 241, 0.12);

  /* ========================
   * ROLE COLORS
   * For distinguishing user roles in UI
   * ======================== */
  --reporter: #00d4aa;        /* Teal - matches brand accent */
  --reporter-soft: rgba(0, 212, 170, 0.15);
  --reporter-border: rgba(0, 212, 170, 0.4);

  --controller: #8b5cf6;      /* Purple */
  --controller-soft: rgba(139, 92, 246, 0.15);
  --controller-border: rgba(139, 92, 246, 0.4);

  --solver: #3b82f6;          /* Blue */
  --solver-soft: rgba(59, 130, 246, 0.15);
  --solver-border: rgba(59, 130, 246, 0.4);

  --system: #52525b;          /* Gray */
  --system-soft: rgba(82, 82, 91, 0.3);
  --system-border: rgba(82, 82, 91, 0.5);

  /* ========================
   * PRIORITY COLORS
   * Aligned with landing semantic colors
   * ======================== */
  --priority-high: #ef4444;   /* Same as landing --accent-danger */
  --priority-high-soft: rgba(239, 68, 68, 0.2);
  --priority-high-border: rgba(239, 68, 68, 0.4);

  --priority-medium: #f59e0b; /* Same as landing --accent-warning */
  --priority-medium-soft: rgba(245, 158, 11, 0.2);
  --priority-medium-border: rgba(245, 158, 11, 0.4);

  --priority-low: #00d4aa;    /* Teal - matches brand accent */
  --priority-low-soft: rgba(0, 212, 170, 0.2);
  --priority-low-border: rgba(0, 212, 170, 0.4);

  --priority-project: #6366f1; /* Indigo - matches secondary */
  --priority-project-soft: rgba(99, 102, 241, 0.2);
  --priority-project-border: rgba(99, 102, 241, 0.4);

  /* ========================
   * STATUS COLORS
   * ======================== */
  --status-open: #00d4aa;
  --status-open-soft: rgba(0, 212, 170, 0.15);
  --status-pending: #f59e0b;
  --status-pending-soft: rgba(245, 158, 11, 0.15);
  --status-closed: #52525b;
  --status-closed-soft: rgba(82, 82, 91, 0.15);
  --status-escalated: #ef4444;
  --status-escalated-soft: rgba(239, 68, 68, 0.15);

  /* ========================
   * SEMANTIC COLORS
   * ======================== */
  --success: #00d4aa;
  --success-soft: rgba(0, 212, 170, 0.15);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.15);
  --info: #3b82f6;
  --info-soft: rgba(59, 130, 246, 0.15);

  /* ========================
   * GRADIENTS
   * From landing.html
   * ======================== */
  --gradient-hero: linear-gradient(135deg, #00d4aa 0%, #6366f1 100%);
  --gradient-cta: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f59e0b 100%);
  --gradient-accent-soft: linear-gradient(135deg, rgba(0, 212, 170, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);

  /* ========================
   * LAYOUT
   * ======================== */
  --header-height: 56px;
  --sidebar-width: 320px;
  --sidebar-collapsed: 0px;
  --container-max: 1400px;
  --border-radius-sm: 6px;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --border-radius-xl: 16px;

  /* ========================
   * SPACING
   * ======================== */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* ========================
   * TYPOGRAPHY
   * ======================== */
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', monospace;

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

  /* ========================
   * SHADOWS
   * ======================== */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow-accent: 0 0 20px rgba(0, 212, 170, 0.3);
  --shadow-glow-danger: 0 0 20px rgba(239, 68, 68, 0.3);

  /* ========================
   * TRANSITIONS
   * ======================== */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-panel: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ========================
   * Z-INDEX LAYERS
   * ======================== */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
}

/* ========================
 * LIGHT THEME OVERRIDES
 * ======================== */
[data-theme="light"] {
  /* Backgrounds */
  --bg-deep: #f8fafc;
  --bg-primary: #ffffff;
  --bg-secondary: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-card-alt: #f8fafc;
  --bg-overlay: rgba(0, 0, 0, 0.6);  /* Dark overlay for image captions, modals */

  /* Borders */
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-hover: #cbd5e1;

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  /* Shadows - subtle instead of glowing */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-glow-accent: 0 2px 12px rgba(0, 212, 170, 0.15);
  --shadow-glow-danger: 0 2px 12px rgba(239, 68, 68, 0.15);

  /* Soft backgrounds - adjusted for light theme */
  --accent-soft: rgba(0, 212, 170, 0.1);
  --accent-secondary-soft: rgba(99, 102, 241, 0.1);
  --reporter-soft: rgba(0, 212, 170, 0.1);
  --controller-soft: rgba(139, 92, 246, 0.1);
  --solver-soft: rgba(59, 130, 246, 0.1);
  --system-soft: rgba(82, 82, 91, 0.08);
  --priority-high-soft: rgba(239, 68, 68, 0.1);
  --priority-medium-soft: rgba(245, 158, 11, 0.1);
  --priority-low-soft: rgba(0, 212, 170, 0.1);
  --priority-project-soft: rgba(99, 102, 241, 0.1);
  --status-open-soft: rgba(0, 212, 170, 0.1);
  --status-pending-soft: rgba(245, 158, 11, 0.1);
  --status-closed-soft: rgba(82, 82, 91, 0.08);
  --status-escalated-soft: rgba(239, 68, 68, 0.1);
  --success-soft: rgba(0, 212, 170, 0.1);
  --warning-soft: rgba(245, 158, 11, 0.1);
  --danger-soft: rgba(239, 68, 68, 0.1);
  --info-soft: rgba(59, 130, 246, 0.1);

  /* Gradient adjustment for light theme */
  --gradient-accent-soft: linear-gradient(135deg, rgba(0, 212, 170, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
}

/* ========================
 * BASE RESETS
 * ======================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

/* ========================
 * UTILITY CLASSES
 * ======================== */

/* Text Colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }

/* Background Colors */
.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-elevated { background-color: var(--bg-elevated); }
.bg-accent { background-color: var(--accent); }
.bg-accent-soft { background-color: var(--accent-soft); }

/* Role Background Colors */
.bg-reporter { background-color: var(--reporter); }
.bg-reporter-soft { background-color: var(--reporter-soft); }
.bg-controller { background-color: var(--controller); }
.bg-controller-soft { background-color: var(--controller-soft); }
.bg-solver { background-color: var(--solver); }
.bg-solver-soft { background-color: var(--solver-soft); }
.bg-system { background-color: var(--system); }
.bg-system-soft { background-color: var(--system-soft); }

/* Priority Background Colors */
.bg-HIGH { background-color: var(--priority-high) !important; color: white !important; }
.bg-MEDIUM { background-color: var(--priority-medium) !important; color: white !important; }
.bg-LOW { background-color: var(--priority-low) !important; color: var(--text-inverse) !important; }
.bg-PROJECT { background-color: var(--priority-project) !important; color: white !important; }

/* Border Utilities */
.border-subtle { border-color: var(--border-subtle); }
.border-accent { border-color: var(--accent); }

/* Gradient Text */
.text-gradient {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Theme transition */
html, html *, html *::before, html *::after {
    transition: background-color 300ms ease, color 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}
html.no-transition, html.no-transition *, html.no-transition *::before, html.no-transition *::after {
    transition: none !important;
}
