* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.chat-container {
    position: fixed; /* Ensures the chat stays on top and in place */
    bottom: 20px; /* Adjusts the position from the bottom */
    right: 20px; /* Adjusts the position from the right */
    z-index: 9999; /* Ensures it's above other elements */
    background: white; /* Optional: To make sure it stands out */
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2); /* Adds a slight shadow for visibility */
    border-radius: 10px; /* Makes it look better */
}

.chat-container {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
  background-color: #f3f4f6;
  min-height: 100vh;
}

.chat-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 320px;
  height: 600px;
  background-color: white;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.chat-container.minimized {
  transform: translateY(calc(100% - 60px));
}

.chat-header {
  background-color: #4f46e5;
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.chat-header:hover {
  background-color: #4338ca;
}

.bot-icon {
  color: white;
}

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

.message {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  max-width: 70%;
}

.message.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user .avatar {
  background-color: #4f46e5;
  color: white;
}

.assistant .avatar {
  background-color: #eef2ff;
  color: #4f46e5;
}

.message-content {
  padding: 0.75rem;
  border-radius: 0.5rem;
  white-space: pre-wrap;
}

.user .message-content {
  background-color: #4f46e5;
  color: white;
}

.assistant .message-content {
  background-color: #f3f4f6;
  color: #1f2937;
}

.chat-form {
  padding: 1rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 0.5rem;
}

input {
  flex: 1;
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: #4f46e5;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

button:hover {
  background-color: #4338ca;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.loading .message-content {
  display: flex;
  align-items: center;
}

.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 480px) {
  .chat-container {
    width: calc(100% - 40px);
    height: 80vh;
  }
}