/* Chatbot Container */
#chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Avatar */
#chatbot-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

#chatbot-avatar:hover {
  transform: scale(1.05);
}

#chatbot-avatar video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  pointer-events: none;
}

/* Tooltip Message */
#chatbot-tooltip {
  background: #1E4E8C;
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeShake 2.5s ease forwards;
}

/* Shake + Fade Animation */
@keyframes fadeShake {
  0% { opacity: 0; transform: translateY(10px) rotate(0deg);}
  30% { opacity: 1; transform: translateY(0) rotate(-2deg);}
  50% { transform: rotate(2deg);}
  70% { transform: rotate(-2deg);}
  100% { transform: rotate(0deg);}
}

/* Chatbox Modal */
#chatbox-modal {
  position: fixed;
  top: auto;
  left: auto;
  bottom: 100px;
  right: 20px;
  width: 360px;
  max-height: 520px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  font-family: 'Segoe UI', sans-serif;
  transition: all 0.3s ease;
}

/* Minimized State */
.chatbox.minimized {
  height: 50px;
  overflow: hidden;
}

.chatbox.minimized.chat-body,
.chatbox.minimized.chat-input,
.chatbox.minimized #typing-indicator {
  display: none;
}

.chat-header {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #1E4E8C;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.05), 0 2px 6px rgba(0,0,0,0.1);
}

.chat-header span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 1rem;
}

/* Windows 11-style buttons */
.chat-controls {
  display: flex;
  gap: 6px;
}

.chat-controls button {
  width: 28px;
  height: 28px;
  background-color: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 6px;
  color: #1E4E8C;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.chat-controls button:hover {
  background-color: rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

/* Chat Body */
.chat-body {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: transparent;
}

/* Message Bubble */
.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 90%;
}

.chat-message.bot {
  align-self: flex-start;
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

/* Avatar */
.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

/* Bubble */
.chat-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-wrap: break-word;
  max-width: 240px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.chat-message.bot.chat-bubble {
  background: #f1f1f1;
  color: #333;
}

.chat-message.user.chat-bubble {
  background: #1E4E8C;
  color: white;
}

/* Input */
.chat-input {
  display: flex;
  border-top: 1px solid #ddd;
  padding: 10px;
  background: rgba(250, 250, 250, 0.9);
}

.chat-input input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 8px;

padding: 8px 12px;
  font-size: 0.9rem;
  outline: none;
}

.chat-input button {
  background: #1E4E8C;
  color: white;
  border: none;
  padding: 8px 14px;
  margin-left: 8px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.chat-input button:hover {
  background-color: #2A6ACB;
}

/* Typing Indicator */
.typing {
  font-style: italic;
  opacity: 0.7;
}

#typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

/* Responsive Layout */
@media screen and (max-width: 480px) {
  #chatbox-modal {
    width: 90%;
    right: 5%;
    bottom: 80px;
}

.chat-bubble {
    max-width: 100%;
}
}