/*
  =================================
  CELO AI CHATBOT STYLESHEET
  =================================
*/

:root {
  --chat-primary: #9eeb47;
  --chat-primary-hover: #a0d970;
  --chat-dark-text: #152215;
  --chat-light-text: #2c3e2c;
  --chat-widget-bg: #f4f8f4;
  --chat-bot-msg-bg: #e9f5e9;
  --chat-bot-msg-border: #d4e9d4;
  --chat-border-light: #ddd;
}

/* --- Main Widget & Button --- */
#ai-chat-btn {
  position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px;
  background-color: var(--chat-primary); color: var(--chat-dark-text);
  border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 28px; cursor: pointer; box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  z-index: 1000; transition: all 0.3s ease; animation: chatbot-pulse 2s infinite;
}

@keyframes chatbot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(137, 199, 88, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(137, 199, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(137, 199, 88, 0); }
}

#ai-chat-btn:hover {
  transform: scale(1.1); box-shadow: 0 12px 25px rgba(0,0,0,0.4); background-color: var(--chat-primary-hover);
}

#ai-chat-widget {
  position: fixed; bottom: 100px; right: 30px; width: 350px; max-width: 90vw;
  height: 500px; max-height: 70vh; background-color: var(--chat-widget-bg);
  border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  display: flex; flex-direction: column; z-index: 1001;
  transform-origin: bottom right; transition: transform 0.3s ease, opacity 0.3s ease;
}

#ai-chat-widget.hidden {
  transform: scale(0); opacity: 0; pointer-events: none;
}

/* --- Header --- */
.chat-header {
  background-color: var(--chat-primary); color: var(--chat-dark-text); padding: 15px 20px;
  font-weight: bold; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0;
}
.chat-header-title { display: flex; align-items: center; gap: 10px; }
.chat-header-title i { font-size: 1.2rem; }
.chat-header-controls { display: flex; align-items: center; }
.chat-header-controls button {
  background: none; border: none; cursor: pointer; color: var(--chat-dark-text);
  opacity: 0.8; transition: all 0.2s ease;
}
.chat-header-controls button:hover { opacity: 1; transform: scale(1.1); }
#clear-chat-btn { font-size: 16px; margin-right: 10px; padding: 5px; }
#close-chat-btn { font-size: 24px; padding: 0 5px; }

/* --- Messages Area --- */
.chat-messages {
  flex-grow: 1; padding: 20px; overflow-y: auto; color: var(--chat-light-text);
  display: flex; flex-direction: column; gap: 15px;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: #e0e0e0; }
.chat-messages::-webkit-scrollbar-thumb { background-color: var(--chat-primary); border-radius: 6px; }

.chat-message {
  padding: 10px 15px; border-radius: 18px; max-width: 85%;
  line-height: 1.5; word-wrap: break-word;
  opacity: 0; transform: translateY(10px); transition: opacity 0.4s ease, transform 0.4s ease;
}
.chat-message.visible { opacity: 1; transform: translateY(0); }

.bot-message {
  background-color: var(--chat-bot-msg-bg); border: 1px solid var(--chat-bot-msg-border);
  align-self: flex-start; border-bottom-left-radius: 4px;
}
.user-message {
  background-color: var(--chat-primary); color: var(--chat-dark-text);
  align-self: flex-end; border-bottom-right-radius: 4px;
}
.typing-indicator { align-items: center; gap: 5px; padding: 10px 15px; }
.typing-indicator span {
  width: 8px; height: 8px; background-color: #888; border-radius: 50%;
  animation: typing-bubble 1.2s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bubble { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }

/* --- Interactive Elements --- */
.chat-action-btn {
  display: inline-block; margin-top: 10px; padding: 10px 18px;
  background-color: var(--chat-primary); color: var(--chat-dark-text) !important;
  text-decoration: none; border-radius: 25px; font-weight: bold;
  transition: all 0.2s ease; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.chat-action-btn:hover {
  background-color: var(--chat-primary-hover); transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.chat-action-btn i { margin-right: 8px; }

.feedback-prompt {
  border-top: 1px solid var(--chat-bot-msg-border); margin-top: 12px; padding-top: 8px;
  font-size: 0.9em; color: #555;
}
.feedback-prompt span { margin-right: 10px; }
.feedback-btn { cursor: pointer; font-size: 1.2em; margin: 0 5px; opacity: 0.7; transition: all 0.2s ease; }
.feedback-btn:hover { opacity: 1; transform: scale(1.2); }
.feedback-prompt.submitted { color: var(--chat-primary); font-weight: bold; }

/* --- Quick Replies & Input Area --- */
.chat-quick-replies {
  padding: 10px 15px; display: flex; flex-wrap: wrap; gap: 8px;
  border-top: 1px solid var(--chat-border-light); background-color: var(--chat-widget-bg);
  max-height: 80px; overflow-y: auto;
}
.quick-reply-btn {
  background-color: transparent; border: 1px solid var(--chat-primary);
  color: var(--chat-primary); padding: 8px 12px; border-radius: 20px;
  cursor: pointer; font-size: 0.9rem; transition: all 0.2s ease;
}
.quick-reply-btn:hover { background-color: var(--chat-primary); color: var(--chat-dark-text); }

.chat-input-area {
  display: flex; border-top: 1px solid var(--chat-border-light);
  padding: 10px; flex-shrink: 0; background-color: #fff;
}
#chat-input {
  flex-grow: 1; border: none; outline: none; padding: 10px; font-size: 1rem;
  background: transparent; color: var(--chat-light-text);
}
#send-chat-btn {
  background: none; border: none; color: var(--chat-primary); font-size: 20px;
  cursor: pointer; padding: 0 10px; transition: color 0.2s;
}
#send-chat-btn:hover { color: var(--chat-primary-hover); }

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
  #ai-chat-btn { right: 20px; bottom: 20px; }
  #ai-chat-widget {
    right: 10px; left: 10px; bottom: 90px; width: auto; max-width: none;
    height: calc(100vh - 120px); max-height: none;
  }
}