/* === TrueKnack Interactive Chatbot Styles === */

:root {
  --chat-primary: #27336A;
  --chat-secondary: #9B2A27;
  --chat-accent: #D44A47;
  --chat-bg: #FFFFFF;
  --chat-bubble-user: #27336A;
  --chat-bubble-bot: #F0F2F6;
  --chat-shadow: 0 10px 30px rgba(39, 51, 106, 0.15);
  --chat-border: #E2E6EF;
}

/* Chat Launcher Button */
.chatbot-launcher {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-secondary) 100%);
  color: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(155, 26, 30, 0.3);
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-launcher:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 20px rgba(155, 26, 30, 0.5);
}

.chatbot-launcher i {
  transition: transform 0.3s ease;
}

.chatbot-launcher.active i {
  transform: rotate(90deg);
}

/* Notification Badge on Launcher */
.chatbot-launcher::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background-color: var(--chat-accent);
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  animation: pulseBadge 2s infinite;
}

.chatbot-launcher.active::after {
  display: none;
}

@keyframes pulseBadge {
  0% { transform: scale(0.9); opacity: 0.9; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.9; }
}

/* Chat Window Container */
.chatbot-window {
  position: fixed;
  bottom: 105px;
  right: 30px;
  width: 380px;
  height: 550px;
  background-color: var(--chat-bg);
  border-radius: 16px;
  box-shadow: var(--chat-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  border: 1px solid var(--chat-border);
  transform: translateY(30px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

.chatbot-window.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Chat Header */
.chatbot-header {
  background: linear-gradient(135deg, var(--chat-primary) 0%, #2A3C6F 100%);
  color: #FFFFFF;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.chatbot-header::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--chat-secondary) 0%, var(--chat-accent) 100%);
}

.chatbot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #FFFFFF;
  color: var(--chat-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.chatbot-header-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 2px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.chatbot-header-info span {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 4px;
}

.chatbot-header-info span::before {
  content: '';
  width: 6px;
  height: 6px;
  background-color: #25D366;
  border-radius: 50%;
}

.chatbot-close {
  margin-left: auto;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.chatbot-close:hover {
  opacity: 1;
}

/* Chat Body / Messages Area */
.chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background-color: #F8F9FD;
}

/* Scrollbar styles for messages */
.chatbot-messages::-webkit-scrollbar {
  width: 5px;
}
.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}
.chatbot-messages::-webkit-scrollbar-thumb {
  background: #D1D6E2;
  border-radius: 10px;
}

/* Individual Message Styles */
.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: slideInMsg 0.3s ease forwards;
}

@keyframes slideInMsg {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-msg.bot {
  align-self: flex-start;
}

.chat-msg.user {
  align-self: flex-end;
}

.chat-msg-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  font-family: 'Inter', sans-serif;
}

.chat-msg.bot .chat-msg-bubble {
  background-color: #FFFFFF;
  color: var(--chat-primary);
  border: 1px solid var(--chat-border);
  border-top-left-radius: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.chat-msg.user .chat-msg-bubble {
  background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-light, #2A3C6F) 100%);
  color: #FFFFFF;
  border-top-right-radius: 2px;
  box-shadow: 0 4px 10px rgba(31, 46, 85, 0.1);
}

.chat-msg-time {
  font-size: 0.7rem;
  color: #8C95A6;
  margin-top: 4px;
  align-self: flex-start;
}

.chat-msg.user .chat-msg-time {
  align-self: flex-end;
}

/* Quick Replies / Choice Chips */
.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  animation: slideInMsg 0.3s ease forwards;
}

.quick-reply-chip {
  background-color: #FFFFFF;
  border: 1px solid var(--chat-primary);
  color: var(--chat-primary);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.quick-reply-chip:hover {
  background-color: var(--chat-primary);
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* Chat Input Bar */
.chatbot-input-area {
  padding: 14px 16px;
  border-top: 1px solid var(--chat-border);
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #FFFFFF;
}

.chatbot-input-area input {
  flex: 1;
  border: 1px solid #E2E6EF;
  padding: 10px 16px;
  border-radius: 24px;
  font-size: 0.88rem;
  outline: none;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s ease;
}

.chatbot-input-area input:focus {
  border-color: var(--chat-primary);
}

.chatbot-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--chat-primary);
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chatbot-send-btn:hover {
  background-color: var(--chat-secondary);
  transform: scale(1.05);
}

/* Typing Indicator Animation */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 6px 12px;
  align-items: center;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: #8C95A6;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .chatbot-window {
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
  }
  .chatbot-launcher {
    bottom: 15px;
    right: 15px;
  }
}
