.floating-chat-box {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 320px;
  height: 450px;
  background: #34282C;
  color: #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  border: 1px solid #d4af37;
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.chat-header {
  padding: 12px 16px;
  background: linear-gradient(to right, #34282C, #3a2e32);
  font-weight: 600;
  border-bottom: 1px solid #d4af37;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d4af37;
  font-size: 1.1rem;
}

.chat-header::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  background: #d4af37;
  border-radius: 50%;
}

.chat-minimize-btn {
  background: transparent;
  border: none;
  color: #d4af37;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  font-size: 1.2rem;
  font-weight: 300;
}

.floating-chat-box.minimized {
  height: 48px !important;
  width: auto;
  min-width: 200px;
  max-width: 300px;
  padding: 0 16px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #2a1f22;
}

.chat-input-area {
  padding: 8px 12px;
  background: #34282C;
  border-top: 1px solid #443438;
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 2px 12px;
  border: 1px solid #443438;
  outline: none;
  background: #2a1f22;
  color: white;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  min-height: 40px;
  max-height: 80px;
  resize: none;
  line-height: 1.4;
}

.chat-header-buttons {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.chat-close-btn {
  margin-left: auto; /* Pushes button to the right */
  background: transparent;
  border: none;
  color: #d4af37;
  font-size: 1.5rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  line-height: 1;
}

.chat-close-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  transform: rotate(90deg);
}

.chat-close-btn:active {
  transform: rotate(90deg) scale(0.9);
}


.message-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #d4af37; /* Gold color to match theme */
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.message-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  transform: translateY(-1px);
}

.message-btn:active {
  transform: translateY(0);
}

/* Custom message icon using SVG */
.message-btn::after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23d4af37'%3E%3Cpath d='M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.send-button {
  background: #d4af37;
  color: #34282C;
  border: none;
  border-radius: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.send-button:hover {
  background: #e8c252;
  transform: translateY(-1px);
}

.send-button:active {
  transform: translateY(0);
}

.msg {
  padding: 10px 14px;
  border-radius: 18px;
  max-width: 80%;
  font-size: 0.95rem;
  line-height: 1.4;
  position: relative;
  word-wrap: break-word;
}

.msg.from-me {
  align-self: flex-end;
  background: #d4af37;
  color: #34282C;
  border-bottom-right-radius: 4px;
}

.msg.from-them {
  align-self: flex-start;
  background: #443438;
  color: #f0f0f0;
  border-bottom-left-radius: 4px;
}

.msg-time {
  display: block;
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 4px;
  text-align: right;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #2a1f22;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #d4af37;
  border-radius: 3px;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  padding: 8px 16px;
  background: #443438;
  border-radius: 18px;
  align-self: flex-start;
  margin-bottom: 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #d4af37;
  border-radius: 50%;
  margin: 0 2px;
  animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingAnimation {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}