/*
=================================
 deanlefor.com - Terminal Styles
 Author: Dean Lefor
 Created: July 2025
 Description: Retro DOS-style terminal UI
=================================
*/

/* ================================
   Color Variables & Themes
=================================*/
:root {
  --fg: green;
  --bg: black;
}
body.theme-green { --fg: green; --bg: black; }
body.theme-blue  { --fg: white; --bg: blue;  }
body.theme-amber { --fg: #FFBF00; --bg: black; }

/* ================================
   Base Layout and Typography
=================================*/
/* FIX: Prevent the main page from scrolling */
html, body {
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
}

body {
  color: var(--fg);
  font-family: 'VT323', monospace;
  margin: 0;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1.3;
}

/* ================================
   Boot-up Splash (IBM PC DOS)
=================================*/
#splash {
  position: absolute;
  inset: 0;
  background-color: var(--bg);
  padding: 1rem;
  z-index: 10;
}
#splash-output {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: inherit;
  margin: 0;
  text-align: left;
}

/* ================================
   Terminal Container
   (FIX: Now a self-contained scrolling view)
=================================*/
#terminal {
  max-width: 1200px;
  margin: 0;
  background-color: var(--bg);
  /* FIX: Height is now controlled by JavaScript to handle mobile keyboards.
     The 'height' property is removed from here to prevent conflicts. */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* Aligns initial prompt to bottom */
  padding: 1rem;
  box-sizing: border-box;
}


/* ================================
   Output Area
=================================*/
#output {
  white-space: pre-wrap;
  font-family: inherit;
  margin: 0;
}

#output img {
  max-width: 100%;
  margin: 1rem 0;
}

/* ================================
   Input Line (always below output)
=================================*/
#input-wrapper {
  display: flex;
  width: 100%;
  align-items: flex-start;
  background-color: var(--bg);
  padding-top: 0.5rem;
}

#prompt-line {
  margin-right: 0.5ch;
}
#typed-text {
  white-space: pre;
}
#fake-cursor {
  display: inline-block;
  width: 0.6ch;
  height: 1em;
  background-color: var(--fg);
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}

/* ================================
   Hidden Mobile Input Overlay
=================================*/
#mobile-input {
  position: absolute;
  inset: 0;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  caret-color: transparent;
}

/* ================================
   Animations
=================================*/
@keyframes blink {
  50% { opacity: 0; }
}
