/* Terminal styles */
.terminals-container {
  display: flex;
  gap: 40px;
  align-items: center;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.terminal-box {
  background: var(--container-bg);
  border: 8px solid var(--container-border);
  box-shadow: 
    0 0 15px var(--container-shadow),
    inset 0 0 40px var(--container-shadow);
  border-radius: 15px;
  padding: 8px;
  position: relative;
  flex: 0 0 500px;
  height: 500px;
}

/* Terminal content and effects */
.viewport {
  position: relative;
  height: 100%;
  background: rgba(0, 0, 0, 0.98);
  backdrop-filter: blur(3px);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 20px var(--container-shadow);
  z-index: 1;
}

/* CRT haze effect */
.viewport::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    /* Original CRT haze */
    radial-gradient(
      circle at center,
      transparent 0%,
      var(--crt-haze) 90%
    ),
    /* Vertical shimmer lines */
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 1px,
      rgba(155, 77, 202, 0.03) 2px,
      rgba(155, 77, 202, 0.03) 3px
    );
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: screen;
  animation: verticalShimmer 3s linear infinite;
}

.viewport::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(
      to bottom,
      transparent 50%,
      var(--crt-haze) 51%,
      transparent 100%
    );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 3;
  opacity: 0.3;
  mix-blend-mode: overlay;
}

/* Terminal content styles */
.terminal-content {
  color: var(--terminal-text);
  font-family: 'VT323', 'Courier New', monospace;
  text-shadow: 0 0 5px var(--container-shadow);
  padding: clamp(15px, 3vw, 20px);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 5;
  text-shadow: 0 0 5px var(--terminal-text);
  overflow-y: auto;
}

.terminal-content h1 {
  color: var(--terminal-heading);
  animation: textFlicker 2s infinite;
  margin-bottom: clamp(0.5em, 2vw, 1em);
  font-size: clamp(1.8rem, 4vw, 2.5em);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 
    0 0 5px var(--terminal-heading),
    0 0 15px var(--text-haze);
}

.terminal-content p {
  font-size: clamp(1rem, 2.5vw, 1.2em);
  line-height: 1.4;
}

/* CRT effects */
.crt-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(
      rgba(18, 16, 16, 0) 50%,
      rgba(0, 0, 0, 0.25) 50%
    ),
    linear-gradient(
      90deg,
      rgba(255, 0, 0, 0.06),
      rgba(0, 255, 0, 0.02),
      rgba(0, 0, 255, 0.06)
    );
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.4;
}

.scanline {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    var(--scanline-color),
    var(--scanline-color) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  opacity: 0.3;
  z-index: 4;
  animation: scanline 10s linear infinite;
}

.noise-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3C/rect width='100%' height='100%' filter='url(%23noise)' opacity='0.1'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: overlay;
  z-index: 3;
}

.noise-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3C/rect width='100%' height='100%' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3C/rect width='100%' height='100%' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: 0.4;
  z-index: 3;
  pointer-events: none;
  animation: staticNoise 0.5s steps(2) infinite;
}

/* Bolt styles */
.bolt-tl, .bolt-tr, .bolt-bl, .bolt-br {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--bolt-bg);
  border: 2px solid #808080;
  box-shadow: 
    inset 0 0 2px rgba(255,255,255,0.8),
    inset 0 0 4px rgba(0,0,0,0.2);
  border-radius: 50%;
  z-index: 1;
}

.bolt-tl::before, .bolt-tr::before,
.bolt-bl::before, .bolt-br::before,
.bolt-tl::after, .bolt-tr::after,
.bolt-bl::after, .bolt-br::after {
  content: '';
  position: absolute;
  background: #808080;
}

/* Bolt positioning */
.bolt-tl { top: -12px; left: -12px; }
.bolt-tr { top: -12px; right: -12px; }
.bolt-bl { bottom: -12px; left: -12px; }
.bolt-br { bottom: -12px; right: -12px; }

[class*="bolt-"]:before {
  width: 8px;
  height: 2px;
  top: 5px;
  left: 2px;
}

[class*="bolt-"]:after {
  width: 2px;
  height: 8px;
  top: 2px;
  left: 5px;
}

/* Typewriter styles */
.typewriter-container {
  max-width: 100%;
  overflow-y: auto;
  max-height: 100%;
  padding: 0;
  padding-right: 30px;
}

.typewriter {
  opacity: 0;
  margin-bottom: 0.5em;
  padding: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  transition: opacity 0.2s ease-in-out;
  display: none;
  color: var(--terminal-text);
}

.typewriter.visible {
  opacity: 1;
  display: block;
}

/* Animations */
@keyframes scanline {
  0% { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

@keyframes textFlicker {
  0% { opacity: 1; }
  2% { opacity: 0.8; }
  4% { opacity: 1; }
  19% { opacity: 1; }
  21% { opacity: 0.9; }
  23% { opacity: 1; }
}

@keyframes verticalShimmer {
  0% { background-position: 0 0; }
  100% { background-position: 3px 0; }
}

@keyframes staticNoise {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1px, 1px); }
  50% { transform: translate(1px, -1px); }
  75% { transform: translate(-1px, -1px); }
  100% { transform: translate(1px, 1px); }
}
