/* Terminal.css — Ephergent Relay Station Styling */

:root {
  --bg: #0a0c10;
  --fg: #c5c8c6;
  --amber: #f0a000;
  --cyan: #00b4d8;
  --green: #00ff66;
  --red: #ff3333;
  --dim: #5a5a5a;
  --white: #ffffff;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
}

#terminal-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  position: relative;
}

.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  z-index: 1000;
  opacity: 0.4;
}

.terminal-output {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 10px;
}

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

.terminal-output::-webkit-scrollbar-track {
  background: var(--bg);
}

.terminal-output::-webkit-scrollbar-thumb {
  background: var(--dim);
  border-radius: 4px;
}

.terminal-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  min-height: 1.4em;
}

/* Colors */
.terminal-amber { color: var(--amber); }
.terminal-cyan { color: var(--cyan); }
.terminal-green { color: var(--green); }
.terminal-red { color: var(--red); }
.terminal-dim { color: var(--dim); }
.terminal-fg { color: var(--fg); }
.terminal-white { color: var(--white); }

/* Styles */
.terminal-bold { font-weight: bold; }
.terminal-italic { font-style: italic; }
.terminal-reverse {
  background: var(--fg);
  color: var(--bg);
}

/* Signal voice — distinct styling */
.signal-voice {
  color: var(--amber);
  font-style: italic;
}

/* Error flash */
.error-flash {
  animation: flash 0.3s ease-out;
}

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

/* Command echo */
.command-echo {
  color: var(--cyan);
  opacity: 0.7;
}

/* TAB menu */
.tab-menu {
  padding-left: 0;
}

.tab-menu-item {
  color: var(--amber);
}

.tab-menu-item.selected {
  color: var(--cyan);
  font-weight: bold;
}

/* Boot sequence */
.boot-line {
  color: var(--green);
}

.dormancy-line {
  color: var(--amber);
}

/* Input line */
.terminal-input-line {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--dim);
}

.terminal-prompt {
  color: var(--cyan);
  margin-right: 8px;
  white-space: nowrap;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--fg);
  font-family: inherit;
  font-size: inherit;
  outline: none;
  caret-color: var(--amber);
}

.terminal-input::selection {
  background: var(--amber);
  color: var(--bg);
}

/* Status bar */
.terminal-status {
  padding: 5px 0;
  font-size: 12px;
  color: var(--dim);
  display: flex;
  justify-content: space-between;
}

/* Audio player block */
.audio-block {
  margin: 5px 0;
  font-family: inherit;
}

/* CRT glow effect */
#terminal-container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  box-shadow: inset 0 0 100px rgba(0, 180, 216, 0.05);
  z-index: 999;
}

/* Glitch effect for special moments */
.glitch {
  animation: glitch 0.3s ease-out;
}

@keyframes glitch {
  0% { transform: translate(0); filter: hue-rotate(0deg); }
  20% { transform: translate(-2px, 1px); filter: hue-rotate(90deg); }
  40% { transform: translate(2px, -1px); filter: hue-rotate(180deg); }
  60% { transform: translate(-1px, 2px); filter: hue-rotate(270deg); }
  80% { transform: translate(1px, -2px); filter: hue-rotate(360deg); }
  100% { transform: translate(0); filter: hue-rotate(0deg); }
}

/* ASCII art boxes */
.box-top { color: var(--dim); }
.box-bottom { color: var(--dim); }

/* Links in terminal */
.terminal-link {
  color: var(--cyan);
  text-decoration: underline;
  cursor: pointer;
}

.terminal-link:hover {
  color: var(--amber);
}

/* Locked content */
.locked {
  color: var(--dim);
  font-style: italic;
}

/* Now playing highlight */
.now-playing {
  color: var(--green);
  font-weight: bold;
}

/* Focus indicator for accessibility */
*:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    font-size: 12px;
  }

  #terminal-container {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 11px;
  }
}