/* ============================================================
   QUANTRA TERMINAL - MINIMAL PRO THEME
   Clean Professional Design for Trading
   ============================================================ */

:root {
  /* Backgrounds - Darker for better contrast */
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-alt: #334155;
  --surface-hover: #475569;
  --surface-active: #64748b;
  
  /* Borders */
  --border: #334155;
  --border-light: #475569;
  --border-dark: #1e293b;
  --border-focus: #3b82f6;
  
  /* Text - Light for dark background */
  --text: #f1f5f9;
  --text-dim: #cbd5e1;
  --text-vdim: #94a3b8;
  --text-bright: #ffffff;
  --text-muted: #64748b;
  
  /* Accent - Bright blue for visibility */
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-soft: rgba(59, 130, 246, 0.15);
  
  /* Semantic Colors - Vibrant and visible */
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.15);
  --green-text: #34d399;
  --green-hover: #059669;
  
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.15);
  --red-text: #f87171;
  --red-hover: #dc2626;
  
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.15);
  --blue-text: #60a5fa;
  
  --orange: #f97316;
  --orange-soft: rgba(249, 115, 22, 0.15);
  
  --purple: #a855f7;
  --purple-soft: rgba(168, 85, 247, 0.15);
  
  --yellow: #eab308;
  --yellow-soft: rgba(234, 179, 8, 0.15);
  
  /* Layout */
  --nav-height: 64px;
  --sidebar-width: 280px;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Shadows - More prominent for depth */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.7);
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', 'Cascadia Code', monospace;
  
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 24px;
  --fs-3xl: 32px;
  --fs-4xl: 40px;
  
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;
  
  --lh-tight: 1.25;
  --lh-normal: 1.5;
  --lh-relaxed: 1.75;
  
  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  
  /* Transitions */
  --transition-fast: 0.1s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
}

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

html {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  min-height: 100vh;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

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

/* Selection */
::selection {
  background: var(--accent-soft);
  color: var(--text-bright);
}

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

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

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--text-bright);
  letter-spacing: -0.01em;
}

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

/* Navigation */
.q-nav {
  height: var(--nav-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.q-nav-logo {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-bright);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.q-nav-links {
  display: flex;
  gap: var(--space-6);
  margin-left: var(--space-8);
  list-style: none;
}

.q-nav-link {
  color: var(--text-dim);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.q-nav-link:hover,
.q-nav-link.active {
  color: var(--text-bright);
}

.q-nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Cards */
.q-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: all var(--transition-base);
}

.q-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.q-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-light);
}

.q-card-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.q-card-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--surface);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
}

/* Buttons */
.q-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--accent);
  color: var(--surface);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.q-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.q-btn:active {
  transform: translateY(0);
}

.q-btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.q-btn-ghost:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.q-btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
}

.q-btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--fs-lg);
}

/* Inputs */
.q-input,
.q-select,
.q-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  font-family: var(--font-sans);
  color: var(--text);
  transition: all var(--transition-fast);
}

.q-input:hover,
.q-select:hover,
.q-textarea:hover {
  border-color: var(--border-dark);
}

.q-input:focus,
.q-select:focus,
.q-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.q-input::placeholder {
  color: var(--text-muted);
}

/* Tables */
.q-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.q-table thead {
  background: var(--surface-alt);
  border-bottom: 2px solid var(--border);
}

.q-table th {
  text-align: left;
  padding: var(--space-4);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.q-table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: var(--fs-base);
}

.q-table tbody tr:hover {
  background: var(--surface-hover);
}

.q-table tbody tr:last-child td {
  border-bottom: none;
}

/* Badges */
.q-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.q-badge-success {
  background: var(--green-soft);
  color: var(--green-text);
  border-color: var(--green);
}

.q-badge-danger {
  background: var(--red-soft);
  color: var(--red-text);
  border-color: var(--red);
}

.q-badge-warning {
  background: var(--orange-soft);
  color: var(--orange);
  border-color: var(--orange);
}

.q-badge-info {
  background: var(--blue-soft);
  color: var(--blue-text);
  border-color: var(--blue);
}

/* Stats */
.q-stat-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.q-stat-label {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--fw-medium);
}

.q-stat-value {
  font-family: var(--font-mono);
  font-size: var(--fs-3xl);
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
  line-height: 1;
}

.q-stat-change {
  font-family: var(--font-mono);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  margin-top: var(--space-2);
}

.q-stat-change.positive {
  color: var(--green);
}

.q-stat-change.negative {
  color: var(--red);
}

/* Utilities */
.text-xs { font-size: var(--fs-xs); }
.text-sm { font-size: var(--fs-sm); }
.text-base { font-size: var(--fs-base); }
.text-lg { font-size: var(--fs-lg); }
.text-xl { font-size: var(--fs-xl); }

.font-mono { font-family: var(--font-mono); }
.font-medium { font-weight: var(--fw-medium); }
.font-semibold { font-weight: var(--fw-semibold); }
.font-bold { font-weight: var(--fw-bold); }

.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-bright { color: var(--text-bright); }

.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-blue { color: var(--blue); }

.bg-surface { background: var(--surface); }
.bg-surface-alt { background: var(--surface-alt); }

.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

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

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* Responsive */
@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
    --fs-4xl: 32px;
    --fs-3xl: 24px;
    --fs-2xl: 20px;
  }
  
  .q-nav {
    padding: 0 var(--space-4);
  }
  
  .q-nav-links {
    display: none;
  }
  
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
  
  .q-card {
    padding: var(--space-6);
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease;
}

.animate-slideUp {
  animation: slideUp 0.3s ease;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
