/* ============================================================
   KANPUR DENTAL CARE — SmileBot Chatbot UI
   chatbot.css — Glassmorphism floating widget
   ============================================================ */

/* ============================================================
   1. TRIGGER BUTTON (floating)
   ============================================================ */
#chatbot-trigger {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ABFB8, #078F8A);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(10, 191, 184, 0.45),
              0 0 0 0 rgba(10, 191, 184, 0.4);
  z-index: 950;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: chatbot-ring 3s ease-in-out infinite;
}

#chatbot-trigger:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 32px rgba(10, 191, 184, 0.55), 0 0 0 0 rgba(10, 191, 184, 0.4);
}

#chatbot-trigger.open {
  background: linear-gradient(135deg, #078F8A, #056966);
}

/* Bot icon inside trigger */
.chatbot-trigger-icon {
  width: 30px;
  height: 30px;
  transition: transform 0.3s ease;
}
#chatbot-trigger.open .chatbot-trigger-icon {
  transform: rotate(90deg);
}

/* Notification badge */
.chatbot-notif {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FF5B5B;
  border: 2px solid #060B14;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: white;
  font-family: 'Inter', sans-serif;
  animation: ring-pulse 2s ease-out infinite;
}
.chatbot-notif.hidden { display: none; }

@keyframes chatbot-ring {
  0%, 90%, 100% { box-shadow: 0 4px 24px rgba(10, 191, 184, 0.45), 0 0 0 0 rgba(10, 191, 184, 0.4); }
  45%           { box-shadow: 0 4px 24px rgba(10, 191, 184, 0.45), 0 0 0 12px rgba(10, 191, 184, 0); }
}

/* ============================================================
   2. CHATBOT PANEL
   ============================================================ */
#chatbot-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: 375px;
  max-height: 580px;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.60),
    0 0 0 1px rgba(10, 191, 184, 0.20),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  background: rgba(10, 16, 30, 0.88);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  z-index: 949;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#chatbot-panel.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
  animation: chatbot-enter 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ============================================================
   3. CHATBOT HEADER
   ============================================================ */
.chatbot-header {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(10, 191, 184, 0.15), rgba(7, 143, 138, 0.08));
  border-bottom: 1px solid rgba(10, 191, 184, 0.18);
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-shrink: 0;
  position: relative;
}

.chatbot-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ABFB8, #078F8A);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(10, 191, 184, 0.35);
  position: relative;
}

/* Online status indicator */
.chatbot-avatar::after {
  content: '';
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0A101E;
  animation: ring-pulse 2.5s ease-out infinite;
}

.chatbot-info { flex: 1; }

.chatbot-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #EEF6FF;
  line-height: 1.2;
}

.chatbot-status {
  font-size: 0.72rem;
  color: #22c55e;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.chatbot-status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}

.chatbot-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: #8BA4C0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.chatbot-close:hover { background: rgba(239,68,68,0.2); color: #f87171; border-color: rgba(239,68,68,0.3); }

/* ============================================================
   4. CHAT MESSAGES AREA
   ============================================================ */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(10,191,184,0.3); border-radius: 4px; }
.chat-messages::-webkit-scrollbar-thumb:hover { background: rgba(10,191,184,0.5); }

/* ============================================================
   5. MESSAGE BUBBLES
   ============================================================ */
.message {
  display: flex;
  gap: 0.625rem;
  max-width: 88%;
  animation: fadeInUp 0.3s ease both;
}

.message.bot { align-self: flex-start; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ABFB8, #078F8A);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: auto;
}

.msg-bubble {
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 0.875rem;
  line-height: 1.6;
  font-family: 'Inter', sans-serif;
  max-width: 100%;
  word-wrap: break-word;
}

/* Bot bubble */
.message.bot .msg-bubble {
  background: rgba(13, 21, 38, 0.90);
  border: 1px solid rgba(10, 191, 184, 0.15);
  color: #CDD9EA;
  border-radius: 4px 16px 16px 16px;
}

