/* Retro Terminal Styling */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0a0a0a;
  font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
  height: 100vh;
  overflow: hidden;
}

.terminal-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 900px;
  margin: 0 auto;
  background: #0c0c0c;
  border: 1px solid #1a1a1a;
  position: relative;
}

/* CRT Scanline effect */
.terminal-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 10;
}

/* Header */
.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #0f0f0f;
  border-bottom: 1px solid #1a3d1a;
}

.terminal-title {
  color: #00ff00;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 2px;
  text-shadow: 0 0 5px #00ff00;
}

.terminal-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 2px;
}

.terminal-status.connected {
  color: #00ff00;
  background: rgba(0, 255, 0, 0.1);
}

.terminal-status.disconnected {
  color: #ff4444;
  background: rgba(255, 68, 68, 0.1);
}

.terminal-status.connecting {
  color: #ffaa00;
  background: rgba(255, 170, 0, 0.1);
}

.terminal-status.fishing {
  color: #00ccff;
  background: rgba(0, 204, 255, 0.1);
  animation: pulse 2s infinite;
}

.terminal-status.fish-ready {
  color: #00ff00;
  background: rgba(0, 255, 0, 0.2);
  animation: pulse 0.5s infinite;
  font-weight: bold;
}

/* Health bar in header */
.terminal-health-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  margin-left: 15px;
}

.health-label {
  color: #00ff00;
  font-size: 11px;
  font-weight: bold;
}

.health-bar-container {
  width: 80px;
  height: 10px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 2px;
  overflow: hidden;
}

.health-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00aa00, #00ff00);
  transition: width 0.3s ease;
}

.health-text {
  color: #00ff00;
  font-size: 11px;
  min-width: 50px;
}

/* GUI Link button */
.gui-link {
  color: #00ff00;
  font-size: 11px;
  font-weight: bold;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid #00ff00;
  border-radius: 2px;
  background: rgba(0, 255, 0, 0.1);
  transition: all 0.2s ease;
  margin-left: 10px;
}

.gui-link:hover {
  background: rgba(0, 255, 0, 0.2);
  box-shadow: 0 0 8px rgba(0, 255, 0, 0.4);
}

/* Output area */
.terminal-output {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  color: #00ff00;
  font-size: 13px;
  line-height: 1.5;
}

/* Scrollbar styling */
.terminal-output::-webkit-scrollbar {
  width: 8px;
}

.terminal-output::-webkit-scrollbar-track {
  background: #0a0a0a;
}

.terminal-output::-webkit-scrollbar-thumb {
  background: #1a3d1a;
  border-radius: 4px;
}

.terminal-output::-webkit-scrollbar-thumb:hover {
  background: #2a5d2a;
}

.terminal-line {
  margin-bottom: 0;
  word-wrap: break-word;
  white-space: pre-wrap; /* Preserve spaces for box-drawing alignment */
}

.terminal-line.system {
  color: #00cc00;
  font-style: italic;
}

.terminal-line.error {
  color: #ff4444;
}

.terminal-line.success {
  color: #44ff44;
}

.terminal-line.info {
  color: #00ccff;
}

.terminal-line.dim {
  color: #008800;
}

.terminal-line.chat-message {
  color: #00ccff;
}

.terminal-line.scan-header {
  color: #00ff00;
  font-weight: bold;
}

.terminal-line.scan-item {
  margin-left: 10px;
}

.terminal-line.inventory-item {
  margin-left: 10px;
}

.terminal-line.skill-item {
  margin-left: 10px;
}

/* Progress bar for skills */
.progress-bar {
  display: inline-block;
  width: 100px;
  height: 8px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  margin-left: 10px;
  vertical-align: middle;
  position: relative;
}

.progress-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #00aa00, #00ff00);
  transition: width 0.3s ease;
}

/* Input area */
.terminal-input-line {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  background: #0f0f0f;
  border-top: 1px solid #1a3d1a;
}

.prompt {
  color: #00ff00;
  font-weight: bold;
  margin-right: 10px;
  text-shadow: 0 0 5px #00ff00;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #00ff00;
  font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
  font-size: 13px;
  outline: none;
}

.terminal-input::placeholder {
  color: #006600;
}

/* Footer */
.terminal-footer {
  padding: 5px 15px;
  background: #0a0a0a;
  border-top: 1px solid #1a1a1a;
  color: #006600;
  font-size: 10px;
  text-align: center;
}

/* Help section styles */
.help-section {
  margin: 10px 0;
}

