/* Isolated Floating Chat Widget Styles for property.kyberyon.com */
.hdb-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1a56db 0%, #1e429f 100%);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 12px 20px 12px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(26, 86, 219, 0.45), 0 4px 10px -2px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hdb-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -5px rgba(26, 86, 219, 0.55), 0 6px 12px -2px rgba(0, 0, 0, 0.2);
}

.hdb-chat-launcher-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hdb-chat-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  display: inline-block;
}

.hdb-chat-status-dot.offline {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

.hdb-chat-window {
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 550px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 20px 40px -10px rgba(17, 24, 39, 0.22), 0 8px 16px -4px rgba(17, 24, 39, 0.08);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.hdb-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.hdb-chat-header {
  background: linear-gradient(135deg, #1a56db 0%, #1e3a8a 100%);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hdb-chat-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
}

.hdb-chat-header-sub {
  font-size: 0.75rem;
  color: #dbeafe;
  margin-top: 2px;
}

.hdb-chat-header-sub a {
  color: #ffffff;
  text-decoration: underline;
  font-weight: 500;
}

.hdb-chat-header-sub a:hover {
  color: #bfdbfe;
}

.hdb-chat-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.hdb-chat-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.hdb-chat-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hdb-chat-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.hdb-chat-msg.bot {
  align-self: flex-start;
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.hdb-chat-msg.user {
  align-self: flex-end;
  background: #1a56db;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.hdb-chat-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.hdb-chat-chip {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.hdb-chat-chip:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.hdb-chat-sql-details {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #e5e7eb;
  font-size: 0.74rem;
  color: #6b7280;
}

.hdb-chat-sql-details summary {
  cursor: pointer;
  color: #1a56db;
  font-weight: 600;
  user-select: none;
}

.hdb-chat-sql-code {
  margin-top: 6px;
  padding: 8px;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

.hdb-chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
}

.hdb-chat-typing span {
  width: 6px;
  height: 6px;
  background: #6b7280;
  border-radius: 50%;
  animation: hdbBlink 1.3s infinite both;
}

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

@keyframes hdbBlink {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

.hdb-chat-form {
  padding: 10px 12px;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  align-items: center;
}

.hdb-chat-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.hdb-chat-input:focus {
  border-color: #1a56db;
}

.hdb-chat-send {
  background: #1a56db;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.hdb-chat-send:hover:not(:disabled) {
  background: #1e429f;
}

.hdb-chat-send:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .hdb-chat-window {
    right: 12px;
    left: 12px;
    bottom: 80px;
    width: auto;
    height: 72vh;
  }
  .hdb-chat-launcher {
    right: 16px;
    bottom: 16px;
    padding: 11px 16px;
  }
}
