/* --- Modern Chatbot Styles --- */
/* You can customize all colors here by changing the CSS variables */

.chatbot-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1001;
}

/* The floating bubble */
.chat-bubble {
  width: 80px;
  height: 80px;
  background-color: var(--primary-accent);
  color: var(--white);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 4px 20px hsla(0, 0%, 0%, 0.2);
  transition: transform 0.2s ease, opacity 0.3s ease;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.chat-bubble:hover {
  transform: scale(1.1);
  animation-play-state: paused;
}

/* The main chat window */
.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 370px;
  height: 500px;
  background-color: var(--white);
  border-radius: 15px;
  box-shadow: 0 10px 30px hsla(0, 0%, 0%, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-origin: bottom right;
  opacity: 0;
  transform: scale(0.5);
  transition: transform 0.3s ease-in-out, opacity 0.2s ease-in-out;
  pointer-events: none;
}

.chat-window.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.chat-bubble.hidden {
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
}

/* Chat Header */
.chat-header {
  background: linear-gradient(45deg, var(--primary-accent), #07435a);
  color: var(--white);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-header h3 {
  color: #28d900; /* Change this to any color you like! */
}
.chat-header-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%; /* Makes the image circular */
  object-fit: cover; /* Ensures the image fills the circle without distortion */
  border: 2px solid rgba(255, 255, 255, 0.8); /* Adds a nice, soft white border */
}

.chat-header-content {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-header-content i {
  font-size: 1.5rem;
}

.chat-header .chat-close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.8;
}

/* Chat Body & Messages */
.chat-body {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background-color: var(--light-bg);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message {
  padding: 12px 18px;
  border-radius: 20px;
  max-width: 85%;
  line-height: 1.5;
  animation: fadeIn 0.4s ease;
}

.bot-message {
  background-color: #e9ecef;
  color: var(--primary-text);
  border-bottom-left-radius: 5px;
  align-self: flex-start;
}
.bot-message a {
  color: var(--primary-accent);
  font-weight: 600;
}
.user-message {
  background-color: var(--primary-accent);
  color: var(--white);
  border-bottom-right-radius: 5px;
  align-self: flex-end;
}

/* Quick Reply Buttons */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  animation: fadeIn 0.5s 0.2s backwards;
}
.quick-reply-btn {
  background: none;
  border: 1px solid var(--primary-accent);
  color: var(--primary-accent);
  padding: 8px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}
.quick-reply-btn:hover {
  background-color: var(--primary-accent);
  color: var(--white);
}

/* Input Area */
.chat-input-area {
  display: flex;
  border-top: 1px solid var(--border-color);
}
.chat-input-area input {
  flex-grow: 1;
  border: none;
  padding: 15px;
  font-size: 1rem;
  outline: none;
}
.chat-input-area button {
  background: none;
  border: none;
  padding: 0 20px;
  font-size: 1.5rem;
  color: var(--primary-accent);
  cursor: pointer;
}
/* --- Add this to the end of chatbot.css --- */

/* Style for the custom avatar image in the header */
.chat-avatar {
  width: 35px; /* Set the size of the avatar */
  height: 35px;
  border-radius: 50%; /* Make it circular */
  object-fit: cover; /* Ensure the image fills the circle */
}

/* Style for a custom image inside the floating bubble */
.chat-bubble img {
  width: 65px; /* Adjust size as needed */
  height: 52px;
}
/* --- Add this to the end of chatbot.css --- */

/* New styles for avatar and message alignment */
.message-line {
  display: flex;
  align-items: flex-end; /* Aligns avatar with the bottom of the message bubble */
  gap: 10px;
  animation: fadeIn 0.4s ease; /* Re-using fadeIn animation */
}

/* Position user messages to the right */
.user-line {
  justify-content: flex-end;
}

/* The bot's avatar image next to its message */
.bot-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  /* Optional: add a small shadow to lift it off the background */
  box-shadow: 0 1px 3px hsla(0, 0%, 0%, 0.1);
}

/* Adjust message bubbles to not take up the full width */
.bot-message {
  align-self: unset; /* Remove previous alignment */
}
.user-message {
  align-self: unset; /* Remove previous alignment */
}
