/* =========================================================================
   PREMIUM AI CHATBOT WIDGET STYLES
   ========================================================================= */

/* Chatbot Floating Toggle Button */
#chatbotToggleBtn {
  position: fixed;
  bottom: 88px; /* Sits above the Back to Top button */
  right: 24px;
  z-index: 45;
  display: flex;
  height: 56px;
  width: 56px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #359BD3 0%, #257fae 100%);
  color: #ffffff;
  box-shadow: 0 8px 30px rgba(53, 155, 211, 0.35);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

[dir="rtl"] #chatbotToggleBtn {
  right: auto;
  left: 24px;
}

#chatbotToggleBtn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 35px rgba(53, 155, 211, 0.55);
}

/* Chatbot Status Badge (Online Green Dot) */
.chatbot-status-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  height: 12px;
  width: 12px;
  border-radius: 50%;
  background-color: #8CC63F; /* Cyber Green */
  border: 2px solid #ffffff;
  box-shadow: 0 0 8px rgba(140, 198, 63, 0.8);
}
.dark .chatbot-status-dot {
  border-color: #050B18;
}

/* Chat Window Container */
#chatbotWindow {
  position: fixed;
  bottom: 160px;
  right: 24px;
  z-index: 50;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 550px;
  max-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  border-radius: 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  transition: all 400ms cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
}

[dir="rtl"] #chatbotWindow {
  right: auto;
  left: 24px;
}

#chatbotWindow.is-active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.dark #chatbotWindow {
  background: rgba(5, 11, 24, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

/* Chat Header */
.chatbot-header {
  padding: 1rem 1.15rem;
  background: linear-gradient(135deg, rgba(53, 155, 211, 0.12) 0%, rgba(140, 198, 63, 0.06) 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dark .chatbot-header {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* Chat Title Area */
.chatbot-title-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.chatbot-avatar {
  height: 40px;
  width: 40px;
  border-radius: 0.75rem;
  background-color: #359BD3;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.chatbot-info h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}
.dark .chatbot-info h4 {
  color: #ffffff;
}
.chatbot-info p {
  font-size: 0.72rem;
  color: #8CC63F; /* Cyber Green */
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Chat Body (Messages) */
.chatbot-body {
  flex: 1;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scrollbar-width: thin;
}
.chatbot-body::-webkit-scrollbar {
  width: 5px;
}
.chatbot-body::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.3);
  border-radius: 9999px;
}

/* Chat Bubbles */
.chatbot-message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: message-reveal 350ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes message-reveal {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.chatbot-message.bot {
  align-self: flex-start;
}
.chatbot-message.user {
  align-self: flex-end;
}

.chatbot-bubble {
  padding: 0.72rem 0.9rem;
  font-size: 0.8rem;
  line-height: 1.5;
  border-radius: 1.15rem;
}

.chatbot-message.bot .chatbot-bubble {
  background-color: #eef6fb;
  color: #1e293b;
  border-bottom-left-radius: 0.25rem;
}
.dark .chatbot-message.bot .chatbot-bubble {
  background-color: rgba(30, 41, 59, 0.6);
  color: #e2e8f0;
}

.chatbot-message.user .chatbot-bubble {
  background-color: #359BD3;
  color: #ffffff;
  border-bottom-right-radius: 0.25rem;
}

.chatbot-message .chat-time {
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 0.25rem;
  align-self: flex-end;
}
.chatbot-message.bot .chat-time {
  align-self: flex-start;
}

/* Quick Replies Area */
.chatbot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.quick-reply-btn {
  background-color: #ffffff;
  border: 1px solid rgba(53, 155, 211, 0.3);
  color: #359BD3;
  padding: 0.52rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 0.8rem;
  cursor: pointer;
  transition: all 250ms ease;
  text-align: start;
}
.dark .quick-reply-btn {
  background-color: rgba(15, 23, 42, 0.5);
  border-color: rgba(53, 155, 211, 0.25);
  color: #5cb2df;
}

.quick-reply-btn:hover {
  background-color: #359BD3;
  border-color: #359BD3;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.5rem 1rem;
  background-color: #f1f5f9;
  border-radius: 1rem;
  width: fit-content;
}
.dark .typing-indicator {
  background-color: rgba(30, 41, 59, 0.6);
}
.typing-indicator span {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background-color: #94a3b8;
  animation: typing-dot 1.4s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dot {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Chat Footer (Input Form) */
.chatbot-footer {
  padding: 0.9rem 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  background-color: rgba(255, 255, 255, 0.4);
}
.dark .chatbot-footer {
  border-top-color: rgba(255, 255, 255, 0.06);
  background-color: rgba(5, 11, 24, 0.4);
}

.chatbot-input-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background-color: #ffffff;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
}
.dark .chatbot-input-container {
  background-color: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

#chatbotInput {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.8rem;
  padding: 0.5rem;
  color: #0f172a;
}
.dark #chatbotInput {
  color: #ffffff;
}

#chatbotSendBtn {
  height: 36px;
  width: 36px;
  border-radius: 0.75rem;
  background-color: #359BD3;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background-color 200ms ease;
}
#chatbotSendBtn:hover {
  background-color: #2b82b3;
}

/* =========================================================================
   MOBILE QUICK CONNECT DOCK & SIDE SHEET STYLES
   ========================================================================= */

#mobileQuickDockTrigger {
  position: fixed;
  bottom: 120px;
  left: 0;
  z-index: 45;
  display: flex;
  height: 48px;
  width: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 0 12px 12px 0;
  background: linear-gradient(135deg, #359BD3 0%, #2b82b3 100%);
  color: #ffffff;
  box-shadow: 2px 4px 15px rgba(53, 155, 211, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: none;
  cursor: pointer;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

#mobileQuickDockTrigger:hover {
  width: 48px;
  box-shadow: 3px 5px 20px rgba(53, 155, 211, 0.5);
}

#mobileQuickDockOverlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(5, 11, 24, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
  display: none;
}

#mobileQuickDockOverlay.is-active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

#mobileQuickDockSheet {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 280px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 10px 0 40px rgba(15, 23, 42, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

.dark #mobileQuickDockSheet {
  background: rgba(5, 11, 24, 0.9);
  border-right-color: rgba(255, 255, 255, 0.08);
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.3);
}

#mobileQuickDockSheet.is-open {
  transform: translateX(0);
}

