/* ==========================================================================
   MATIS AGENTIC (CRYPTO FUTURES EDITION) - INSTITUTIONAL TRADING SYSTEM CSS
   Design System: Deep Space Glassmorphism, Neon Accents, Ultra-Crisp Typography
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #070b14;
  --bg-secondary: #0b1120;
  --bg-card: rgba(13, 20, 36, 0.75);
  --bg-card-hover: rgba(18, 28, 50, 0.85);
  --bg-card-active: rgba(24, 38, 68, 0.95);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(56, 189, 248, 0.3);
  --border-glow: rgba(56, 189, 248, 0.15);

  /* Curated Harmonious Palette */
  --cyan-primary: #0ea5e9;
  --cyan-glow: #38bdf8;
  --emerald-pnl: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.2);
  --rose-pnl: #f43f5e;
  --rose-glow: rgba(244, 63, 94, 0.2);
  --amber-warn: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.2);
  --violet-agent: #8b5cf6;
  --indigo-accent: #6366f1;

  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-dim: #64748b;
  --text-highlight: #ffffff;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.10) 0px, transparent 45%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
    linear-gradient(to bottom, #070b14, #0b1120);
  background-attachment: fixed;
  line-height: 1.5;
}

.font-mono {
  font-family: var(--font-mono);
}

/* Glassmorphism Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
  border-color: var(--border-glow);
  box-shadow: 0 8px 30px -2px rgba(0, 0, 0, 0.65), 0 0 15px rgba(56, 189, 248, 0.06);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(7, 11, 20, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cyan-primary);
}

/* Animations & Badges */
@keyframes pulseDot {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 12px currentColor; }
}

.live-pulse {
  animation: pulseDot 2s infinite ease-in-out;
}

/* Shimmer on update */
@keyframes flashGreen {
  0% { background-color: rgba(16, 185, 129, 0.3); }
  100% { background-color: transparent; }
}
@keyframes flashRed {
  0% { background-color: rgba(244, 63, 94, 0.3); }
  100% { background-color: transparent; }
}

.flash-up {
  animation: flashGreen 0.8s ease-out;
}
.flash-down {
  animation: flashRed 0.8s ease-out;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #4f46e5);
  color: #ffffff;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.025em;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.3);
  cursor: pointer;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.45);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: rgba(18, 28, 50, 0.8);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  transition: all 0.2s ease;
  cursor: pointer;
}
.btn-secondary:hover {
  background: rgba(30, 41, 59, 0.9);
  color: var(--text-main);
  border-color: var(--border-highlight);
}

/* Modal and Drawer Transitions */
.modal-overlay {
  background-color: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.25s ease-out;
}

.drawer-content {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Canvas Graph Container */
#chart-canvas-container {
  position: relative;
  width: 100%;
  height: 320px;
}

#chart-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Tooltip on graph */
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #f8fafc;
  z-index: 20;
  display: none;
  transform: translate(-50%, -115%);
}

/* Table Styles */
.trade-table-row {
  transition: background-color 0.15s ease;
}
.trade-table-row:hover {
  background-color: rgba(30, 41, 59, 0.45);
}

/* Badges */
.badge-buy {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-sell {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}
.badge-hold {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.badge-vetoed {
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.3);
}
.badge-clean {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
