/* css/chatbot.css */
.chatbot-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.chatbot-toggle:hover {
  transform: scale(1.05);
}

.chatbot-toggle.hidden {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

.chatbot-window {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 350px;
  height: 500px;
  background-color: var(--bg-primary);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  opacity: 0;
  pointer-events: none;
  transform-origin: bottom right;
  transform: scale(0.1) translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-window.active {
  opacity: 1;
  pointer-events: all;
  transform: scale(1) translateY(0);
}

.chatbot-header {
  background-color: var(--primary);
  color: white;
  padding: 16px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: var(--bg-soft);
}

.chat-message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.chat-message.bot {
  background-color: var(--bg-primary);
  color: var(--text-body);
  align-self: flex-start;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-message.user {
  background-color: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-message.loading {
  font-style: italic;
  color: #888;
}

.chatbot-input-container {
  padding: 12px;
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.chatbot-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  background-color: var(--bg-soft);
  color: var(--text-heading);
}

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

.chatbot-send {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-btn);
  padding: 0 16px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-send:hover {
  background-color: #b3382c;
}

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

/* Typing Dots Animation */
.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 20px;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--text-body);
  border-radius: 50%;
  animation: typing 1.4s infinite both;
}
.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

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

/* Record Modal Styles */
.chatbot-record-modal {
  position: absolute;
  top: 55px; /* Below header */
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.chatbot-record-modal.open {
  transform: translateY(0);
}

.chatbot-record-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 12px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.chatbot-record-card h4 {
  color: var(--primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.chatbot-record-card p {
  margin-bottom: 6px;
  line-height: 1.5;
}
.chatbot-record-card strong {
  color: var(--text-heading);
}
