/* Aadhavan AI Chatbot Styles */
:root {
  --chat-primary: #0084ff;
  --chat-bg: rgba(15, 23, 42, 0.95);
  --chat-text: #f8fafc;
  --chat-bot-bubble: #1e293b;
  --chat-user-bubble: #0084ff;
  --chat-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

.chatbot-wrapper {
  position: fixed;
  bottom: 110px; /* Moved up to avoid overlap with WhatsApp FAB */
  right: 30px;
  z-index: 9999;
  font-family: "Inter", sans-serif;
}

.chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0084ff, #00c6ff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--chat-shadow);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: none;
  color: white;
  font-size: 24px;
}

.chatbot-toggle:hover {
  transform: scale(1.1) rotate(5deg);
}

.chatbot-toggle.active {
  transform: scale(0.9) rotate(-90deg);
}

.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 550px;
  background: var(--chat-bg);
  border-radius: 20px;
  box-shadow: var(--chat-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.9);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.chat-window.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

.chat-header {
  background: linear-gradient(135deg, #0084ff, #00c6ff);
  padding: 20px;
  color: white;
  display: flex;
  align-items: center;
  gap: 15px;
}

.bot-avatar {
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  position: relative;
}

.online-indicator {
  width: 12px;
  height: 12px;
  background: #22c55e;
  border: 2px solid white;
  border-radius: 50%;
  position: absolute;
  bottom: 0;
  right: 0;
}

.bot-info-flex {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-info h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.bot-info p {
  margin: 0;
  font-size: 11px;
  opacity: 0.85;
  font-weight: 400;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(45deg);
}

.lang-selector-nav {
  margin-left: auto;
  position: relative;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  width: 120px;
  display: none;
  flex-direction: column;
  z-index: 100;
  margin-top: 5px;
  box-shadow: 0 10px 15px rgba(0,0,0,0.5);
}

.lang-selector-nav:hover .lang-dropdown {
  display: flex;
}

.lang-option {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lang-option:last-child {
  border-bottom: none;
}

.lang-option:hover {
  background: var(--chat-primary);
  color: white;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.bot-message {
  background: var(--chat-bot-bubble);
  color: var(--chat-text);
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.bot-link {
  color: #00c6ff;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed #00c6ff;
  transition: all 0.2s;
}

.bot-link:hover {
  color: #fff;
  border-bottom-style: solid;
}

.user-message {
  background: linear-gradient(135deg, #0084ff, #00c6ff);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 15px rgba(0, 132, 255, 0.2);
}

.chat-input-area {
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  padding: 10px 15px 10px 20px;
  color: white;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

.mic-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 18px;
  padding: 0 5px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mic-btn:hover {
  color: #00c6ff;
}

.mic-btn.listening {
  color: #ef4444;
  animation: mic-pulse 1.5s infinite;
}

@keyframes mic-pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.chat-input:focus {
  border-color: var(--chat-primary);
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--chat-primary);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.send-btn:hover {
  transform: scale(1.1);
}

/* Typing Indicator */
.typing {
  display: flex;
  gap: 4px;
  padding: 10px;
}

.dot {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typing 1s infinite alternate;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}
.dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  from {
    opacity: 0.3;
    transform: translateY(0);
  }
  to {
    opacity: 1;
    transform: translateY(-4px);
  }
}

/* Suggested Chips */
.suggested-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  background: var(--chat-primary);
  color: white;
  border-color: var(--chat-primary);
}

/* Responsive */
@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 40px);
    height: 70vh;
    right: -10px;
    bottom: 90px;
  }
}
