body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", "Ubuntu", "Arial", "sans-serif";
  text-align: center;
  background-color: #f3faff;
  margin: 0;
  padding: 0;
}
.container {
  max-width: 85%;
  max-width: 600px;
  margin: 100px auto 50px auto; /* Added 100px padding from the top */
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.logo {
  max-width: 200px;
  margin-top: 20px;
  margin-bottom: 20px;
}
h1 {
  color: #333;
  font-weight: 400;
}
#status {
  font-size: 18px;
  margin-top: 20px;
  padding: 10px;
  background: #ffecb3;
  border-radius: 5px;
}
#timestamp {
  font-size: 14px;
  color: #777;
  margin-top: 15px;
  margin-bottom: 20px;
}
@media (max-width: 600px) {
  .container {
      width: 85%;
      padding: 15px;
      margin-top: 100px; /* Ensuring the same top margin on mobile */
  }
  .logo {
      max-width: 150px;
  }
}

/* Chat Widget Container */
.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 380px;
  height: 500px;
  background: #ffffff;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  overflow: hidden;
  display: none;
  flex-direction: column;
  transition: all 0.3s ease-in-out;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", "Ubuntu", "Arial", "sans-serif";
}

/* Chat Header */
.chat-header {
  background: #3366e6;
  color: white;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: none;
  flex-direction: column;
}

.chat-header-top {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.chat-header .ai-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background-color: #f0f0f0;
  margin-right: 12px;
}

.chat-header .ai-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-header .chat-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
  text-align: left;
}

.chat-header .chat-subtitle {
  font-weight: 400;
  font-size: 14px;
  opacity: 0.9;
  text-align: left;
}

.chat-header .header-actions {
  display: flex;
  align-items: center;
}

.chat-header .close-btn {
  cursor: pointer;
  font-size: 18px;
  padding: 0 8px;
}

/* Chat Body */
.chat-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background-color: #fff;
}

.chat-body .message {
  margin-bottom: 16px;
  padding: 0;
  border-radius: 8px;
  max-width: 85%;
  display: flex;
  align-items: flex-start;
  width: fit-content; /* Only as wide as the content */
}

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

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

.avatar {
  width: 36px;
  height: 36px;
  min-width: 36px; /* Prevents shrinking */
  border-radius: 50%;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  color: #777;
  font-size: 14px;
  overflow: hidden;
  align-self: flex-start; /* Keep avatar at the top */
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar span {
  font-weight: bold;
  font-size: 16px;
}

.user-avatar {
  background-color: #e2f0ff;
  color: #3366e6;
  margin-left: 10px;
  margin-right: 0;
}

.message-content {
  display: flex;
  flex-direction: column;
  flex: 1; /* Allow content to take available space */
  max-width: calc(100% - 46px); /* Account for avatar width + margin */
}

.message-bubble {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.4;
  color: #253E5C;
  text-align: left;
}

.sender-name {
  font-size: 13px;
  font-weight: 500;
  color: #253E5C; /* Updated from #666 to #253E5C */
  margin-bottom: 4px;
  text-align: left;
}

.ai-message .message-bubble {
  background: #f2f2f2;
  border-top-left-radius: 4px;
}

.user-message .message-bubble {
  background: #e2f0ff;
  border-top-right-radius: 4px;
}

/* Chat Footer */
.chat-footer {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  border-top: 1px solid #f0f0f0;
  background-color: #fff;
}

/* Input container */
.input-container {
  display: flex;
  align-items: center;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 8px 8px;
  flex: 1;
}

/* Input field */
.input-container input {
  flex: 1;
  padding: 0 0 0 5px;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px; /* Increased from 14px to 16px */
  color: #253E5C; /* Updated text color */
}

/* Input placeholder */
.input-container input::placeholder {
  color: #8DA0B7; /* Lighter shade of #253E5C for placeholder */
  font-size: 16px; /* Increased from 14px to 16px */
}

/* Action buttons */
.chat-actions {
  display: flex;
  align-items: center;
  margin-right: 10px;
}

.action-button {
background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #999;
  transition: color 0.2s;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-button:hover {
  color: #3366e6;
}

/* Send button */
.send-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #3366e6;
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 12px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 16px;
}

.send-button:hover {
  background: #2855c7;
}

/* Chat Toggle Button */
.chat-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #3366e6;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  font-size: 24px;
  transition: transform 0.3s ease-in-out;
}

.chat-toggle:hover {
  transform: scale(1.1);
}

/* Image tag styling */
.image-tag-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.image-tag {
  background: #e8e8e8;
  padding: 4px 5px;
  border-radius: 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  color: #253E5C; /* Updated from #555 to #253E5C */
}

.remove-image {
  background: none;
  color: #999;
  border: none;
  font-size: 14px;
  padding: 0 0 0 5px;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.remove-image:hover {
  color: #666;
}

/* Uploaded Image Styling */
.uploaded-image {
  max-width: 200px;
  border-radius: 8px;
  margin-top: 8px;
}

/* Ensure uploaded images in user messages align properly */
.chat-body .user-message .uploaded-image {
  margin-left: 0;
  margin-right: 0;
}

#emoji-picker {
  position: absolute;
  bottom: 50px;
  right: 10px;
  z-index: 1000;
  background: white;
  border-radius: 8px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  display: none; /* Initially hidden */
}

emoji-picker {
  width: 300px;
  height: 300px;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  .chat-widget {
    width: 90%;
    right: 5%;
    left: 5%;
    bottom: 10px;
    height: 80vh;
  }

  .chat-toggle {
    right: 10px;
    bottom: 10px;
  }

  #emoji-picker {
    width: 90%;
    right: 5%;
    left: 5%;
  }

  emoji-picker {
    width: 100%;
  }
}