/* User bubble */
.message.user .msg-bubble {
  background: linear-gradient(135deg, rgba(10, 191, 184, 0.22), rgba(7, 143, 138, 0.18));
  border: 1px solid rgba(10, 191, 184, 0.28);
  color: #EEF6FF;
  border-radius: 16px 4px 16px 16px;
}

/* Timestamp */
.msg-time {
  font-size: 0.62rem;
  color: #4A6080;
  margin-top: 0.25rem;
  display: block;
  text-align: right;
}
.message.bot .msg-time { text-align: left; }

/* Link inside bubble */
.msg-bubble a { color: #0ABFB8; text-decoration: underline; }
.msg-bubble strong { color: #EEF6FF; font-weight: 600; }

/* ============================================================
   6. TYPING INDICATOR
   ============================================================ */
.typing-indicator {
  display: flex;
  gap: 0.625rem;
  align-self: flex-start;
  align-items: center;
}

.typing-bubble {
  background: rgba(13, 21, 38, 0.90);
  border: 1px solid rgba(10, 191, 184, 0.15);
  border-radius: 4px 16px 16px 16px;
  padding: 0.875rem 1.125rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0ABFB8;
  animation: typing-dot 1.2s ease-in-out infinite;
  opacity: 0.5;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ============================================================
   7. QUICK REPLY CHIPS
   ============================================================ */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid rgba(10, 191, 184, 0.1);
  background: rgba(6, 11, 20, 0.50);
  flex-shrink: 0;
}

.quick-reply-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4A6080;
  display: block;
  width: 100%;
  margin-bottom: 0.25rem;
}

.qr-chip {
  padding: 0.35rem 0.875rem;
  border-radius: 999px;
  border: 1px solid rgba(10, 191, 184, 0.22);
  background: rgba(10, 191, 184, 0.07);
  color: #8BA4C0;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}

.qr-chip:hover {
  background: rgba(10, 191, 184, 0.18);
  border-color: rgba(10, 191, 184, 0.45);
  color: #0ABFB8;
  transform: translateY(-1px);
}

/* ============================================================
   8. CHAT INPUT ROW
   ============================================================ */
.chat-input-row {
  display: flex;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  border-top: 1px solid rgba(10, 191, 184, 0.12);
  background: rgba(6, 11, 20, 0.60);
  flex-shrink: 0;
  align-items: flex-end;
}

#chatbot-input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: rgba(13, 21, 38, 0.85);
  border: 1px solid rgba(10, 191, 184, 0.18);
  border-radius: 12px;
  color: #EEF6FF;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  resize: none;
  max-height: 100px;
  min-height: 44px;
  transition: all 0.2s ease;
  outline: none;
  line-height: 1.5;
}

#chatbot-input:focus {
  border-color: rgba(10, 191, 184, 0.45);
  box-shadow: 0 0 0 3px rgba(10, 191, 184, 0.08);
  background: rgba(13, 21, 38, 0.95);
}

#chatbot-input::placeholder { color: #4A6080; }

#chatbot-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ABFB8, #078F8A);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(10, 191, 184, 0.35);
}
#chatbot-send:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(10, 191, 184, 0.5); }
#chatbot-send:active { transform: scale(0.96); }

/* ============================================================
   9. WELCOME CARD (first message)
   ============================================================ */
.chatbot-welcome {
  background: linear-gradient(135deg, rgba(10, 191, 184, 0.1), rgba(7, 143, 138, 0.06));
  border: 1px solid rgba(10, 191, 184, 0.18);
  border-radius: 12px;
  padding: 1rem 1.125rem;
  font-size: 0.82rem;
  color: #8BA4C0;
  line-height: 1.65;
}
.chatbot-welcome strong { color: #0ABFB8; display: block; margin-bottom: 0.3rem; font-size: 0.9rem; }

/* ============================================================
   10. RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 480px) {
  #chatbot-panel {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    bottom: 5rem;
    max-height: 72vh;
  }

  #chatbot-trigger {
    right: 1rem;
    bottom: 1rem;
    width: 54px;
    height: 54px;
  }
}
