/* Synapse Canvas — Design Token System */

:root {
    /* Core Colors */
    --color-ocean-900: #0A4F4F;
    --color-ocean-500: #17C2C2;
    --color-coral-500: #FF6B6B;
    --color-charcoal-950: #000000;
    --color-charcoal-900: #0A0A0F;
    --color-charcoal-800: #141419;
    --color-charcoal-700: #1A1D21;
    --color-vermillion-500: #E85D04;
    --color-citron-500: #CCFF00;
    
    /* Agent Semantic Colors */
    --agent-autonomous: #F59E0B;
    --agent-human: #3B82F6;
    --agent-system: #64748B;
    --agent-execution: #10B981;
    
    /* Typography */
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-display: 'Space Grotesk', sans-serif;
    
    /* Motion */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-instant: 150ms;
    --duration-fast: 250ms;
    --duration-normal: 400ms;
    --duration-slow: 600ms;
    
    /* Z-Index Scale */
    --z-background: -1;
    --z-base: 0;
    --z-elevated: 10;
    --z-floating: 100;
    --z-overlay: 1000;
    --z-modal: 2000;
    --z-toast: 3000;
    
    /* Glow Effects */
    --glow-ocean: 0 0 20px rgba(23, 194, 194, 0.3);
    --glow-coral: 0 0 20px rgba(255, 107, 107, 0.3);
    --glow-citron: 0 0 20px rgba(204, 255, 0, 0.3);
    --glow-agent-autonomous: 0 0 15px rgba(245, 158, 11, 0.4);
    --glow-agent-human: 0 0 15px rgba(59, 130, 246, 0.4);
    --glow-agent-execution: 0 0 15px rgba(16, 185, 129, 0.4);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--color-charcoal-950);
    color: #A1A1AA;
    line-height: 1.5;
    overflow: hidden;
}

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

::-webkit-scrollbar-track {
    background: var(--color-charcoal-900);
}

::-webkit-scrollbar-thumb {
    background: var(--color-charcoal-700);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-charcoal-600);
}

/* Selection */
::selection {
    background: rgba(23, 194, 194, 0.3);
    color: white;
}

/* Focus States */
:focus-visible {
    outline: 2px solid var(--color-ocean-500);
    outline-offset: 2px;
}

/* Agent Node Base Styles */
.agent-node {
    position: absolute;
    width: 280px;
    transition: all var(--duration-fast) var(--ease-spring);
    transform-origin: center center;
}

.agent-node:hover {
    z-index: var(--z-floating);
}

.agent-node.focused {
    z-index: calc(var(--z-floating) + 10);
}

.agent-node.wireframe {
    opacity: 0.6;
}

.agent-node.wireframe .node-content {
    background: transparent;
    border-style: dashed;
}

/* Glassmorphism Base */
.glass {
    background: rgba(20, 20, 25, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-strong {
    background: rgba(26, 29, 33, 0.95);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Connection Lines */
.connection-line {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: stroke;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.connection-line:hover {
    stroke-width: 4;
    filter: url(#glow);
}

.connection-line.active {
    animation: dataPulse 1s ease-in-out infinite;
}

@keyframes dataPulse {
    0%, 100% { stroke-opacity: 0.4; }
    50% { stroke-opacity: 1; }
}

/* Data Flow Particles */
.data-particle {
    fill: var(--color-citron-500);
    filter: url(#glow);
    animation: flowAlongPath 2s linear infinite;
}

@keyframes flowAlongPath {
    0% { offset-distance: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

/* Neural Pulse Animation */
.neural-pulse {
    position: relative;
}

.neural-pulse::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: inherit;
    opacity: 0;
    animation: pulseRing 2s ease-out infinite;
    z-index: -1;
}

@keyframes pulseRing {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Agent Avatar Geometries */
.agent-avatar {
    width: 48px;
    height: 48px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agent-avatar::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, currentColor 0%, transparent 50%);
    opacity: 0.3;
}

.agent-avatar.autonomous {
    color: var(--agent-autonomous);
}

.agent-avatar.human {
    color: var(--agent-human);
    border-radius: 50%;
}

.agent-avatar.system {
    color: var(--agent-system);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.agent-avatar.execution {
    color: var(--agent-execution);
    border-radius: 4px;
    transform: rotate(45deg);
}

.agent-avatar.execution > * {
    transform: rotate(-45deg);
}

/* Activity Indicators */
.activity-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.activity-indicator.active {
    animation: activityBlink 1.5s ease-in-out infinite;
}

.activity-indicator.processing {
    animation: activitySpin 1s linear infinite;
}

@keyframes activityBlink {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes activitySpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tension Zone (Conflict) */
.tension-zone {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, 
        rgba(232, 93, 4, 0.2) 0%,
        rgba(255, 107, 107, 0.1) 40%,
        transparent 70%
    );
    animation: tensionPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes tensionPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }