/* Chat Widget Styles */

/* Chat Widget Wrapper */
.chat-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(to bottom, #fdfdfd, #f5f5f5);
  height: 600px;
  overflow-y: auto;
  width: 400px;
  max-height: 100vh;
  font-family: 'Inter', 'IBM Plex Sans', sans-serif;
  border-radius: 12px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  transition: 0.3s ease-in-out;
  z-index: 9999;
}

.chat-wrapper.is-hidden {
  display: none;
}

/* Header Container */
.chat-btn-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: black;
  width: 100%;
  padding: 10px;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}

.chat-upper-left {
  border-radius: 50%;
  background-color: white;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.chat-avatar-img {
  border-radius: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-upper-right {
  display: flex;
  align-items: center;
  justify-content: space-around;
  column-gap: 10px;
}

.chat-icon {
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition: 0.2s ease;
  filter: brightness(1);
}

.chat-icon:hover {
  filter: brightness(1.2);
}

/* Chat Interface */
.chat-interface {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  overflow-y: auto;
  flex: 1;
  width: 100%;
  padding: 12px;
  position: relative;
}

#messagesContainer {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Messages */
.chat-user-message,
.chat-other-message {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  column-gap: 10px;
  max-width: 100%;
  margin: 0;
}

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

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

.chat-avatar-picture,
.chat-sender-picture {
  width: 44px;
  height: 45px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.chat-msg-container {
  width: 85%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.chat-msg-text {
  position: relative;
  background-color: white;
  padding: 8px 12px;
  border-radius: 16px;
  box-shadow: 0px 2px 5px rgba(118, 117, 117, 0.3);
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  max-width: 100%;
  overflow-wrap: break-word;
  margin: 0;
  width: 100%;
}

.chat-msg-text a {
  color: #927238;
  text-decoration: underline;
  font-weight: bold;
}

.chat-msg-text a:hover {
  color: #816431;
}

.chat-msg-text ul {
  margin: 4px 0;
  padding-left: 20px;
}

.chat-msg-text li {
  margin: 2px 0;
}

.chat-msg-text strong {
  font-weight: 600;
}

/* Message Date */
.chat-msg-date {
  font-size: 0.75rem;
  color: #999;
}

.chat-msg-date-user {
  align-self: flex-start;
}

.chat-msg-date-other {
  align-self: flex-end;
}

/* Input Area */
.chat-input-area {
  width: 100%;
  padding: 0 12px 12px;
  flex-shrink: 0;
  position: relative;
}

.chat-loading {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 8px;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.chat-inp {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 12px;
  border: 1px solid #333;
  border-radius: 32px;
  background-color: #fafafa;
  gap: 8px;
}

.chat-input-message {
  outline: none;
  background-color: transparent;
  flex-grow: 1;
  padding: 6px 0;
  border: none;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  color: #333;
}

.chat-input-message::placeholder {
  color: #ccc;
}

.chat-send {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.2s ease;
  filter: brightness(1);
}

.chat-send:hover {
  filter: brightness(0.8);
}

/* Responsive */
@media (max-width: 768px) {
  .chat-wrapper {
    position: fixed;
    height: 100%;
    width: 100%;
    right: 0;
    bottom: 0;
    border-radius: 0;
  }

  .chat-btn-container {
    border-radius: 0;
  }
}