.help-command {
  color: #00ff00;
  font-weight: bold;
}

.help-description {
  color: #00aa00;
  margin-left: 20px;
}

/* Scan result numbers */
.scan-number {
  color: #ffaa00;
  font-weight: bold;
  display: inline-block;
  min-width: 50px;
  white-space: nowrap;
}

.scan-distance {
  color: #008800;
  font-size: 11px;
}

/* Fishing spot tools */
.scan-tools {
  color: #aa6600;
  font-size: 11px;
}

/* Travel global marker */
.travel-global {
  color: #9933ff;
  font-size: 11px;
}

/* Travel destination info */
.travel-destination {
  color: #006633;
  font-size: 11px;
}

/* Portal/teleporter scan results - purple */
.scan-portal {
  margin-left: 10px;
  color: #9d4edd;
}

/* Travel destination info */
.travel-destination {
  color: #9d4edd;
  font-size: 11px;
}

/* Teleporter type indicator */
.teleporter-indicator {
  color: #9d4edd;
  font-size: 11px;
}

/* Teleporter type indicator */
.teleporter-indicator {
  color: #008800;
  font-size: 11px;
}

/* Inventory items */
.inv-slot {
  color: #00ccff;
}

.inv-quantity {
  color: #ffaa00;
}

/* Equipment slots */
.eq-slot {
  color: #00ccff;
}

.eq-item {
  color: #00ff00;
}

.eq-empty {
  color: #006600;
  font-style: italic;
}

/* Equippable item indicator in inventory */
.equip-indicator {
  color: #ffaa00;
  font-size: 11px;
}

/* Placeable item indicator in inventory */
.placeable-indicator {
  color: #9d4edd;
  font-size: 11px;
}

/* Animations */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.cursor {
  animation: blink 1s infinite;
}

/* Dynamic progress bar styles for terminal lines */
.terminal-line .progress-text {
  margin-left: 6px;
  color: #00cc00;
  font-size: 0.9em;
}

.terminal-line.complete .progress-fill {
  background: #00ff00;
}

/* Pulse animation for active progress bars */
.terminal-line > div:has(.progress-fill:not([style*="100%"])) {
  animation: pulse 2s infinite;
}

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

/* Crafting styles */
.craft-status {
  color: #00ff00;
}

.craft-cannot {
  color: #ff4444;
}

.craft-recipe {
  margin: 4px 0;
}

.craft-summary {
  border-top: 1px solid #333;
  margin-top: 8px;
  padding-top: 5px;
}

/* Ground item styles (dropped items on ground) */
.scan-item-ground {
  color: #ff6666;
  margin-left: 10px;
}

.ground-indicator {
  color: #ff4444;
  font-size: 11px;
}

/* Player scan results - cyan color */
.scan-player {
  color: #00ccff;
  margin-left: 10px;
}

/* NPC scan results - slightly darker blue */
.scan-npc {
  color: #0088aa;
  margin-left: 10px;
}

/* Enemy scan results - red color */
.scan-enemy {
  color: #ff4444;
  margin-left: 10px;
}

.enemy-indicator {
  color: #ff4444;
  font-size: 11px;
}

.scan-hp {
  color: #ffaa00;
  font-size: 11px;
}

/* NPC dialog styles */
.npc-header {
  color: #6CB4EE;
  font-weight: bold;
  margin-top: 10px;
  margin-bottom: 5px;
}

.npc-dialog {
  color: #00ff00;
  margin-bottom: 2px;
}

.option {
  color: #FFD700;
  margin-left: 10px;
}

.hint {
  color: #888;
  font-style: italic;
}

/* Combat mode styles */
.terminal-line .success {
  color: #44ff44;
}

.terminal-line .error {
  color: #ff4444;
}

.terminal-line .highlight {
  color: #ffaa00;
  font-weight: bold;
}

.terminal-line .dim {
  color: #666;
}

/* Quest status colors - matching GUI grey-yellow-green scheme */
.quest-notstarted {
  color: #808080;  /* Grey - not started */
}

.quest-inprogress {
  color: #FFD700;  /* Yellow/Gold - in progress */
}

.quest-completed {
  color: #00AA00;  /* Green - completed */
}

/* Quest status styles for terminal lines */
.terminal-line.quest-notstarted {
  color: #808080;
  margin-left: 10px;
}

.terminal-line.quest-inprogress {
  color: #FFD700;
  margin-left: 10px;
}

.terminal-line.quest-completed {
  color: #00AA00;
  margin-left: 10px;
}
