/* Chat Interface Shadow CSS */

/* Chat Interface Styles */
.chat-interface {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-avatar {
  width: 32px;
  height: 32px;
  background: #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.agent-avatar svg {
  width: 16px;
  height: 16px;
}

.agent-info h4 {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  color: #111827;
}

.agent-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
}

.end-chat-btn {
  background: #ef4444;
  border: 1px solid #dc2626;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.end-chat-btn:hover {
  background: #dc2626;
  border-color: #b91c1c;
}

/* Messages Area */
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 0;
}

.welcome-message {
  text-align: center;
  padding: 32px 0;
}

.welcome-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: white;
}

.welcome-avatar svg {
  width: 24px;
  height: 24px;
}

.welcome-text {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

.message {
  display: flex;
  margin-bottom: 16px;
}

.message.user {
  justify-content: flex-end;
}

.message.agent {
  justify-content: flex-start;
}

.message-content {
  max-width: 75%;
  border-radius: 16px;
  padding: 12px;
  position: relative;
}

.message.user .message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.message.agent .message-content {
  background: #f3f4f6;
  color: #111827;
}

.message-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.message-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.message.agent .message-avatar {
  background: #10b981;
  color: white;
}

.message.user .message-avatar {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.message-avatar svg {
  width: 12px;
  height: 12px;
}

.message-body {
  flex: 1;
}

.message-text {
  font-size: 14px;
  margin: 0 0 4px 0;
  line-height: 1.4;
}

.message-time {
  font-size: 12px;
  opacity: 0.7;
}

/* Input Area */
.input-area {
  padding: 16px;
  border-top: 1px solid #e5e7eb;
}

.input-form {
  display: flex;
  gap: 8px;
}

.message-input {
  flex: 1;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.message-input:focus {
  border-color: #667eea;
}

.send-button {
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.send-button:hover {
  opacity: 0.9;
}

.send-button svg {
  width: 16px;
  height: 16px;
}

.file-button {
  width: 40px;
  height: 40px;
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.file-button:hover {
  background: #e5e7eb;
  color: #374151;
}

.file-button svg {
  width: 16px;
  height: 16px;
}

.selected-files {
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.selected-file {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f3f4f6;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.file-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-file {
  width: 16px;
  height: 16px;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.remove-file svg {
  width: 12px;
  height: 12px;
}

/* Message Assets */
.message-assets {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.asset-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.asset-image {
  max-width: 200px;
  max-height: 150px;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.asset-image:hover {
  opacity: 0.8;
}

.asset-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease;
}

.asset-file:hover {
  background: rgba(255, 255, 255, 0.2);
}

.asset-file svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.asset-file span {
  font-size: 14px;
  font-weight: 500;
}

/* Loading States */
.asset-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.asset-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
  .messages-area {
    padding: 12px;
  }

  .input-area {
    padding: 12px;
  }

  .chat-header {
    padding: 12px;
  }
}