:root {
  --navy: #1e3a5f;
  --steel-blue: #4a7c9b;
  --accent-blue: #3b82f6;
  --emerald: #10b981;
  --amber: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.font-mono {
  font-family: 'IBM Plex Mono', monospace;
}

.bg-navy {
  background-color: var(--navy);
}

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

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

.bg-accent-blue {
  background-color: var(--accent-blue);
}

.border-accent-blue {
  border-color: var(--accent-blue);
}

.ring-accent-blue {
  --tw-ring-color: var(--accent-blue);
}

.focus\:ring-accent-blue:focus {
  --tw-ring-color: var(--accent-blue);
}

/* Canvas grid background */
.canvas-grid {
  background-color: #ffffff;
  background-image: 
    radial-gradient(circle, #cbd5e1 1px, transparent 1px);
  background-size: 20px 20px;
}

.dark .canvas-grid {
  background-color: #1f2937;
  background-image: 
    radial-gradient(circle, #374151 1px, transparent 1px);
}

/* Animations */
@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes confetti {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

@keyframes draw-line {
  from {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
  }
  to {
    stroke-dasharray: 1000;
    stroke-dashoffset: 0;
  }
}

.animate-slide-up {
  animation: slide-up 0.3s ease-out;
}

.animate-scale-in {
  animation: scale-in 0.2s ease-out;
}

.animate-confetti {
  animation: confetti 3s ease-out forwards;
}

.animate-draw-line {
  animation: draw-line 0.5s ease-out forwards;
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb {
  background: #4b5563;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

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

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

/* Mobile touch improvements */
@media (max-width: 1024px) {
  .canvas-grid {
    touch-action: pan-x pan-y;
  }
}

/* Tailwind dark mode */
.dark {
  color-scheme: dark;
}

/* Range input styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-blue);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.dark input[type="range"] {
  background: #374151;
}

/* Node hover effect */
.node-hover {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.node-hover:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

/* Button press effect */
button:active:not(:disabled) {
  transform: scale(0.98);
}

/* Tooltip styling */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: #1f2937;
  color: white;
  font-size: 12px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.tooltip:hover::after {
  opacity: 1;
}