/* Quick Dock Content Styles */
.quick-dock-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dark .quick-dock-header {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.quick-dock-title-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
}
.dark .quick-dock-title-container {
  color: #ffffff;
}

#mobileQuickDockClose {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  transition: color 200ms ease;
}
#mobileQuickDockClose:hover {
  color: #64748b;
}
.dark #mobileQuickDockClose:hover {
  color: #ffffff;
}

.quick-dock-body {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
}

.quick-dock-desc {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #64748b;
  margin: 0 0 0.5rem 0;
}
.dark .quick-dock-desc {
  color: #94a3b8;
}

.quick-dock-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  color: #ffffff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.quick-dock-btn:active {
  transform: scale(0.97);
}

.quick-dock-btn.whatsapp {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.2);
}
.quick-dock-btn.whatsapp:hover {
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.35);
}

.quick-dock-btn.chatbot {
  background: linear-gradient(135deg, #359BD3 0%, #2b82b3 100%);
  box-shadow: 0 6px 20px rgba(53, 155, 211, 0.2);
}
.quick-dock-btn.chatbot:hover {
  box-shadow: 0 8px 25px rgba(53, 155, 211, 0.35);
}

.quick-dock-btn-content {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-align: start;
}

.quick-dock-btn-icon {
  font-size: 1.5rem;
}

.quick-dock-btn-text-container {
  display: flex;
  flex-direction: column;
}

.quick-dock-btn-title {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
}

.quick-dock-btn-subtitle {
  font-size: 0.68rem;
  opacity: 0.85;
  margin-top: 0.15rem;
}

.quick-dock-btn-arrow {
  font-size: 0.75rem;
  opacity: 0.7;
  transition: transform 200ms ease;
}
.quick-dock-btn:hover .quick-dock-btn-arrow {
  transform: translateX(3px);
}
[dir="rtl"] .quick-dock-btn:hover .quick-dock-btn-arrow {
  transform: translateX(-3px);
}

.quick-dock-footer {
  padding: 1.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dark .quick-dock-footer {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.quick-dock-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.quick-dock-status-dot {
  height: 8px;
  width: 8px;
  border-radius: 50%;
  background-color: #8CC63F;
  box-shadow: 0 0 6px rgba(140, 198, 63, 0.8);
  animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.quick-dock-status-text {
  font-size: 0.7rem;
  font-weight: 500;
  color: #64748b;
}
.dark .quick-dock-status-text {
  color: #94a3b8;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  #chatbotToggleBtn {
    display: none !important;
  }
  
  #whatsappFloatingBtn {
    display: none !important;
  }

  #chatbotWindow {
    bottom: 24px !important;
    max-height: calc(100vh - 48px) !important;
  }

  [dir="rtl"] #chatbotWindow {
    left: 24px !important;
    right: auto !important;
  }
  
  #mobileQuickDockTrigger {
    display: flex !important;
  }
}

@media (min-width: 769px) {
  #mobileQuickDockTrigger {
    display: none !important;
  }
  #mobileQuickDockOverlay {
    display: none !important;
  }
  #mobileQuickDockSheet {
    display: none !important;
  }
}

