/**
 * AI Assistant - Brutalist Ghost/Arkham Style
 * 3D Logo + Live Streaming + Suggestions
 */

/* ============================================
   AI PANEL HEADER WITH 3D LOGO
   ============================================ */

.ai-panel-brutal {
  background: var(--bg-elevated);
  border-left: 5px solid var(--border-primary);
}

.ai-header-brutal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-elevated);
  border-bottom: 2px solid var(--border-primary);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.ai-logo-container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* AI Logo Icon - Simple emoji replacement */
.ai-logo-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 2px solid var(--border-primary);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
}

.ai-header-brutal h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin: 0;
}

/* Status Indicator - HIDDEN by default */
.ai-status-indicator {
  display: none;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 0;
  background: var(--accent-primary);
  animation: pulse-brutal 2s infinite;
}

@keyframes pulse-brutal {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.status-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-primary);
  letter-spacing: 0.1em;
}

/* ============================================
   AI SUGGESTION CHIPS - HIDDEN
   ============================================ */

.ai-suggestions-brutal {
  display: none; /* Hidden per user request */
}

/* ============================================
   CHAT MESSAGES - BRUTALIST STYLE
   ============================================ */

.chat-messages-brutal {
  background: var(--bg-primary);
  padding: var(--space-md);
  overflow-y: auto;
  flex: 1;
}

.assistant-brutal {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  margin-bottom: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-elevated);
  border-left: 4px solid var(--accent-primary);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
}

.message-avatar {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border: 3px solid var(--border-primary);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.avatar-icon {
  font-size: 1.5rem;
}

.message-content {
  flex: 1;
}

.message-content strong {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--accent-primary);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: var(--space-xs);
}

.message-content p {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0;
}

/* User messages */
.user-brutal {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  margin-bottom: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-primary);
  border-left: 4px solid var(--accent-blue);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
}

/* Code blocks in messages */
.message-content pre {
  background: var(--bg-primary);
  border: 2px solid var(--border-primary);
  padding: var(--space-sm);
  overflow-x: auto;
  margin: var(--space-sm) 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.message-content code {
  background: var(--bg-primary);
  padding: 2px var(--space-xs);
  border: 1px solid var(--border-primary);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* ============================================
   INPUT WITH INLINE SEND BUTTON
   ============================================ */

.chat-input-brutal {
  border-top: 4px solid var(--border-primary);
  background: var(--bg-elevated);
  padding: var(--space-md);
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

/* Status indicator above input - HIDDEN */
.ai-status-bar {
  display: none;
}

.input-wrapper-brutal {
  position: relative;
  width: 100%;
}

.input-wrapper-brutal textarea {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: var(--space-sm);
  padding-right: 54px; /* Space for inline button */
  padding-bottom: var(--space-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 3px solid var(--border-primary);
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.2);
  resize: none;
  min-height: 60px;
  max-height: 150px;
  box-sizing: border-box;
  line-height: 1.5;
  overflow-y: auto;
}

.input-wrapper-brutal textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px var(--accent-primary);
}

.input-wrapper-brutal textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

/* Inline Send Button - Bottom Right */
.btn-send-brutal {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--accent-primary);
  color: var(--bg-primary);
  border: 2px solid var(--border-primary);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.15s ease;
  overflow: hidden;
  z-index: 10;
}

/* Stop button state (when generating) */
.btn-send-brutal.stop-mode {
  background: #ef4444; /* Red for stop */
  animation: pulse-stop 1.5s infinite;
}

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

.btn-send-brutal svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
  position: relative;
  z-index: 2;
}

.btn-send-brutal:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.btn-send-brutal:hover svg {
  transform: translateX(2px);
}

.btn-send-brutal:active {
  transform: translate(0, 0);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);
}

.btn-send-brutal:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-send-brutal:disabled:hover {
  transform: none;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

/* Ghost hover effect */
.btn-send-brutal::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.4s ease;
  z-index: 1;
}

.btn-send-brutal:hover::before {
  left: 100%;
}

/* ============================================
   INFO BAR
   ============================================ */

.chat-info-brutal {
  display: none; /* User requested removal of token counter */
}

.token-counter {
  display: none; /* Hidden per user request */
}

.typing-indicator {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 0.1em;
  animation: blink-brutal 1.5s infinite;
}

@keyframes blink-brutal {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ============================================
   COMPACT FILE CREATION CHIPS
   ============================================ */

.file-chip-creating,
.file-chip-success,
.file-chip-error {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid var(--border-primary);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.file-chip-creating {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border-primary);
}

.file-chip-creating .chip-icon {
  animation: pulse-brutal 1.5s infinite;
}

.file-chip-success {
  background: var(--bg-elevated);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: scale(1.05);
  font-weight: 900;
}

.file-chip-error {
  background: #ef4444;
  color: white;
  border-color: #dc2626;
}

.chip-icon {
  font-size: 0.875rem;
  line-height: 1;
}

.chip-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   CODE STREAMING EFFECT
   ============================================ */

.code-streaming {
  position: relative;
}

.code-streaming::after {
  content: '▌';
  animation: cursor-blink 0.7s infinite;
  color: var(--accent-primary);
}

@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Spinner animation for file creation */
@keyframes spin-brutal {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .ai-logo-icon {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .ai-header-brutal h3 {
    font-size: 0.875rem;
  }

  .ai-suggestions-brutal {
    gap: var(--space-xs);
  }

  .ai-chip-brutal {
    font-size: 0.7rem;
    padding: var(--space-xs);
  }
}
