/* style.css */

body {
  margin: 0;
  padding: 0;
  height: 100vh;
  background-color: #111; /* dark background for bezel */
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: monospace;
  color: #00ff00;
  overflow: hidden; /* prevent scrolling */
}

/* Full-screen computer frame */
.terminal {
  width: 95%;
  height: 90vh; /* almost full height */
  background: #222; /* bezel color */
  padding: 20px;
  border: 6px solid #555;
  border-radius: 12px;
  box-shadow: 0 0 40px #00ff0050, 0 0 20px #00ff0050;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
}

/* Optional top bar for old monitor look */
.terminal::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 10px;
  right: 10px;
  height: 12px;
  background: #333;
  border-radius: 6px 6px 0 0;
}

/* Animated Title */
#title {
  font-size: 2em;
  margin-bottom: 20px;
  white-space: pre;
  letter-spacing: 2px;
  text-shadow: 0 0 10px #00ff00;
}

/* Output area (screen) with CRT flicker */
#output {
  flex: 1;
  min-height: 0;
  white-space: pre-wrap;
  margin-bottom: 10px;
  padding: 15px;
  background: #000;
  border: 2px inset #0f0;
  box-shadow: inset 0 0 20px #00ff0030, 0 0 20px #00ff0050;
  border-radius: 30px; /* CRT curve */
  overflow-y: auto;
  font-size: 1em;
  position: relative;

  /* Subtle scanlines + slight radial glow */
  background-image: 
    repeating-linear-gradient(
      rgba(0, 255, 0, 0.15) 0px,
      rgba(0, 255, 0, 0.15) 2px,
      rgba(0, 255, 0, 0) 2px,
      rgba(0, 255, 0, 0) 4px
    ),
    radial-gradient(circle at center, rgba(0,255,0,0.05), transparent 70%);
  background-blend-mode: overlay;
  background-size: 100% 4px, 100% 100%;

  /* CRT flicker animation */
  animation: crtFlicker 1s infinite;
}

/* CRT flicker keyframes */
@keyframes crtFlicker {
  0%   { opacity: 0.92; }
  10%  { opacity: 0.97; }
  20%  { opacity: 0.93; }
  30%  { opacity: 0.95; }
  40%  { opacity: 0.94; }
  50%  { opacity: 0.98; }
  60%  { opacity: 0.93; }
  70%  { opacity: 0.96; }
  80%  { opacity: 0.92; }
  90%  { opacity: 0.95; }
  100% { opacity: 0.93; }
}

/* Input line layout */
.input-line {
  display: flex;
  align-items: center;
}

/* Prompt symbol */
.prompt {
  margin-right: 5px;
}

/* Input styling */
#input {
  flex: 1;
  background: black;
  border: none;
  color: #00ff00;
  font-family: monospace;
  font-size: 1em;
  outline: none;
  caret-color: #00ff00;
}  

/* Blinking block cursor for output */
.cursor {
  display: inline-block;
  width: 10px;
  animation: blink 1s step-start infinite;
}

/* Cursor animation */
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ======================
   Responsive for Mobile
====================== */
@media (max-width: 600px) {
  .terminal {
    padding: 12px;
    border-width: 4px;
  }

  #title {
    font-size: 1.5em;
  }

  #output {
    padding: 10px;
    font-size: 0.9em;
    border-radius: 20px;
  }

  #input {
    font-size: 0.9em;
  }
}
