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

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

body {
  background-color: #1d1f21;
  color: #c5c8c6;
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

#terminal-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

#terminal-output {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-all;
}

#terminal-output::-webkit-scrollbar {
  width: 8px;
}

#terminal-output::-webkit-scrollbar-track {
  background: #1d1f21;
}

#terminal-output::-webkit-scrollbar-thumb {
  background: #373b41;
  border-radius: 4px;
}

#terminal-output::-webkit-scrollbar-thumb:hover {
  background: #4a4e54;
}

.output-line {
  margin-bottom: 0;
  padding: 0;
}

.output-info {
  color: #c5c8c6;
}

.output-error {
  color: #cc6666;
}

.output-success {
  color: #b5bd68;
}

.prompt-line {
  display: block;
  margin-bottom: 0;
  padding: 0;
}

.prompt-text {
  display: inline-block;
  color: #b5bd68;
  font-weight: bold;
  margin-right: 0;
  white-space: pre;
  vertical-align: baseline;
}

.input-text {
  display: inline-block;
  color: #c5c8c6;
  white-space: pre;
  word-wrap: break-word;
  caret-color: transparent;
  outline: none;
  vertical-align: baseline;
}

.cursor {
  display: inline-block;
  color: #c5c8c6;
  animation: blink 1s infinite;
  vertical-align: baseline;
}

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

/* For readability in smaller screens */
@media (max-width: 480px) {
  body {
    font-size: 12px;
  }

  #terminal-output {
    padding: 12px;
  }

  #terminal-input-area {
    padding: 10px 12px;
  }

  #prompt {
    margin-right: 6px;
  }
}

/* Smooth scrolling */
#terminal-output {
  scroll-behavior: smooth;
}

/* Selection styling */
#terminal-output::selection {
  background-color: #373b41;
  color: #c5c8c6;
}

#input-text::selection {
  background-color: #373b41;
  color: #c5c8c6;
}

/* Hidden mobile input for triggering virtual keyboard */
#mobile-input {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  border: none;
  outline: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px; /* Prevents iOS zoom on focus */
}
