/* === terminal.garden — style.css === */

:root {
  --bg: #0a0a0a;
  --terminal-bg: #0d0d0d;
  --green: #33ff33;
  --green-dim: #22aa22;
  --green-glow: rgba(51, 255, 51, 0.15);
  --text: #c0ffc0;
  --error: #ff4444;
  --system: #88cc88;
  --border: #1a3a1a;
  --font: 'JetBrains Mono', 'Fira Code', 'Courier New', 'Consolas', monospace;
}

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

body {
  background-color: var(--bg);
  color: var(--green);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* CRT scanlines overlay */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

.container {
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* === Terminal Window === */
.terminal {
  background: var(--terminal-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow:
    0 0 20px var(--green-glow),
    0 0 60px rgba(51, 255, 51, 0.05),
    inset 0 0 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 75vh;
  max-height: 600px;
  min-height: 400px;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #111;
  border-bottom: 1px solid var(--border);
  user-select: none;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-red    { background: #ff5555; }
.dot-yellow { background: #ffb86c; }
.dot-green  { background: #50fa7b; }

.title {
  margin-left: 8px;
  font-size: 0.7rem;
  color: #555;
  letter-spacing: 0.05em;
}

/* === Terminal Body === */
.terminal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  cursor: text;
}

.output {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 8px 16px;
  font-size: 0.85rem;
  line-height: 1.55;
  scroll-behavior: smooth;
}

/* Scrollbar styling */
.output::-webkit-scrollbar {
  width: 6px;
}
.output::-webkit-scrollbar-track {
  background: transparent;
}
.output::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* === Output Lines === */
.line {
  white-space: pre-wrap;
  word-break: break-word;
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}

.line-input {
  color: var(--green);
}

.line-output {
  color: var(--text);
}

.line-system {
  color: var(--system);
  font-style: italic;
}

.line-error {
  color: var(--error);
}

.line-garden {
  color: var(--text);
  line-height: 1.2;
}

/* === Input Line === */
.input-line {
  display: flex;
  align-items: center;
  padding: 8px 16px 12px 16px;
  border-top: 1px solid rgba(26, 58, 26, 0.4);
  font-size: 0.85rem;
}

.prompt {
  color: var(--green-dim);
  white-space: pre;
  user-select: none;
  flex-shrink: 0;
}

.input-container {
  flex: 1;
  position: relative;
}

#cmdInput {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--green);
  font-family: var(--font);
  font-size: 0.85rem;
  caret-color: var(--green);
  padding: 0;
  margin: 0;
}

#cmdInput::selection {
  background: rgba(51, 255, 51, 0.3);
  color: #fff;
}

/* Blinking cursor simulation on the input container */
.input-container::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 8px;
  height: 1.1em;
  background: var(--green);
  animation: blink 1s step-end infinite;
  pointer-events: none;
}

/* Hide the fake cursor when input is focused (native cursor shows) */
.input-container:focus-within::after {
  display: none;
}

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

/* === Footer === */
.footer {
  text-align: center;
  font-size: 0.7rem;
  color: #444;
  user-select: none;
}

.footer code {
  color: #555;
  background: #111;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font);
  font-size: 0.7rem;
}

.footer-sep {
  margin: 0 6px;
}

/* === Garden Display === */
.garden-box {
  display: inline-block;
  color: var(--green);
  line-height: 1.15;
  margin: 4px 0;
}

.garden-stats {
  color: var(--system);
  margin-top: 4px;
}

.garden-legend {
  color: #559955;
  font-size: 0.8rem;
  margin-top: 2px;
}

/* === Help Table === */
.help-table {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 14px;
  margin: 4px 0;
}

.help-cmd {
  color: var(--green);
  white-space: nowrap;
}

.help-desc {
  color: var(--text);
}

/* === Poem === */
.poem-block {
  color: #aaddaa;
  margin: 6px 0;
  padding-left: 8px;
  border-left: 2px solid #224422;
  font-style: italic;
}

/* === System messages === */
.welcome-box {
  color: var(--green);
  margin: 4px 0;
}

/* === Responsive === */
@media (max-width: 600px) {
  .terminal {
    height: 85vh;
    max-height: none;
    border-radius: 4px;
  }

  .output {
    font-size: 0.78rem;
    padding: 10px 12px 6px 12px;
  }

  .input-line {
    font-size: 0.78rem;
    padding: 6px 12px 10px 12px;
  }

  #cmdInput {
    font-size: 0.78rem;
  }

  .title {
    display: none;
  }
}
