/* ============================================
   Wayne Tech Agentic Portal - Main CSS
   Enterprise Gateway Design System
   Based on ui-ux-pro-max recommendations
   ============================================ */

/* Import Fonts - Plus Jakarta Sans (Enterprise Trust & Authority) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* CSS Custom Properties - Enterprise Gateway */
:root {
  /* Primary Colors - Navy Professional */
  --color-primary: #0F172A;
  --color-primary-hover: #1E293B;
  --color-primary-light: #334155;
  --color-secondary: #58B5F0;
  --color-on-primary: #FFFFFF;
  
  /* Accent Colors - Trust Blue */
  --color-accent: #0369A1;
  --color-accent-hover: #0284C7;
  --color-accent-light: #38BDF8;
  --color-on-accent: #FFFFFF;
  
  /* Background Colors */
  --bg-primary: #F8FAFC;
  --bg-secondary: #F1F5F9;
  --bg-tertiary: #E2E8F0;
  --bg-dark: #0F172A;
  
  /* Text Colors */
  --text-primary: #020617;
  --text-secondary: #475569;
  --text-tertiary: #64748B;
  --text-inverse: #F8FAFC;
  --text-muted: #94A3B8;
  
  /* Surface Colors */
  --surface-primary: #FFFFFF;
  --surface-secondary: rgba(255, 255, 255, 0.8);
  --surface-tertiary: rgba(255, 255, 255, 0.6);
  --surface-dark: rgba(15, 23, 42, 0.8);
  
  /* Glassmorphism - Enterprise Style */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-bg-dark: rgba(15, 23, 42, 0.85);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-border-dark: rgba(255, 255, 255, 0.1);
  --glass-blur: 16px;
  
  /* Glassmorphism Cards - Content Card Variant */
  --glass-card-bg: rgba(255, 255, 255, 0.85);
  --glass-card-border: rgba(255, 255, 255, 0.3);
  
  /* Status Colors - Enterprise Trust & Authority Palette */
  --color-success: #22C55E;
  --color-warning: #F59E0B;
  --color-error: #DC2626;
  --color-destructive: #DC2626;
  --color-info: #0369A1;
  --color-muted: #E8ECF1;
  --color-border: #E2E8F0;
  
  /* Agent Colors - Updated for better contrast */
  --color-researcher: #0369A1;
  --color-analyst: #059669;
  --color-copywriter: #D97706;
  --color-designer: #7C3AED;
  --color-validator: #DC2626;
  
  /* Typography - Plus Jakarta Sans for Enterprise Trust & Authority */
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;
  --font-size-5xl: 3rem;
  --font-size-6xl: 3.75rem;
  
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.2;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.75;
  
  --font-label-caps-letter-spacing: 0.1em;
  
  /* Spacing - 4px base */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  
  /* Section Layout */
  --section-padding-y: 5rem;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-3xl: 32px;
  --radius-full: 9999px;
  
  /* Shadows - Enterprise Elevation */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -1px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  --shadow-glow: 0 0 20px rgba(3, 105, 161, 0.3);
  
  /* Decorative Effects - Pre-Login Redesign */
  --glow-orb-color: rgba(3, 105, 161, 0.15);
  --hero-bg-gradient: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  --gradient-hero-text: linear-gradient(135deg, var(--color-accent), var(--color-accent-light), var(--color-secondary));
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Layout */
  --max-width: 1280px;
  --nav-height: 72px;
  --sidebar-width: 280px;
  --sidebar-collapsed: 80px;
  
  /* Z-index scale */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-nav: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-loading: 600;
}

/* Dark Mode - Enterprise Dark */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #020617;
    --bg-secondary: #0F172A;
    --bg-tertiary: #1E293B;
    
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-tertiary: #94A3B8;
    
    --surface-primary: #0F172A;
    --surface-secondary: rgba(15, 23, 42, 0.8);
    --surface-tertiary: rgba(30, 41, 59, 0.6);
    
    --glass-bg: rgba(15, 23, 42, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --glass-card-bg: rgba(15, 23, 42, 0.85);
    --glass-card-border: rgba(255, 255, 255, 0.3);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    
    --glow-orb-color: rgba(3, 105, 161, 0.25);
    --hero-bg-gradient: radial-gradient(ellipse at 50% 0%, #0F172A 0%, #020617 70%);
    --gradient-hero-text: linear-gradient(135deg, #bec6e0, #94ccff, #7bd0ff);
  }
}

/* Manual dark mode toggle class */
[data-theme="dark"] {
  --bg-primary: #020617;
  --bg-secondary: #0F172A;
  --bg-tertiary: #1E293B;
  
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-tertiary: #94A3B8;
  
  --surface-primary: #0F172A;
  --surface-secondary: rgba(15, 23, 42, 0.8);
  --surface-tertiary: rgba(30, 41, 59, 0.6);
  
  --glass-bg: rgba(15, 23, 42, 0.85);
  --glass-border: rgba(255, 255, 255, 0.1);
  
  --glass-card-bg: rgba(15, 23, 42, 0.85);
  --glass-card-border: rgba(255, 255, 255, 0.3);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  
  --glow-orb-color: rgba(3, 105, 161, 0.25);
  --hero-bg-gradient: radial-gradient(ellipse at 50% 0%, #0F172A 0%, #020617 70%);
  --gradient-hero-text: linear-gradient(135deg, #bec6e0, #94ccff, #7bd0ff);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography - Poppins for headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--font-size-5xl); }
h2 { font-size: var(--font-size-4xl); }
h3 { font-size: var(--font-size-3xl); }
h4 { font-size: var(--font-size-2xl); }
h5 { font-size: var(--font-size-xl); }
h6 { font-size: var(--font-size-lg); }

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

/* Lists */
ul, ol {
  list-style: none;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Buttons */
button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

/* Forms */
input, textarea, select {
  font-family: var(--font-body);
  font-size: inherit;
}

/* Focus styles - Enterprise */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background-color: var(--color-accent);
  color: var(--color-on-accent);
}

/* Scrollbar - Enterprise */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Utility Classes */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-fluid {
  width: 100%;
  padding: 0 var(--space-6);
}

/* Glass Card - Enterprise Style */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

/* Gradient Text - Enterprise Blue */
.gradient-text {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 50%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-loading);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-secondary);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Modal Container */
.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal-container.active {
  opacity: 1;
  visibility: visible;
}

/* Responsive Typography */
@media (max-width: 768px) {
  :root {
    --font-size-6xl: 2.5rem;
    --font-size-5xl: 2rem;
    --font-size-4xl: 1.75rem;
    --font-size-3xl: 1.5rem;
  }
  
  h1 { font-size: var(--font-size-4xl); }
  h2 { font-size: var(--font-size-3xl); }
  h3 { font-size: var(--font-size-2xl); }
}

/* Print styles */
@media print {
  .nav-container,
  .loading-overlay,
  .toast-container,
  .modal-container {
    display: none !important;
  }
}