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

body {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

#root {
  height: 100vh;
  width: 100vw;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #12122a;
}
::-webkit-scrollbar-thumb {
  background: #2a2a4a;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #4fc3f7;
}

/* CRT Scanlines */
.crt-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  z-index: 10;
}

.crt-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.3) 100%);
}

/* Matrix grid background */
.matrix-bg {
  background-image:
    linear-gradient(rgba(0, 255, 65, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 65, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Glass morphism */
.glass {
  background: rgba(26, 26, 46, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(79, 195, 247, 0.15);
}

.glass-strong {
  background: rgba(18, 18, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(79, 195, 247, 0.2);
}

/* Pulse animation for compile button */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 255, 65, 0.4); }
  50% { box-shadow: 0 0 20px rgba(0, 255, 65, 0.8), 0 0 40px rgba(0, 255, 65, 0.3); }
}

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

/* Spinner */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spin-slow {
  animation: spin-slow 1.5s linear infinite;
}

/* Tab animation */
.tab-enter {
  animation: tab-slide-in 0.2s ease-out;
}

@keyframes tab-slide-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Panel slide */
.panel-slide-left {
  transition: width 0.3s ease, opacity 0.3s ease;
}

.panel-slide-bottom {
  transition: height 0.3s ease, opacity 0.3s ease;
}

/* Address bar glow on focus */
.address-bar:focus-within {
  box-shadow: 0 0 0 2px rgba(0, 255, 255, 0.3), 0 0 15px rgba(0, 255, 255, 0.1);
}

/* Code editor textarea */
.code-textarea {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  tab-size: 2;
  resize: none;
  outline: none;
  background: transparent;
  color: #00ff41;
  caret-color: #0ff;
}

.code-textarea::selection {
  background: rgba(0, 255, 255, 0.25);
}

/* Line numbers */
.line-numbers {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #444466;
  user-select: none;
}

/* Hex dump styling */
.hex-cell {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

/* Error page wobble */
@keyframes wobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

.wobble {
  animation: wobble 0.5s ease-in-out;
}

/* Neon text glow */
.neon-text-cyan {
  text-shadow: 0 0 7px rgba(0, 255, 255, 0.6), 0 0 20px rgba(0, 255, 255, 0.3);
}

.neon-text-green {
  text-shadow: 0 0 7px rgba(0, 255, 65, 0.6), 0 0 20px rgba(0, 255, 65, 0.3);
}

/* Tooltip */
.tooltip-wat {
  position: relative;
}
.tooltip-wat::after {
  content: attr(data-tip);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: #222244;
  color: #ffb000;
  font-size: 11px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 50;
  border: 1px solid rgba(255, 176, 0, 0.3);
}
.tooltip-wat:hover::after {
  opacity: 1;
}

/* Canvas viewport */
.viewport-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Footer link */
.footer-link {
  color: #4fc3f7;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-link:hover {
  color: #0ff;
}

/* Compile status flash */
@keyframes flash-success {
  0% { background-color: rgba(0, 255, 65, 0.3); }
  100% { background-color: transparent; }
}
@keyframes flash-error {
  0% { background-color: rgba(255, 51, 102, 0.3); }
  100% { background-color: transparent; }
}
.flash-success { animation: flash-success 0.6s ease-out; }
.flash-error { animation: flash-error 0.6s ease-out; }