/* ==========================================================================
   DR. AMIT'S HOMOEOPATHIC CLINIC - PROMINENT FLOATING CHATBOT WIDGET
   Architecture & Visual Style Aligned With Classical Homoeopathic Care Desk
   Strictly Zero Em-Dashes and En-Dashes
   ========================================================================== */

:root {
  --clinic-chat-navy: #0B1E36;
  --clinic-chat-navy-dark: #071526;
  --clinic-chat-teal: #0D9488;
  --clinic-chat-teal-hover: #0F766E;
  --clinic-chat-green: #10B981;
  --clinic-chat-whatsapp: #16A34A;
  --clinic-chat-bg: #F8FAFC;
  --clinic-chat-border: #E2E8F0;
  --clinic-chat-text: #0F172A;
  --clinic-chat-muted: #64748B;
  --clinic-chat-shadow: 0 16px 40px rgba(11, 30, 54, 0.28);
}

/* Floating Launcher Container */
.clinic-chat-widget {
  position: fixed !important;
  bottom: 84px !important;
  right: 24px !important;
  z-index: 9999999 !important;
  display: block !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  user-select: none;
}

/* Prominent Floating Pill Launcher Button */
.chat-launcher-btn {
  height: 52px !important;
  padding: 0 20px 0 16px !important;
  border-radius: 30px !important;
  background: linear-gradient(135deg, var(--clinic-chat-navy) 0%, var(--clinic-chat-teal) 100%) !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 10px 30px rgba(11, 30, 54, 0.45), 0 4px 12px rgba(13, 148, 136, 0.25) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  cursor: pointer !important;
  position: relative !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease !important;
  outline: none !important;
  text-decoration: none !important;
}

.chat-launcher-btn:hover {
  transform: translateY(-3px) scale(1.04) !important;
  box-shadow: 0 14px 36px rgba(11, 30, 54, 0.6) !important;
}

.chat-launcher-btn:active {
  transform: scale(0.96) !important;
}

.chat-launcher-icon {
  width: 22px !important;
  height: 22px !important;
  color: #5EEAD4 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0;
}

.chat-launcher-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.chat-launcher-text {
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  white-space: nowrap !important;
  letter-spacing: -0.2px !important;
}

/* Online Pulse Dot */
.chat-pulse-indicator {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  display: flex;
}

.chat-pulse-ping {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--clinic-chat-green);
  opacity: 0.75;
  animation: clinic-chat-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.chat-pulse-dot {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--clinic-chat-green);
  border: 2px solid #ffffff;
}

@keyframes clinic-chat-ping {
  75%, 100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Launcher Tooltip */
.chat-launcher-tooltip {
  position: absolute;
  right: 0;
  bottom: 64px;
  background: var(--clinic-chat-navy-dark);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(11, 30, 54, 0.25);
  border: 1px solid rgba(13, 148, 136, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.chat-launcher-tooltip::after {
  content: "";
  position: absolute;
  bottom: -6px;
  right: 24px;
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: var(--clinic-chat-navy-dark) transparent transparent transparent;
}

.clinic-chat-widget:hover .chat-launcher-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-4px);
}

/* Chat Dialog Panel */
.chat-dialog-panel {
  position: absolute;
  bottom: 64px;
  right: 0;
  width: 385px;
  max-width: calc(100vw - 32px);
  height: min(540px, calc(100vh - 175px));
  max-height: calc(100vh - 175px);
  background: #ffffff;
  border-radius: 18px;
  box-shadow: var(--clinic-chat-shadow);
  border: 1px solid rgba(11, 30, 54, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
  transform-origin: bottom right;
}

.clinic-chat-widget.active .chat-dialog-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.clinic-chat-widget.active .chat-launcher-tooltip {
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Chat Header */
.chat-header {
  background: var(--clinic-chat-navy);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--clinic-chat-teal);
}

.chat-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.chat-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.chat-header-info h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.chat-header-info span {
  font-size: 0.72rem;
  color: #CBD5E1;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.chat-header-info span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--clinic-chat-green);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-header-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.chat-header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Quick Action Top Bar */
.chat-quick-actions {
  background: #F1F5F9;
  padding: 8px 12px;
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--clinic-chat-border);
  overflow-x: auto;
  scrollbar-width: none;
}

.chat-quick-actions::-webkit-scrollbar {
  display: none;
}

.chat-quick-btn {
  background: #ffffff;
  border: 1px solid #CBD5E1;
  color: var(--clinic-chat-navy);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.chat-quick-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.chat-quick-btn:hover {
  background: var(--clinic-chat-teal);
  color: #ffffff !important;
  border-color: var(--clinic-chat-teal);
}

.chat-quick-btn.quick-whatsapp:hover {
  background: var(--clinic-chat-whatsapp);
  border-color: var(--clinic-chat-whatsapp);
}

/* Auto-Sliding Topics Bar */
.chat-topics-marquee {
  background: #EEF2F6;
  border-bottom: 1px solid var(--clinic-chat-border);
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  position: relative;
  z-index: 5;
}

.chat-topics-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--clinic-chat-navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #E2E8F0;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  z-index: 2;
}

.chat-topics-badge svg {
  width: 12px;
  height: 12px;
  fill: var(--clinic-chat-teal);
}

.chat-topics-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 8px, black calc(100% - 8px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 8px, black calc(100% - 8px), transparent);
}

.chat-topics-track {
  display: inline-flex;
  gap: 6px;
  white-space: nowrap;
  animation: clinic-topics-slide 55s linear infinite;
  will-change: transform;
}

.chat-topics-marquee:hover .chat-topics-track,
.chat-topics-track:hover,
.chat-topics-track:active,
.chat-topics-track.is-paused {
  animation-play-state: paused;
}

@keyframes clinic-topics-slide {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.chat-topic-pill {
  background: #ffffff;
  border: 1px solid rgba(13, 148, 136, 0.35);
  color: var(--clinic-chat-navy);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: inline-flex;
  align-items: center;
}

.chat-topic-pill:hover {
  background: var(--clinic-chat-teal);
  color: #ffffff !important;
  border-color: var(--clinic-chat-teal);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(13, 148, 136, 0.3);
}

/* Messages Body */
.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #F8FAFC;
  scroll-behavior: smooth;
  font-size: 0.85rem;
}

.chat-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 88%;
}

