/* Chat Icon */
#chatIcon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0b84ff, #3dc1d3);
  color: white;
  font-size: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Chat Widget Container */
.chatbot-container {
  position: fixed;
  bottom: 90px; /* above chat icon */
  right: 20px;
  width: 350px;
  max-width: 90vw;
  height: 500px;
  max-height: 70vh;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  background-color: #fff;
  transform: scale(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease-in-out;
}

/* Show the widget */
.chatbot-container.open {
  transform: scale(1);
}

/* Header with close button */
.chat-header {
  background: linear-gradient(135deg, #0b84ff, #3dc1d3);
  color: white;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  position: relative;
}

#closeBtn {
  position: absolute;
  right: 10px;
  top: 8px;
  background: rgba(255,255,255,0.3);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-weight: bold;
  color: white;
}

/* Chat messages background */
.chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(160deg, #e0f7fa, #f1f8e9, #fff9c4);
  border-top: 1px solid #ccc;
}

/* Messages styling */
.message {
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 80%;
  word-wrap: break-word;
}

.message.user {
  align-self: flex-end;
  background: rgba(11, 132, 255, 0.85);
  color: white;
}

.message.bot {
  align-self: flex-start;
  background: rgba(240, 240, 240, 0.85);
  color: #111;
}

/* Input */
.chat-input {
  display: flex;
  padding: 10px;
  gap: 6px;
  background: #f0f0f0;
}

.chat-input input {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.chat-input button {
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  background-color: #0b84ff;
  color: white;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.chat-input button:hover {
  background-color: #0a72d1;
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(0,0,0,0.25);
}

/* Message counter */
#messageCounter {
  padding: 4px 10px;
  font-size: 12px;
  color: #555;
  text-align: right;
}
