/* Chat Interface Styling */

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Chat Header */
.chat-header {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chat-agent-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chat-agent-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.chat-agent-details {
  display: flex;
  flex-direction: column;
}

.chat-agent-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
}

.chat-agent-description {
  font-size: 0.875rem;
  color: #64748b;
}

.chat-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.chat-brand:hover {
  color: #0f172a;
}

.chat-brand-icon {
  font-size: 1.25rem;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chat-welcome {
  text-align: center;
  padding: 3rem 2rem;
  max-width: 600px;
  margin: auto;
}

.chat-welcome-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.chat-welcome-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.chat-welcome-text {
  font-size: 1rem;
  color: #64748b;
  line-height: 1.6;
}

.message {
  display: flex;
  gap: 0.75rem;
  max-width: 800px;
  animation: messageSlideIn 0.3s ease-out;
}

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

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

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.message.user-message .message-avatar {
  background: #e2e8f0;
}

.message.assistant-message .message-avatar {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
}

.message-content {
  background: white;
  padding: 0.875rem 1.125rem;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  line-height: 1.6;
  color: #0f172a;
}

.message.user-message .message-content {
  background: #6366f1;
  color: white;
  border-bottom-right-radius: 0.25rem;
}

.message.assistant-message .message-content {
  border-bottom-left-radius: 0.25rem;
}

.message-time {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 0.75rem;
  max-width: 800px;
}

.typing-indicator .message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
}

.typing-dots {
  background: white;
  padding: 0.875rem 1.125rem;
  border-radius: 1rem;
  border-bottom-left-radius: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  gap: 0.375rem;
  align-items: center;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  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% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Chat Input */
.chat-input-container {
  background: white;
  border-top: 1px solid #e2e8f0;
  padding: 1rem 1.5rem;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.chat-input-wrapper {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: 0.875rem 1.125rem;
  border: 2px solid #e2e8f0;
  border-radius: 1.5rem;
  font-size: 1rem;
  color: #0f172a;
  resize: none;
  min-height: 48px;
  max-height: 120px;
  font-family: inherit;
  transition: all 0.2s;
}

.chat-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.chat-input::placeholder {
  color: #94a3b8;
}

.chat-send-button {
  width: 48px;
  height: 48px;
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-send-button:hover:not(:disabled) {
  background: #4f46e5;
  transform: scale(1.05);
}

.chat-send-button:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

/* Error Message */
.error-message {
  background: #fef2f2;
  color: #991b1b;
  padding: 0.875rem 1.125rem;
  border-radius: 0.5rem;
  border: 1px solid #fecaca;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
  .chat-header {
    padding: 1rem;
  }

  .chat-messages {
    padding: 1.5rem 1rem;
  }

  .chat-input-container {
    padding: 0.875rem 1rem;
  }

  .chat-agent-name {
    font-size: 1rem;
  }

  .chat-agent-description {
    font-size: 0.8125rem;
  }

  .chat-brand {
    font-size: 0.8125rem;
  }

  .message {
    max-width: 100%;
  }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Message Body Wrapper */
.message-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Message Feedback Buttons */
.message-feedback {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.feedback-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  color: #64748b;
}

.feedback-btn:hover:not(:disabled) {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.feedback-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.feedback-btn.active {
  border-color: #6366f1;
  background: #eef2ff;
  color: #6366f1;
}

.feedback-btn.feedback-like.active {
  border-color: #10b981;
  background: #d1fae5;
  color: #10b981;
}

.feedback-btn.feedback-unlike.active {
  border-color: #ef4444;
  background: #fee2e2;
  color: #ef4444;
}

.feedback-count {
  font-weight: 600;
  font-size: 0.8125rem;
}
