:root {
  --primary-color: #0a0d12;
  --secondary-color: #131b29;
  --accent-color: #546e8c;
  --text-color: #a6b5c5;
  --terminal-green: #33ff33;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Courier New', monospace;
  background-color: #000;
  color: var(--terminal-green);
  display: flex;
  flex-direction: column;
}

/* ===== FULL SCREEN TERMINAL STYLING ===== */
.terminal-container {
  background-color: #0a0a0a;
  border: 3px solid #444444;
  position: relative;
  flex: 1;
  width: 100%;
  height: 100vh;
  box-shadow: 0 0 20px rgba(20, 180, 20, 0.4), inset 0 0 30px rgba(0, 0, 0, 0.7);
  image-rendering: pixelated;
  display: flex;
  flex-direction: column;
}

/* Fixed effects layer - does not scroll */
.terminal-effects {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

/* Scrollable content wrapper */
.terminal-content {
  position: relative;
  width: 100%;
  flex: 1;
  overflow: auto;
  z-index: 5;
  padding: 20px;
}

/* Background patterns */
.terminal-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #0a0a0a;
  background-image: 
    linear-gradient(to bottom, rgba(0,0,0,0.1) 1px, transparent 1px),
    radial-gradient(circle at 30% 50%, rgba(51, 255, 51, 0.05) 0%, transparent 75%);
  background-size: 100% 3px, 100% 100%;
  z-index: 1;
}

.terminal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.2) 100%),
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.15),
      rgba(0, 0, 0, 0.15) 1px,
      transparent 1px,
      transparent 2px
    ),
    repeating-radial-gradient(
      circle at 200px 150px,
      rgba(51, 255, 51, 0.03),
      rgba(51, 255, 51, 0) 20px
    );
  pointer-events: none;
  opacity: 0.7;
  z-index: 2;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.7);
}

.terminal-text {
  white-space: pre-wrap;
  font-family: 'VT323', 'Press Start 2P', monospace;
  font-size: 20px;
  line-height: 1.4;
  color: var(--terminal-green);
  text-shadow: 
    0 0 5px var(--terminal-green),
    0 0 10px rgba(51, 255, 51, 0.4),
    0 0 15px rgba(51, 255, 51, 0.2);
  position: relative;
  letter-spacing: 1px;
  animation: afterglow 3s infinite;
}

.echo-text {
  color: var(--terminal-green);
  text-shadow: 
    0 0 5px var(--terminal-green),
    0 0 10px rgba(51, 255, 51, 0.2),
    0 0 15px rgba(51, 255, 51, 0.1);
}

.prompt {
  color: #4a9;
  line-height: 1.4;
  text-shadow: 
    0 0 5px #4a9,
    0 0 10px rgba(64, 170, 153, 0.2),
    0 0 15px rgba(64, 170, 153, 0.1);
}

/* CRT scanline effect - enhanced */
.scanline {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.07);
  opacity: 0.4;
  animation: scanline 6s linear infinite;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 0 10px rgba(20, 180, 20, 0.2);
}

@keyframes scanline {
  0% { top: -10px; }
  100% { top: 100%; }
}

.phosphor-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, transparent 50%, rgba(0, 30, 0, 0.3) 100%);
  pointer-events: none;
  z-index: 4;
  mix-blend-mode: overlay;
}

/* Afterglow effect animation */
@keyframes afterglow {
  0% { text-shadow: 0 0 5px #33ff33, 0 0 10px rgba(51, 255, 51, 0.5), 0 0 15px rgba(51, 255, 51, 0.3); }
  50% { text-shadow: 0 0 8px #33ff33, 0 0 15px rgba(51, 255, 51, 0.7), 0 0 25px rgba(51, 255, 51, 0.4); }
  100% { text-shadow: 0 0 5px #33ff33, 0 0 10px rgba(51, 255, 51, 0.5), 0 0 15px rgba(51, 255, 51, 0.3); }
}

/* Pixel effect overlay */
.terminal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    url("data:image/svg+xml,%3Csvg width='2' height='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h1v1H0zM1 1h1v1H1z' fill-opacity='.05' fill='%23fff'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h40v40H0z' fill-opacity='.03' fill='%23fff'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg width='6' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1h1v1H1zM4 4h1v1H4z' fill-opacity='.15' fill='%23000'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 3;
  opacity: 0.6;
  background-blend-mode: overlay;
  background-size: 2px 2px, 40px 40px, 6px 6px;
}

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

.cursor {
  display: inline-block;
  width: 12px;
  height: 18px;
  background-color: #33ff33;
  animation: blink 1s step-end infinite;
  margin-left: 2px;
  vertical-align: bottom;
}

/* CRT flicker effect */
@keyframes crtFlicker {
  0% { opacity: 1; }
  1% { opacity: 0.8; }
  2% { opacity: 1; }
  55% { opacity: 1; }
  56% { opacity: 0.8; }
  57% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.7; }
  94% { opacity: 1; }
}

.flicker {
  animation: flicker 8s infinite;
}

.command-input {
  display: flex;
  padding: 15px 20px;
  position: relative;
  background-color: rgba(0, 0, 0, 0.3);
  border-top: 2px solid #444444;
  opacity: 0; /* Hide the actual input - we'll use the echo instead */
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 10;
}

.input-prefix {
  font-family: 'VT323', 'Press Start 2P', monospace;
  font-size: 20px;
  background-color: transparent;
  color: #4a9;
  padding: 12px 0;
  font-weight: bold;
  display: flex;
  align-items: center;
  text-shadow: 0 0 5px rgba(64, 170, 153, 0.7);
  border: none;
  width: 0;
  overflow: hidden;
}

#command {
  flex-grow: it ;
  background-color: #0a0a0a;
  border: 2px solid #444444;
  border-left: none;
  color: var(--terminal-green);
  padding: 12px;
  font-family: 'VT323', 'Press Start 2P', monospace;
  font-size: 20px;
  outline: none;
  border-radius: 0 2px 2px 0;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.3);
  text-shadow: 0 0 5px var(--terminal-green);
  letter-spacing: 1px;
  caret-color: transparent; /* Hide the default cursor */
}

#command::placeholder {
  color: rgba(51, 255, 51, 0.5);
}

/* Power on overlay */
.power-on-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 100;
  transition: all 0.3s ease;
}

/* Rust patches and scratches - optional for aesthetic */
.rust-patch {
  position: absolute;
  background-color: #8B4513;
  opacity: 0.3;
  border-radius: 50%;
  filter: blur(4px);
  z-index: 2;
}

.scratch {
  position: absolute;
  background-color: #444;
  transform: rotate(45deg);
  z-index: 2;
  box-shadow: 0 0 2px rgba(0,0,0,0.5);
}