.chat-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  font-family: var(--font-sans);
}

.chat-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--primary-600);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 2rem;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.chat-toggle:hover {
  background-color: var(--primary-700);
  transform: translateY(-2px);
}

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

.chat-container {
  position: absolute;
  bottom: calc(100% + 1rem);
  right: 0;
  width: 360px;
  height: 480px;
  background-color: white;
  border-radius: 1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chat-container.active {
  display: flex;
}

.chat-header {
  padding: 1rem;
  background-color: var(--primary-600);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h3 {
  margin: 0;
  color: white;
  font-size: 1rem;
}

.chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

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

.chat-message.bot {
  align-self: flex-start;
}

.message-content {
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

.chat-message.user .message-content {
  background-color: var(--primary-600);
  color: white;
  border-bottom-right-radius: 0.25rem;
}

.chat-message.bot .message-content {
  background-color: var(--gray-100);
  color: var(--gray-800);
  border-bottom-left-radius: 0.25rem;
}

.chat-input {
  padding: 1rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 0.5rem;
}

.chat-input textarea {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  resize: none;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.4;
}

.chat-input textarea:focus {
  outline: none;
  border-color: var(--primary-400);
}

.chat-input button {
  padding: 0.75rem 1.25rem;
  background-color: var(--primary-600);
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.chat-input button:hover {
  background-color: var(--primary-700);
}

@media (max-width: 640px) {
  .chat-container {
    width: calc(100vw - 2rem);
    right: -1rem;
  }
  
  .chat-toggle-text {
    display: none;
  }
  
  .chat-toggle {
    padding: 1rem;
  }
}