/* Chat Terminal Styles - Option 5: Small Dark Terminal Card */

.chat-terminal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 550px;
  height: 650px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  background: #000000;
  border: 1px solid #333333;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform-origin: center center;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.liquid-overlay.active .chat-terminal {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.chat-terminal:hover,
.chat-terminal * {
  pointer-events: auto;
}

.chat-terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #333333;
  background: #000000;
}

.chat-terminal-title {
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  font-weight: 500;
  color: #00ff41;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chat-terminal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #666666;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  line-height: 1;
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
}

.chat-terminal-close:hover {
  background: #1a1a1a;
  color: #ffffff;
}

.chat-terminal-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.chat-output {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #ffffff;
  letter-spacing: 0.02em;
  scroll-behavior: smooth;
  background: #000000;
}

.chat-output::-webkit-scrollbar {
  width: 6px;
}

.chat-output::-webkit-scrollbar-track {
  background: transparent;
}

.chat-output::-webkit-scrollbar-thumb {
  background: #333333;
  border-radius: 3px;
}

.chat-output::-webkit-scrollbar-thumb:hover {
  background: #444444;
}

.chat-input-area {
  border-top: 1px solid #333333;
  background: #000000;
}

.chat-input-container {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 10px;
}

.chat-prompt {
  color: #00ff41;
  font-weight: 600;
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  color: #ffffff;
  letter-spacing: 0.02em;
  padding: 4px 0;
}

.chat-input::placeholder {
  color: #666666;
  opacity: 0.8;
}

/* Message styles */
.chat-message {
  margin: 12px 0;
  padding: 0;
}

.chat-message.user {
  text-align: right;
}

.chat-message.user .message-content {
  display: inline-block;
  text-align: left;
  color: #ffffff;
}

.chat-message.ai {
  color: #ffffff;
}

.message-content {
  white-space: pre-line;
  line-height: 1.6;
}

/* Tool call indicator */
.tool-call {
  margin: 8px 0;
  padding: 6px 10px;
  background: #1a1a1a;
  border-left: 2px solid #00ff41;
  border-radius: 2px;
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 11px;
  color: #00ff41;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.tool-result {
  margin: 8px 0 14px 0;
  padding-left: 0;
  white-space: pre-line;
  line-height: 1.6;
  color: #cccccc;
}

.tool-result-item {
  margin: 4px 0;
  padding-left: 16px;
  position: relative;
}

.tool-result-item::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #00ff41;
}

/* Welcome message */
.welcome-message {
  color: #ffffff;
  line-height: 1.6;
}

/* Typing indicator */
.typing-indicator {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin: 12px 0;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #666666;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  30% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 768px) {
  .chat-terminal {
    width: calc(100vw - 40px);
    height: calc(100vh - 40px);
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    transform: translate(-50%, -50%) scale(0.9);
  }
  
  .liquid-overlay.active .chat-terminal {
    transform: translate(-50%, -50%) scale(1);
  }
  
  .chat-output {
    font-size: 12px;
    padding: 14px;
  }
  
  .chat-input {
    font-size: 12px;
  }
  
  .chat-prompt {
    font-size: 12px;
  }
  
  .chat-terminal-title {
    font-size: 11px;
  }
}
