/* CRT Scanline overlay */
.crt-overlay {
  position: relative;
}
.crt-overlay::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* CRT screen curvature effect */
.crt-screen {
  border-radius: 8px;
  box-shadow:
    inset 0 0 60px rgba(0, 255, 0, 0.03),
    inset 0 0 4px rgba(0, 255, 0, 0.05),
    0 0 8px rgba(0, 0, 0, 0.5);
}

/* Phosphor glow text */
.phosphor-glow {
  text-shadow:
    0 0 5px rgba(51, 255, 51, 0.5),
    0 0 10px rgba(51, 255, 51, 0.3),
    0 0 20px rgba(51, 255, 51, 0.15);
}

.cyan-glow {
  text-shadow:
    0 0 5px rgba(0, 255, 255, 0.5),
    0 0 10px rgba(0, 255, 255, 0.3);
}

.amber-glow {
  text-shadow:
    0 0 5px rgba(255, 170, 0, 0.5),
    0 0 10px rgba(255, 170, 0, 0.3);
}

/* Compile button pulse */
@keyframes compilePulse {
  0% { box-shadow: 0 0 5px rgba(51, 255, 51, 0.3); }
  50% { box-shadow: 0 0 25px rgba(51, 255, 51, 0.6), 0 0 50px rgba(51, 255, 51, 0.2); }
  100% { box-shadow: 0 0 5px rgba(51, 255, 51, 0.3); }
}

.compile-pulse {
  animation: compilePulse 0.6s ease-out;
}

/* Flickering cursor effect */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.cursor-blink {
  animation: blink 1s step-end infinite;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
  background: #1a3a1a;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #2a5a2a;
}

/* Textarea styling */
textarea {
  tab-size: 2;
}

/* Line numbers */
.line-numbers {
  counter-reset: line;
}
.line-numbers span {
  counter-increment: line;
}
.line-numbers span::before {
  content: counter(line);
  display: inline-block;
  width: 3em;
  text-align: right;
  padding-right: 0.5em;
  color: #3a5a3a;
  border-right: 1px solid #1a2a1a;
  margin-right: 0.5em;
}

/* Slide-in sidebar */
.sidebar-enter {
  transform: translateX(100%);
  transition: transform 0.3s ease-out;
}
.sidebar-visible {
  transform: translateX(0);
}

/* Console drawer */
.console-drawer {
  transition: max-height 0.3s ease-out;
  overflow: hidden;
}

/* Hex dump styling */
.hex-byte {
  display: inline-block;
  width: 2.2ch;
  text-align: center;
}

/* Z80 chip animation */
@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.chip-float {
  animation: chipFloat 3s ease-in-out infinite;
}

/* Error line highlight */
.error-line {
  background: rgba(255, 51, 51, 0.15);
  border-left: 3px solid #ff3333;
}

/* Background grid pattern */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(51, 255, 51, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51, 255, 51, 0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

#root {
  position: relative;
  z-index: 1;
}

/* Select styling */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2333ff33' viewBox='0 0 16 16'%3E%3Cpath d='M8 12L2 6h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}