/* AI Chat Assistant Styles */
#ai-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #4a90d9;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 9999;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}
#ai-chat-btn:hover { transform: scale(1.08); background: #357abd; }

#ai-chat-window {
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 380px;
  height: 520px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 9998;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#ai-chat-window.open { display: flex; }

#ai-chat-header {
  padding: 14px 16px;
  background: #4a90d9;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
#ai-chat-header button {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.8;
}
#ai-chat-header button:hover { opacity: 1; }

#ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}
.ai-msg.user {
  align-self: flex-end;
  background: #4a90d9;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-msg.bot {
  align-self: flex-start;
  background: #f0f2f5;
  color: #333;
  border-bottom-left-radius: 4px;
}
.ai-msg.bot .typing-dot {
  display: inline-block;
  animation: blink 1.2s infinite;
}
@keyframes blink { 0%,100%{opacity:.2} 50%{opacity:1} }

#ai-chat-input-area {
  display: flex;
  padding: 10px 12px;
  border-top: 1px solid #e8e8e8;
  gap: 8px;
  flex-shrink: 0;
}
#ai-chat-input {
  flex: 1;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  resize: none;
  max-height: 80px;
  font-family: inherit;
}
#ai-chat-input:focus { border-color: #4a90d9; }
#ai-chat-send {
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
}
#ai-chat-send:hover { background: #357abd; }
#ai-chat-send:disabled { background: #a0c4e8; cursor: not-allowed; }

#ai-chat-status {
  padding: 4px 12px;
  font-size: 12px;
  color: #999;
  text-align: center;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  #ai-chat-window {
    width: calc(100vw - 16px);
    height: calc(100vh - 120px);
    right: 8px;
    bottom: 80px;
    border-radius: 8px;
  }
}
