/* ============================================================
   Pear || — Ретро-компьютер в стиле 70-х
   Основные стили
   ============================================================ */

/* --- Сброс и базовые настройки --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000000;
  color: #00FF00;
  /* Системный моноширинный шрифт Windows (Consolas) */
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

/* --- Анимация включения (плавное появление) --- */
@keyframes powerOn {
  0% {
    opacity: 0;
    filter: brightness(0);
  }
  50% {
    opacity: 0.3;
    filter: brightness(0.3);
  }
  100% {
    opacity: 1;
    filter: brightness(1);
  }
}

#terminal {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 16px 20px;
  animation: powerOn 1.2s ease-out forwards;
}

/* --- Область вывода --- */
#output {
  flex: 1 1 auto;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE/Edge */
  min-height: 0;                /* важно для flex-сжатия */
}

#output::-webkit-scrollbar {
  display: none;                /* Chrome/Safari */
}

/* Строки вывода */
#output .line {
  min-height: 1.5em;
}

#output .line.error {
  color: #FF4444;
  text-shadow: 0 0 6px #FF4444;
}

#output .line.success {
  color: #00FF00;
  text-shadow: 0 0 6px #00FF00;
}

#output .line.info {
  color: #00CCFF;
  text-shadow: 0 0 6px #00CCFF;
}

#output .line.warning {
  color: #FFAA00;
  text-shadow: 0 0 6px #FFAA00;
}

#output .line.fatal {
  color: #FF0000;
  text-shadow: 0 0 8px #FF0000;
  font-weight: bold;
}

/* --- Строка ввода --- */
#input-line {
  display: flex;
  align-items: flex-start;
  padding: 4px 0;
  flex-shrink: 0;               /* не сжимается */
  max-height: 40vh;             /* не более 40% высоты экрана */
  overflow-y: auto;             /* скролл внутри поля ввода */
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-top: 1px solid #003300;
  margin-top: 4px;
  padding-top: 8px;
  transition: border-color 0.3s ease;
}

#input-line::-webkit-scrollbar {
  display: none;
}

/* Визуальный индикатор режима редактирования */
#input-line.editor-mode {
  border-top-color: #00FF00;
  border-top-width: 2px;
  box-shadow: 0 -2px 8px rgba(0, 255, 0, 0.15);
}

#prompt {
  color: #00FF00;
  text-shadow: 0 0 8px #00FF00;
  margin-right: 8px;
  user-select: none;
  flex-shrink: 0;
  line-height: 1.5;
}

#input {
  flex: 1;
  outline: none;
  color: #00FF00;
  text-shadow: 0 0 8px #00FF00;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  caret-color: #00FF00;
  -webkit-caret-color: #00FF00;
  padding: 0;
  min-height: 1.5em;
  overflow: hidden;             /* скролл на родителе #input-line */
}

/* ============================================================
   ТЕМЫ (для лёгкого переключения)
   ============================================================ */

/* --- Тема: Amber (янтарная) --- */
.theme-amber {
  background-color: #000000;
  color: #FFB000;
}
.theme-amber #prompt,
.theme-amber #input {
  color: #FFB000;
  text-shadow: 0 0 8px #FFB000;
}
.theme-amber #input {
  caret-color: #FFB000;
  -webkit-caret-color: #FFB000;
}
.theme-amber #input-line {
  border-top-color: #332200;
}
.theme-amber #input-line.editor-mode {
  border-top-color: #FFB000;
  box-shadow: 0 -2px 8px rgba(255, 176, 0, 0.15);
}
.theme-amber .line.error {
  color: #FF4444;
  text-shadow: 0 0 6px #FF4444;
}
.theme-amber .line.success {
  color: #FFB000;
  text-shadow: 0 0 6px #FFB000;
}
.theme-amber .line.info {
  color: #FFD700;
  text-shadow: 0 0 6px #FFD700;
}

/* --- Тема: White (белый на чёрном) --- */
.theme-white {
  background-color: #000000;
  color: #FFFFFF;
}
.theme-white #prompt,
.theme-white #input {
  color: #FFFFFF;
  text-shadow: 0 0 6px #FFFFFF;
}
.theme-white #input {
  caret-color: #FFFFFF;
  -webkit-caret-color: #FFFFFF;
}
.theme-white #input-line {
  border-top-color: #333333;
}
.theme-white #input-line.editor-mode {
  border-top-color: #FFFFFF;
  box-shadow: 0 -2px 8px rgba(255, 255, 255, 0.15);
}
.theme-white .line.error {
  color: #FF4444;
  text-shadow: 0 0 6px #FF4444;
}
.theme-white .line.success {
  color: #FFFFFF;
  text-shadow: 0 0 6px #FFFFFF;
}
.theme-white .line.info {
  color: #88CCFF;
  text-shadow: 0 0 6px #88CCFF;
}

/* --- Тема: Red (красный) --- */
.theme-red {
  background-color: #000000;
  color: #FF3333;
}
.theme-red #prompt,
.theme-red #input {
  color: #FF3333;
  text-shadow: 0 0 8px #FF3333;
}
.theme-red #input {
  caret-color: #FF3333;
  -webkit-caret-color: #FF3333;
}
.theme-red #input-line {
  border-top-color: #330000;
}
.theme-red #input-line.editor-mode {
  border-top-color: #FF3333;
  box-shadow: 0 -2px 8px rgba(255, 51, 51, 0.15);
}
.theme-red .line.error {
  color: #FF6666;
  text-shadow: 0 0 6px #FF6666;
}
.theme-red .line.success {
  color: #FF3333;
  text-shadow: 0 0 6px #FF3333;
}
.theme-red .line.info {
  color: #FF8888;
  text-shadow: 0 0 6px #FF8888;
}

/* --- Тема: Blue (синий) --- */
.theme-blue {
  background-color: #000000;
  color: #3388FF;
}
.theme-blue #prompt,
.theme-blue #input {
  color: #3388FF;
  text-shadow: 0 0 8px #3388FF;
}
.theme-blue #input {
  caret-color: #3388FF;
  -webkit-caret-color: #3388FF;
}
.theme-blue #input-line {
  border-top-color: #001133;
}
.theme-blue #input-line.editor-mode {
  border-top-color: #3388FF;
  box-shadow: 0 -2px 8px rgba(51, 136, 255, 0.15);
}
.theme-blue .line.error {
  color: #FF4444;
  text-shadow: 0 0 6px #FF4444;
}
.theme-blue .line.success {
  color: #3388FF;
  text-shadow: 0 0 6px #3388FF;
}
.theme-blue .line.info {
  color: #66AAFF;
  text-shadow: 0 0 6px #66AAFF;
}