/* ==========================================================================
   DR. SURESH HOMOEOPATHIC CLINIC - PROMINENT FLOATING CHATBOT WIDGET
   ========================================================================== */

:root {
  --clinic-chat-green: #198754;
  --clinic-chat-green-hover: #146c43;
  --clinic-chat-navy: #0a2540;
  --clinic-chat-navy-dark: #07192c;
  --clinic-chat-bg: #f8f9fa;
  --clinic-chat-border: #e9ecef;
  --clinic-chat-text: #212529;
  --clinic-chat-muted: #6c757d;
  --clinic-chat-accent-teal: #0d9488;
  --clinic-chat-shadow: 0 12px 36px rgba(10, 37, 64, 0.25);
}

/* Hide legacy floating call & whatsapp dock buttons */
.floating-action-btn.btn-call,
.floating-action-btn.btn-whatsapp {
  display: none !important;
}



/* Floating Launcher Container */
.clinic-chat-widget {
  position: fixed !important;
  bottom: 24px !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, #198754 0%, #0a2540 100%) !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 10px 30px rgba(25, 135, 84, 0.5), 0 4px 12px rgba(0, 0, 0, 0.15) !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(25, 135, 84, 0.65) !important;
}

.chat-launcher-btn:active {
  transform: scale(0.96) !important;
}

.chat-launcher-icon {
  font-size: 1.35rem !important;
  color: #20c997 !important;
  line-height: 1 !important;
}

.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: #20c997;
  opacity: 0.75;
  animation: 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: #20c997;
  border: 2px solid #ffffff;
}

@keyframes 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);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  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) 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: 68px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 110px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: var(--clinic-chat-shadow);
  border: 1px solid rgba(10, 37, 64, 0.12);
  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-green);
}

.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);
}

.chat-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.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: #a0aec0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-header-info span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #20c997;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-header-btn {
  background: rgba(255, 255, 255, 0.1);
  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;
}

.chat-quick-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--clinic-chat-navy);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.chat-quick-btn:hover {
  background: var(--clinic-chat-green);
  color: #ffffff;
  border-color: var(--clinic-chat-green);
}

/* Messages Body */
.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8fafc;
  scroll-behavior: smooth;
}

.chat-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 86%;
}

.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.5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  word-break: break-word;
}

.chat-msg-row.user .chat-bubble {
  background: var(--clinic-chat-green);
  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-green);
  color: var(--clinic-chat-green);
  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-green);
  color: #ffffff;
}

/* Link Cards inside chat */
.chat-link-card {
  display: block;
  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;
}

/* 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: 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 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-green);
}

.chat-send-btn {
  background: var(--clinic-chat-green);
  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;
}

.chat-send-btn:hover {
  background: var(--clinic-chat-green-hover);
}

@media (max-width: 480px) {
  .clinic-chat-widget {
    bottom: 16px !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: 64px;
    right: 0;
    width: calc(100vw - 32px);
    height: 520px;
  }
}

/* Position Scroll-to-Top Button at bottom (24px) */
.floating-actions-dock {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 99999 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

/* Position Floating Chatbot Widget directly ABOVE Scroll-to-Top button (84px) */
.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;
}

@media (max-width: 480px) {
  .floating-actions-dock {
    bottom: 16px !important;
    right: 16px !important;
  }
  .clinic-chat-widget {
    bottom: 74px !important;
    right: 16px !important;
  }
}


/* Auto-Sliding High-Yield Clinical Topics Ticker */
.chat-high-yield-bar {
  background: linear-gradient(90deg, #0a2540 0%, #0d9488 100%);
  padding: 6px 0;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
}

.chat-high-yield-badge {
  background: #198754;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: 10px;
  margin-right: 6px;
  white-space: nowrap;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.chat-high-yield-track {
  display: flex;
  gap: 8px;
  animation: chat-ticker-slide 22s linear infinite;
  white-space: nowrap;
  will-change: transform;
}

.chat-high-yield-track:hover {
  animation-play-state: paused;
}

.chat-high-yield-chip {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chat-high-yield-chip:hover {
  background: #ffffff;
  color: #0a2540;
  border-color: #ffffff;
  transform: scale(1.04);
}

@keyframes chat-ticker-slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}


/* Hide Launcher Pill button when Chatbot Modal is Active/Open */
.clinic-chat-widget.active .chat-launcher-btn {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: scale(0.8) translateY(10px) !important;
}

.clinic-chat-widget.active .chat-dialog-panel {
  bottom: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
}

/* Refined Auto-Sliding Clinical Topics Ticker */
.chat-high-yield-bar {
  background: #0f172a !important;
  padding: 8px 0 !important;
  overflow: hidden !important;
  position: relative !important;
  border-bottom: 1px solid #1e293b !important;
  display: flex !important;
  align-items: center !important;
}

.chat-high-yield-chip {
  background: rgba(13, 148, 136, 0.2) !important;
  border: 1px solid #0d9488 !important;
  color: #20c997 !important;
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  padding: 4px 12px !important;
  border-radius: 14px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
}

.chat-high-yield-chip:hover {
  background: #0d9488 !important;
  color: #ffffff !important;
  transform: scale(1.04) !important;
}
