/* File: ~/frappe-bench/apps/faircodelab_chatbot/faircodelab_chatbot/public/css/chatbot.css */

/* Chatbot Toggle Button */
.chatbot-toggle-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #228B22; /* Green color */
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 24px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  animation: bounce 2s infinite;
}

.chatbot-toggle-button:hover {
  background-color: #1e7d1e;
}

/* Keyframes for bounce animation */
@keyframes bounce {
  0%, 100% {
    transform: translateY(-5%);
  }
  50% {
    transform: translateY(0);
  }
}

/* Chatbot Container */
.chatbot-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 400px; /* Increased width */
  max-height: 500px;
  border-radius: 10px;
  background-color: #fff;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  font-family: 'Verdana', sans-serif;
  font-size: 14px;
  color: #333;
  z-index: 999;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Chatbot Header */
.chatbot-header {
  background: linear-gradient(to right, #228B22, #1e7d1e);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
}

.header-left {
  display: flex;
  align-items: center;
}

.assistant-avatar {
  position: relative;
}

.assistant-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background-color: #00ff00;
  border: 2px solid #fff;
  border-radius: 50%;
}

.assistant-info {
  margin-left: 10px;
}

.assistant-info h3 {
  margin: 0;
  font-size: 16px;
}

.assistant-info p {
  margin: 0;
  font-size: 12px;
  color: #c8e6c9;
}

.header-right {
  display: flex;
  gap: 5px;
}

.chatbot-header-button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
}

.chatbot-header-button:hover {
  color: #c8e6c9;
}

/* Chat Window */
#chat-window {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background-color: #f5f5f5;
  display: flex;
  flex-direction: column;
}

.message {
  margin: 5px 0;
  max-width: 80%;
  word-wrap: break-word;
  padding: 8px 12px;
  border-radius: 15px;
  position: relative;
}

.user-message {
  align-self: flex-end;
  background-color: #228B22;
  color: #fff;
  border-bottom-right-radius: 0;
}

.bot-message {
  align-self: flex-start;
  background-color: #fff;
  color: #333;
  border-bottom-left-radius: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.timestamp {
  font-size: 10px;
  color: #999;
  margin-top: 2px;
  display: block;
  text-align: right;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  color: #666;
  margin-top: 5px;
}

.typing-indicator i {
  margin-right: 5px;
}

/* Input Container */
.input-container {
  display: flex;
  padding: 10px;
  border-top: 1px solid #ccc;
  align-items: center;
  background-color: #fff;
}

.input-container input[type="text"] {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ccc;
  border-radius: 25px;
  outline: none;
  background-color: #f5f5f5;
}

.input-container input[type="text"]:focus {
  border-color: #228B22;
}

.input-container button {
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 5px;
}

.input-container .voice-button i,
.input-container .send-button i {
  font-size: 20px;
  color: #666;
}

.input-container .voice-button:hover i,
.input-container .send-button:hover i {
  color: #228B22;
}

.is-recording .voice-button i {
  color: #d32f2f; /* Change color when recording */
}

.is-recording .voice-button:hover i {
  color: #b71c1c;
}

/* Adjustments for minimized state */
.chatbot-container.minimized {
  height: 60px;
}

.chatbot-container.minimized #chat-window,
.chatbot-container.minimized .input-container {
  display: none;
}

/* Adjustments for mobile responsiveness */
@media screen and (max-width: 600px) {
  .chatbot-container {
    width: 90%;
    right: 5%;
    bottom: 80px;
  }
}