/* Chatbot UI Styles */
:root {
  --chat-primary: #4f46e5;
  --chat-bg: #ffffff;
  --chat-header: #3730a3;
  --chat-text: #1e293b;
}

#chatbot-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999999;
  font-family: 'Inter', sans-serif;
}

.chat-toggle-btn {
  background: linear-gradient(135deg, var(--chat-primary), #ec4899);
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-toggle-btn:hover {
  transform: scale(1.1);
}

.chat-toggle-btn svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.chat-window {
  display: none; /* Hidden by default */
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 500px;
  background: var(--chat-bg);
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.05);
  animation: chatSlideUp 0.3s ease-out;
}

@keyframes chatSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-window.open {
  display: flex;
}

.chat-header {
  background: var(--chat-header);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header .title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header .title span {
  display: block;
  width: 10px;
  height: 10px;
  background: #22c55e; /* Online dot */
  border-radius: 50%;
}

.close-chat {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #f8fafc;
}

.message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.message.bot {
  align-self: flex-start;
  background: white;
  color: var(--chat-text);
  border: 1px solid rgba(0,0,0,0.05);
  border-bottom-left-radius: 2px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.message.user {
  align-self: flex-end;
  background: var(--chat-primary);
  color: white;
  border-bottom-right-radius: 2px;
  box-shadow: 0 2px 5px rgba(79, 70, 229, 0.2);
}

.chat-input-area {
  padding: 15px;
  background: white;
  border-top: 1px solid rgba(0,0,0,0.05);
  display: flex;
  gap: 10px;
}

.chat-input-area input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  outline: none;
  font-size: 0.9rem;
  transition: border-color 0.3s;
}

.chat-input-area input:focus {
  border-color: var(--chat-primary);
}

.chat-input-area button {
  background: var(--chat-primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background 0.3s;
}

.chat-input-area button:hover {
  background: var(--chat-header);
}

.chat-input-area button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.typing-indicator {
  display: none;
  padding: 10px 14px;
  background: white;
  border-radius: 12px;
  border-bottom-left-radius: 2px;
  align-self: flex-start;
  gap: 4px;
  border: 1px solid rgba(0,0,0,0.05);
}

.typing-indicator.active {
  display: flex;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #cbd5e1;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 40px);
    right: -10px;
  }
}
