/**
 * Base Terminal Styles
 * Shared CSS for all terminal emulators
 *
 * Terminal Architecture:
 * - C64: Plain terminal (fullscreen text on blue background)
 * - Others: Window chrome + terminal (title bar + black terminal content)
 *
 * All terminals look the same whether standalone or embedded in timeline.
 */

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

*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  background: #000;
  margin: 0;
}

/* ==========================================
   TERMINAL CONTAINER
   Fullscreen terminal window
   ========================================== */
.terminal {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==========================================
   WINDOW CHROME (Optional)
   For terminals with title bars (Amiga, Atari, DOS, etc.)
   ========================================== */
.window-chrome {
  flex-shrink: 0;
  /* Styled by theme CSS */
}

/* ==========================================
   TERMINAL CONTENT
   ========================================== */
.terminal-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #000; /* Default black background */
  color: #fff; /* Default white text */
  padding: 10px;
}

/* Output area */
.output {
  overflow-y: auto;
  overflow-x: hidden;
  word-wrap: break-word;
  white-space: pre-wrap;
  word-break: break-word;
}

.output-line {
  margin: 0;
  min-height: 1.2em;
}

/* Prompt line */
.prompt-line {
  display: flex;
  align-items: flex-start;
}

.prompt {
  white-space: pre;
}

/* Input handling */
.input-wrapper {
  position: relative;
  flex: 1;
  display: inline-flex;
  align-items: center;
}

#command-input {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  width: 100%;
  outline: none;
  caret-color: transparent;
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
}

.input-display {
  display: inline;
  white-space: pre;
}

/* Cursor */
.cursor {
  display: inline-block;
  animation: cursor-blink 0.5s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Hide scrollbar by default */
.terminal::-webkit-scrollbar,
.output::-webkit-scrollbar {
  width: 0;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 600px) {
  .terminal-content {
    padding: 8px;
  }
}

@media (max-width: 500px) {
  body { font-size: 12px; }
}

@media (max-width: 380px) {
  body { font-size: 10px; }
}
