/* ===== AI CHAT WIDGET (Kalika theme) ===== */
#chat-panel {
  position: fixed;
  width: 320px;
  max-width: 90vw;
  height: 420px;
  max-height: 70vh;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: inherit;
}

#chat-panel.open {
  display: flex;
}

#chat-header {
  background: var(--accent2, #1e5aa8);
  color: #fff;
  padding: 12px 14px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent;
}

.chat-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--accent2, #1e5aa8);
  color: #fff;
}

.chat-msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.55);
  color: #1a1a1a;
  backdrop-filter: blur(4px);
}

#chat-input-row {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

#chat-input {
  flex: 1;
  border: none;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  background: transparent;
  color: #1a1a1a;
}

#chat-send {
  border: none;
  background: var(--accent2, #1e5aa8);
  color: #fff;
  padding: 0 16px;
  cursor: pointer;
  font-size: 14px;
}

#chat-send:disabled {
  opacity: 0.6;
  cursor: default;
}

.chat-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px !important;
}

.chat-typing .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #666;
  opacity: 0.4;
  animation: chat-typing-bounce 1.2s infinite ease-in-out;
}

.chat-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes chat-typing-bounce {
  0%, 60%, 100% { opacity: 0.4; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
