/* Gondia Police Assistant */
.chatbot-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #03018d, #4338ca);
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(3, 1, 141, 0.45);
  z-index: 500;
  transition: transform 0.2s, box-shadow 0.2s;
}

.chatbot-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 14px 32px rgba(3, 1, 141, 0.5);
}

.chatbot-fab.open {
  background: linear-gradient(135deg, #312e81, #6366f1);
}

.chatbot-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: min(380px, calc(100vw - 2rem));
  height: min(520px, calc(100vh - 7rem));
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  z-index: 501;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.chatbot-panel.hidden { display: none; }

.chatbot-header {
  background: linear-gradient(135deg, #03018d 0%, #312e81 55%, #4338ca 100%);
  color: #fff;
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.chatbot-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.chatbot-header strong {
  font-size: 0.88rem;
  display: block;
  line-height: 1.2;
}

.chatbot-header small {
  opacity: 0.88;
  font-size: 0.66rem;
  display: block;
  margin-top: 2px;
}

.chatbot-header-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.chatbot-icon-btn {
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-icon-btn:hover { background: rgba(255, 255, 255, 0.25); }

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  scroll-behavior: smooth;
}

.chatbot-scope-note {
  flex-shrink: 0;
  padding: 0.4rem 0.85rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1e40af;
  background: #eff6ff;
  border-top: 1px solid #dbeafe;
  border-bottom: 1px solid #dbeafe;
  text-align: center;
}

.chatbot-msg {
  max-width: 90%;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  font-size: 0.8rem;
  line-height: 1.5;
  animation: chatFadeIn 0.25s ease;
}

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

.chatbot-msg.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  color: #0f172a;
}

.chatbot-msg.bot strong {
  color: #03018d;
}

.chatbot-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #03018d, #4338ca);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chatbot-msg a {
  color: #4338ca;
  font-weight: 600;
  text-decoration: underline;
}

.chatbot-msg.user a { color: #c7d2fe; }

.chatbot-msg strong { font-weight: 700; }

.chatbot-msg-time {
  display: block;
  font-size: 0.58rem;
  opacity: 0.55;
  margin-top: 0.3rem;
}

.chatbot-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 0.7rem 0.9rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}

.chatbot-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: chatBounce 1.2s infinite;
}

.chatbot-typing span:nth-child(2) { animation-delay: 0.15s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chatBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.chatbot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.85rem 0.65rem;
  background: #f1f5f9;
  flex-shrink: 0;
}

.chatbot-chip {
  border: 1px solid #c7d2fe;
  background: #fff;
  color: #3730a3;
  font-size: 0.66rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.chatbot-chip:hover {
  background: #eef2ff;
  border-color: #818cf8;
}

.chatbot-input-row {
  display: flex;
  gap: 0.45rem;
  padding: 0.7rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  flex-shrink: 0;
}

.chatbot-input-row input {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 22px;
  padding: 0.55rem 1rem;
  font-family: inherit;
  font-size: 0.82rem;
  background: #f8fafc;
}

.chatbot-input-row input:focus {
  outline: none;
  border-color: #6366f1;
  background: #fff;
}

.chatbot-input-row button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #03018d, #4338ca);
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.chatbot-input-row button:hover { transform: scale(1.05); }
.chatbot-input-row button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

@media (max-width: 480px) {
  .chatbot-panel {
    right: 1rem;
    bottom: 5rem;
    width: calc(100vw - 2rem);
    height: min(480px, calc(100vh - 6.5rem));
  }
  .chatbot-fab { right: 1rem; bottom: 1.25rem; }
}