.chat-msg-row.user {
  align-self: flex-end;
}

.chat-msg-row.bot {
  align-self: flex-start;
}

.chat-bubble {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.55;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  word-break: break-word;
}

.chat-msg-row.user .chat-bubble {
  background: linear-gradient(135deg, var(--clinic-chat-navy) 0%, var(--clinic-chat-navy-dark) 100%);
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.chat-msg-row.bot .chat-bubble {
  background: #ffffff;
  color: var(--clinic-chat-text);
  border: 1px solid var(--clinic-chat-border);
  border-bottom-left-radius: 2px;
}

.chat-msg-row.bot .chat-bubble strong {
  color: var(--clinic-chat-navy);
}

.chat-chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chat-chip-btn {
  background: #ffffff;
  border: 1px solid var(--clinic-chat-teal);
  color: var(--clinic-chat-teal);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.chat-chip-btn:hover {
  background: var(--clinic-chat-teal);
  color: #ffffff;
}

/* Link Cards inside chat */
.chat-link-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: #166534;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
  transition: background 0.15s ease;
}

.chat-link-card:hover {
  background: #DCFCE7;
  color: #14532D;
}

/* Typing Indicator */
.chat-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 14px;
  border-bottom-left-radius: 2px;
  border: 1px solid var(--clinic-chat-border);
  width: fit-content;
  align-self: flex-start;
}

.chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--clinic-chat-muted);
  animation: clinic-chat-bounce 1.4s infinite ease-in-out both;
}

.chat-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.chat-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes clinic-chat-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Input Footer */
.chat-footer {
  padding: 12px;
  background: #ffffff;
  border-top: 1px solid var(--clinic-chat-border);
}

.chat-input-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input-field {
  flex: 1;
  border: 1px solid #CBD5E1;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.chat-input-field:focus {
  border-color: var(--clinic-chat-teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.chat-send-btn {
  background: var(--clinic-chat-teal);
  color: #ffffff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: var(--clinic-chat-teal-hover);
}

.chat-send-btn svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 575.98px) {
  .clinic-chat-widget {
    bottom: 74px !important;
    right: 16px !important;
  }
  .chat-launcher-btn {
    height: 48px !important;
    padding: 0 16px 0 12px !important;
  }
  .chat-launcher-text {
    font-size: 0.85rem !important;
  }
  .chat-dialog-panel {
    bottom: 58px;
    right: 0;
    width: calc(100vw - 32px);
    height: min(520px, calc(100vh - 155px));
    max-height: calc(100vh - 155px);
  }
}

@media (max-height: 740px) {
  .chat-dialog-panel {
    height: calc(100vh - 175px);
    max-height: calc(100vh - 175px);
  }
  .chat-messages {
    padding: 12px;
    gap: 10px;
  }
}

@media (max-height: 620px) {
  .clinic-chat-widget {
    bottom: 54px !important;
  }
  .chat-dialog-panel {
    bottom: 52px;
    height: calc(100vh - 120px);
    max-height: calc(100vh - 120px);
  }
}
