/* ============================================
   MATDAV Chatbot Widget Styles
   ============================================ */

/* --- Floating Toggle Button --- */
.chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #266FF2, #09C3FF);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(38, 111, 242, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.chatbot-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(38, 111, 242, 0.55);
}

.chatbot-toggle:active {
  transform: scale(0.96);
}

/* Hide button when chat is open */
.chatbot-toggle.chatbot-hidden {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

/* --- Chat Window --- */
.chatbot-window {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  z-index: 9999;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.chatbot-window.chatbot-open {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* --- Header --- */
.chatbot-header {
  background: linear-gradient(135deg, #1B2E59, #266FF2);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chatbot-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  letter-spacing: 0.2px;
}

.chatbot-header-title i {
  font-size: 20px;
  opacity: 0.9;
}

.chatbot-header-status {
  font-size: 11px;
  opacity: 0.7;
  font-weight: 400;
  margin-top: 2px;
}

.chatbot-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.2s ease;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* --- Messages Area --- */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #FAFBFC;
}

/* Scrollbar styling */
.chatbot-messages::-webkit-scrollbar {
  width: 5px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #CBD2DC;
  border-radius: 10px;
}

/* --- Message Bubbles --- */
.chatbot-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}

.chatbot-msg.bot {
  background: #F0F2F5;
  color: #1B2E59;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chatbot-msg.user {
  background: #266FF2;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* --- Typing Indicator --- */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: #F0F2F5;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  max-width: 70px;
}

.chatbot-typing-dot {
  width: 8px;
  height: 8px;
  background: #A0AAB8;
  border-radius: 50%;
  animation: chatbot-bounce 1.4s infinite ease-in-out;
}

.chatbot-typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.chatbot-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chatbot-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes chatbot-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* --- Input Area --- */
.chatbot-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #E8EBF0;
  background: #fff;
  flex-shrink: 0;
}

.chatbot-input {
  flex: 1;
  border: 1px solid #DDE1E8;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  outline: none;
  transition: border-color 0.2s ease;
  color: #1B2E59;
  background: #FAFBFC;
}

.chatbot-input::placeholder {
  color: #A0AAB8;
}

.chatbot-input:focus {
  border-color: #266FF2;
  background: #fff;
}

.chatbot-send {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #266FF2, #09C3FF);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chatbot-send:hover {
  transform: scale(1.06);
  box-shadow: 0 2px 10px rgba(38, 111, 242, 0.35);
}

.chatbot-send:active {
  transform: scale(0.95);
}

.chatbot-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* --- Character Counter --- */
.chatbot-char-count {
  font-size: 11px;
  color: #A0AAB8;
  text-align: right;
  padding: 0 14px 6px;
  background: #fff;
  flex-shrink: 0;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}

.chatbot-char-count.chatbot-char-warn {
  color: #E74C3C;
}

/* --- Responsive: Mobile --- */
@media (max-width: 575px) {
  .chatbot-window {
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    max-height: 100dvh;
  }

  .chatbot-toggle {
    bottom: 16px;
    right: 16px;
  }
}

/* --- Bot message formatting --- */
.chatbot-msg.bot strong {
  font-weight: 600;
}

.chatbot-msg.bot em {
  font-style: italic;
}

.chatbot-msg.bot br {
  display: block;
  content: '';
  margin-top: 4px;
}

/* --- Booking Button in Chat --- */
.chatbot-booking-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #266FF2, #09C3FF);
  color: #fff !important;
  padding: 10px 20px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  margin-top: 8px;
  margin-bottom: 4px;
  transition: transform 0.25s, box-shadow 0.25s;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.chatbot-booking-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(38, 111, 242, 0.35);
  color: #fff !important;
}
.chatbot-booking-btn i {
  font-size: 14px;
}

/* --- Links in Chat --- */
.chatbot-link {
  color: #266FF2;
  text-decoration: underline;
  word-break: break-all;
}
.chatbot-link:hover {
  color: #09C3FF;
}
