/* Terminal AI Bot Styles */

#terminal-bot-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  font-family: 'Space Mono', monospace;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none; /* Let clicks pass through if collapsed */
}

/* Floating Launch Button */
.terminal-launch-btn {
  background: rgba(3, 6, 13, 0.95);
  border: 1px solid var(--accent, #2fd8bb);
  color: var(--accent, #2fd8bb);
  padding: 12px 24px;
  border-radius: 4px;
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(47, 216, 187, 0.2);
  transition: all 0.3s ease;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.terminal-launch-btn:hover {
  background: var(--accent, #2fd8bb);
  color: #000;
  box-shadow: 0 0 25px rgba(47, 216, 187, 0.5);
}

.terminal-launch-btn .blink {
  animation: blinker 1s linear infinite;
  display: inline-block;
  width: 8px;
  height: 15px;
  background-color: currentColor;
}

/* Terminal Window */
.terminal-window {
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 500px;
  max-height: calc(100vh - 100px);
  background: rgba(10, 15, 26, 0.95);
  border: 1px solid var(--surface-border, rgba(51, 65, 85, 0.5));
  border-radius: 6px;
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.8), 0 0 0 1px rgba(47, 216, 187, 0.1);
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: auto;
  backdrop-filter: blur(10px);
}

.terminal-window.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.terminal-header {
  background: #03060d;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--surface-border, rgba(51, 65, 85, 0.5));
  font-size: 0.75rem;
  color: var(--muted, #94a3b8);
}

.terminal-header-controls span {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-left: 5px;
}
.terminal-header-controls span:nth-child(1) { background: #ff5f56; cursor: pointer; } /* Close */
.terminal-header-controls span:nth-child(2) { background: #ffbd2e; } /* Min */
.terminal-header-controls span:nth-child(3) { background: #27c93f; } /* Max */

.terminal-body {
  flex-grow: 1;
  padding: 15px;
  overflow-y: auto;
  font-size: 0.85rem;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.terminal-body::-webkit-scrollbar {
  width: 6px;
}
.terminal-body::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
}
.terminal-body::-webkit-scrollbar-thumb {
  background: var(--surface-border, rgba(51, 65, 85, 0.5));
  border-radius: 3px;
}

.t-msg {
  line-height: 1.4;
  word-wrap: break-word;
}

.t-msg.ai-msg {
  color: #cbd5e1;
}

.t-msg.ai-msg .prefix {
  color: var(--accent, #2fd8bb);
  margin-right: 8px;
}

.t-msg.user-msg {
  color: #fff;
  opacity: 0.9;
}

.t-msg.user-msg .prefix {
  color: #3b82f6;
  margin-right: 8px;
}

.t-msg.sys-msg {
  color: #fbbf24;
  font-size: 0.75rem;
  font-style: italic;
}

/* Input Area */
.terminal-input-line {
  padding: 15px;
  background: #03060d;
  display: flex;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.terminal-input-line .prompt {
  color: #3b82f6;
  margin-right: 10px;
  font-weight: bold;
}

.terminal-input-line input {
  background: transparent;
  border: none;
  color: #fff;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  flex-grow: 1;
  outline: none;
  width: 100%;
}

.terminal-input-line input::placeholder {
  color: rgba(255,255,255,0.2);
}

/* Typewriter cursor effect */
@keyframes blinker {
  50% { opacity: 0; }
}

@media (max-width: 480px) {
  #terminal-bot-container {
    bottom: 15px;
    right: 15px;
    left: 15px;
    align-items: stretch;
  }
  .terminal-window {
    width: auto;
    max-width: none;
  }
}
