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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.component-block {
  user-select: none;
  -webkit-user-drag: element;
  backdrop-filter: blur(4px);
}

.circuit-board {
  background-color: #C8D8E4;
  position: relative;
  overflow: hidden;
}

.placed-component {
  user-select: none;
  backdrop-filter: blur(2px);
  transition: all 0.2s ease;
}

.placed-component:hover {
  transform: scale(1.05);
  z-index: 10;
}

.component-active {
  animation: glow-pulse 1.5s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.3);
  }
}

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

aside::-webkit-scrollbar-track {
  background: #ECF0F1;
  border-radius: 4px;
}

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

aside::-webkit-scrollbar-thumb:hover {
  background: #C54D29;
}

/* Grid overlay enhancement */
.circuit-board::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 1px 1px, rgba(44, 62, 80, 0.15) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Toast notification styles */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2C3E50;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: slide-in 0.3s ease;
  z-index: 1000;
}

@keyframes slide-in {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .circuit-board {
    transform: scale(0.8);
    transform-origin: top center;
  }
}

@media (max-width: 768px) {
  .circuit-board {
    transform: scale(0.6);
  }
}

/* Prevent text selection during drag */
.component-block, .placed-component {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Dieter Rams inspired brutalist spacing */
h1, h2, h3 {
  letter-spacing: -0.02em;
}

/* Button hover states */
button {
  cursor: pointer;
  transition: all 0.2s ease;
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modal animations */
.modal-backdrop {
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}