/**
 * AI Chat UI Styles
 * 
 * Provides styling for the AI Discovery Chat interface
 */

/* Container */
.ai-chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #f8fafc;
  min-height: 100%;
}

/* Welcome Header */
.ai-chat-welcome {
  flex-shrink: 0;
}

/* Messages Container */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Archived Conversations */
.archived-conversation {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: all 0.2s;
}

.archive-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  cursor: pointer;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.2s;
}

.archive-header:hover {
  background: #e2e8f0;
}

.archive-info {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex: 1;
  min-width: 0;
}

.archive-icon {
  flex-shrink: 0;
  color: #64748b;
}

.archive-preview {
  font-size: 0.875rem;
  color: #475569;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.archive-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
  margin-left: 0.5rem;
}

.archive-toggle {
  flex-shrink: 0;
  color: #64748b;
  transition: transform 0.2s;
}

.archived-conversation.collapsed .archive-toggle {
  transform: rotate(-90deg);
}

.archive-messages {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: white;
}

.archived-conversation.collapsed .archive-messages {
  display: none;
}

/* Message */
.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-user {
  align-self: flex-end;
}

.message-ai {
  align-self: flex-start;
}

.message-content {
  padding: 1rem 1.25rem;
  border-radius: 1.25rem;
  word-wrap: break-word;
  white-space: normal;
  line-height: 1.6;
  font-size: 0.9375rem;
}

.message-content strong {
  font-weight: 700;
  color: inherit;
}

.message-content .paragraph {
  margin-bottom: 0.875rem;
  display: block;
}

.message-content .paragraph:last-child {
  margin-bottom: 0;
}

.message-content .list-item {
  margin-bottom: 0.625rem;
  padding-left: 0.25rem;
  display: block;
  line-height: 1.7;
}

.message-content .list-item:last-child {
  margin-bottom: 0;
}

.message-user .message-content {
  background: #3b82f6;
  color: white;
  border-bottom-right-radius: 0.375rem;
}

.message-ai .message-content {
  background: white;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 0.375rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.message-timestamp {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.5rem;
  padding: 0 0.75rem;
}

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

.message-ai .message-timestamp {
  text-align: left;
}

/* Message Footer */
.message-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding: 0 0.75rem;
  gap: 0.75rem;
}

.message-user .message-footer {
  flex-direction: row-reverse;
}

/* Message Actions */
.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0 0.75rem;
}

/* Inline Entity Button Container */
.inline-entity-btn-container {
  margin: 0.5rem 0;
  padding: 0;
}

.action-btn,
.entity-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  border: 2px solid #10b981;
  border-radius: 0.75rem;
  background: white;
  color: #10b981;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
  flex-shrink: 0;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Inline entity buttons - slightly smaller and more compact */
.inline-entity-btn {
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  border-width: 1.5px;
}

.entity-btn {
  border-color: #10b981;
  color: #10b981;
  max-width: 100%;
}

