/* Floating Chat Button */
#hsky-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#hsky-chat-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

#hsky-chat-btn svg {
  width: 28px;
  height: 28px;
  fill: white;
}

/* Chat Panel */
#hsky-chat-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 350px;
  height: 500px;
  max-height: 80vh;
  background-color: #1e293b;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  border: 1px solid #334155;
}

#hsky-chat-panel.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* Header */
.hsky-chat-header {
  background-color: #0f172a;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #334155;
}

.hsky-chat-header h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hsky-chat-header .status-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
}

.hsky-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 20px;
  padding: 0;
  line-height: 1;
}
.hsky-close-btn:hover { color: #f8fafc; }

/* Messages Area */
.hsky-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #1e293b;
}

/* Scrollbar */
.hsky-chat-messages::-webkit-scrollbar { width: 6px; }
.hsky-chat-messages::-webkit-scrollbar-track { background: #1e293b; }
.hsky-chat-messages::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }

/* Message Bubbles */
.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.msg-user {
  align-self: flex-end;
  background-color: #10b981;
  color: white;
  border-bottom-right-radius: 4px;
}

.msg-bot {
  align-self: flex-start;
  background-color: #334155;
  color: #f8fafc;
  border-bottom-left-radius: 4px;
}

/* Markdown specific styling in bot messages */
.msg-bot p { margin: 0 0 8px 0; }
.msg-bot p:last-child { margin: 0; }
.msg-bot strong { color: #10b981; }

/* Input Area */
.hsky-chat-input-area {
  padding: 12px;
  background-color: #0f172a;
  border-top: 1px solid #334155;
  display: flex;
  gap: 8px;
}

#hsky-chat-input {
  flex: 1;
  background-color: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
#hsky-chat-input:focus { border-color: #10b981; }

#hsky-chat-submit {
  background-color: #10b981;
  color: white;
  border: none;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
}
#hsky-chat-submit:hover { background-color: #059669; }

#hsky-chat-submit svg {
  width: 16px;
  height: 16px;
  fill: white;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background-color: #334155;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: #94a3b8;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}