.entity-btn span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.action-btn:hover,
.entity-btn:hover {
  background: #10b981;
  color: white;
  border-color: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.entity-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.entity-btn:hover {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.action-btn:active,
.entity-btn:active {
  transform: translateY(0);
}

.action-btn svg,
.entity-btn svg {
  flex-shrink: 0;
}

/* Listen Button */
.listen-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: white;
  color: #64748b;
  cursor: pointer;
  font-size: 0.8125rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.listen-btn:hover {
  background: #f8fafc;
  border-color: #0ea5e9;
  color: #0ea5e9;
}

.listen-btn:active {
  transform: scale(0.95);
}

.listen-btn.speaking {
  background: #0ea5e9;
  border-color: #0ea5e9;
  color: white;
  animation: speakingPulse 1.5s infinite;
}

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

.listen-btn svg {
  flex-shrink: 0;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: #64748b;
  font-size: 0.875rem;
}

.typing-dots {
  display: flex;
  gap: 0.375rem;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* Input Area - Voice Only */
.chat-input-area {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1.5rem;
  background: white;
  border-top: 1px solid #e2e8f0;
}

.voice-btn-large {
  width: 120px;
  height: 120px;
  border: none;
  border-radius: 50%;
  background: #ef4444;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(239, 68, 68, 0.3);
}

.voice-btn-large:hover {
  background: #dc2626;
  transform: scale(1.05);
  box-shadow: 0 12px 24px rgba(239, 68, 68, 0.4);
}

.voice-btn-large:active {
  transform: scale(0.95);
}

.voice-btn-large:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.voice-btn-large.recording {
  background: #dc2626;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% {
    opacity: 0.9;
    box-shadow: 0 0 0 20px rgba(239, 68, 68, 0);
  }
}

/* Starter Questions */
.starter-questions {
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.starter-questions h3 {
  margin-bottom: 1.75rem;
  color: #64748b;
  font-weight: 500;
  font-size: 1rem;
}

.starter-questions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
}

.starter-question-btn {
  padding: 1.125rem 1.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  background: white;
  color: #475569;
  cursor: pointer;
  font-size: 0.9375rem;
  text-align: left;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  line-height: 1.5;
}

.starter-question-btn:hover {
  background: #f8fafc;
  border-color: #0ea5e9;
  color: #0ea5e9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.starter-question-btn:active {
  transform: translateY(0);
}

/* Reset Notice */
.reset-notice {
  padding: 0.75rem 1rem;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 0.625rem;
  text-align: center;
  color: #1e40af;
  font-size: 0.875rem;
  animation: fadeIn 0.3s ease-in;
  margin: 0.5rem 0;
}

/* Premium Prompt */
.premium-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.premium-prompt-content {
  background: white;
  border-radius: 1rem;
  padding: 2.5rem 2rem;
  max-width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.premium-prompt-content h2 {
  margin: 0 0 1.25rem 0;
  color: #1e293b;
  font-size: 1.5rem;
  font-weight: 700;
  padding: 0 0.75rem;
}

.premium-prompt-content p {
  color: #64748b;
  line-height: 1.7;
  margin-bottom: 1.75rem;
  font-size: 0.9375rem;
  padding: 0 0.75rem;
}

.premium-benefits {
  margin-bottom: 2rem;
  padding: 0 0.75rem;
}

.premium-benefits h3 {
  margin: 0 0 1.25rem 0;
  color: #334155;
  font-size: 1.125rem;
  font-weight: 600;
  padding: 0 0.25rem;
}

.premium-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.premium-benefits li {
  padding: 0.75rem 0.5rem;
  color: #475569;
  line-height: 1.6;
  font-size: 0.9375rem;
}

.premium-actions {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 0 0.75rem;
}

.btn-primary,
.btn-secondary {
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #0ea5e9;
  color: white;
}

.btn-primary:hover {
  background: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.3);
}

.btn-secondary {
  background: white;
  color: #0ea5e9;
  border: 2px solid #0ea5e9;
}

.btn-secondary:hover {
  background: #f0f9ff;
}

.btn-primary:active,
.btn-secondary:active {
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .message {
    max-width: 85%;
  }
  
  .premium-prompt {
    padding: 1.25rem;
  }
  
  .premium-prompt-content {
    padding: 2rem 1.5rem;
  }
  
  .chat-input-area {
    padding: 1.5rem 1rem;
  }
  
  .voice-btn-large {
    width: 100px;
    height: 100px;
  }
  
  .voice-btn-large svg {
    width: 36px;
    height: 36px;
  }
  
  .messages-container {
    padding: 1.25rem;
  }
  
  .starter-questions {
    padding: 2rem 1.25rem;
  }
  
  .archive-preview {
    font-size: 0.8125rem;
  }
  
  .archive-meta {
    display: none;
  }
  
  .archive-header {
    padding: 0.75rem 0.875rem;
  }
  
  .archive-messages {
    padding: 0.75rem;
  }
}

