/* Floating Chatbot Styles */

.chatbot-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99999;
  font-family: 'Inter', 'Poppins', sans-serif;
  box-sizing: border-box;
}

.chatbot-toggle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(106, 17, 203, 0.4),
              0 4px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
  position: relative;
  z-index: 99999;
  filter: drop-shadow(0 0 15px rgba(106, 17, 203, 0.3));
  touch-action: manipulation; /* Enable native touch feedback */
}

/* Touch enhancements for chatbot toggle */
.chatbot-toggle:active {
  transform: scale(0.9);
}

/* Make sure it's big enough on mobile */
@media (max-width: 768px) {
  .chatbot-toggle {
    width: 75px;
    height: 75px;
    font-size: 26px;
  }
  
  .chatbot-toggle:active {
    transform: scale(0.88);
  }
}

.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(106, 17, 203, 0.6),
              0 6px 20px rgba(0, 0, 0, 0.4);
}

.chatbot-toggle i {
  transition: transform 0.3s ease;
  position: relative;
  z-index: 2;
}

.chatbot-toggle:hover i {
  transform: scale(1.1);
}

/* Add a badge indicator for unread messages */
.chatbot-toggle::after {
  content: '';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  background: #ff4081;
  border-radius: 50%;
  border: 2px solid white;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.chatbot-toggle.has-unread::after {
  opacity: 1;
}

/* Chat Window Widget */
.chatbot-widget {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 420px;
  height: 580px;
  background: #0a0a0a;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s ease;
  border: 1px solid #333;
  overflow: hidden;
  max-height: 85vh;
  z-index: 99999;
  font-family: 'Inter', 'Poppins', sans-serif;
}

.chatbot-widget.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.chatbot-header {
  background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
  padding: 20px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #333;
  position: relative;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.chatbot-header h3 {
  color: white;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Panchang-Semibold', 'Poppins', 'Inter', sans-serif;
}

.chatbot-header h3 i {
  color: white;
  font-size: 20px;
  background: rgba(255, 255, 255, 0.2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-header .status-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4caf50;
  margin-right: 8px;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.chatbot-header-buttons {
  display: flex;
  gap: 10px;
}

.chatbot-close, .chatbot-clear {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
}

.chatbot-close:hover, .chatbot-clear:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.chatbot-clear {
  font-size: 15px;
}

.chatbot-clear:hover {
  background: rgba(244, 67, 54, 0.2);
}

.chatbot-close:active, .chatbot-clear:active {
  transform: scale(0.95);
}

/* Messages Container */
.chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: #0a0a0a;
  color: #f8f9fa;
}

/* Message Styling */
.chatbot-message {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.5;
  position: relative;
  animation: fadeIn 0.3s ease;
  word-wrap: break-word;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.chatbot-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: white;
  border-bottom-right-radius: 5px;
}

.chatbot-message.bot {
  align-self: flex-start;
  background: #1a1a1a;
  color: #f8f9fa;
  border: 1px solid #333;
  border-bottom-left-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.chatbot-message.bot::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 12px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid #1a1a1a;
}

.chatbot-message.user::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 12px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid #2575fc;
}

.chatbot-message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 12px;
  color: #adb5bd;
}

.chatbot-message-header .sender {
  font-weight: 600;
  color: #e9ecef;
}

.chatbot-message-header .timestamp {
  margin-left: 10px;
  font-style: italic;
  color: #6c757d;
}

/* Typing Indicator */
.chatbot-typing {
  align-self: flex-start;
  background: #1a1a1a;
  color: #adb5bd;
  border: 1px solid #333;
  border-radius: 18px;
  padding: 12px 16px;
  display: none;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  margin: 5px 0;
}

.chatbot-typing.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.chatbot-typing span {
  width: 8px;
  height: 8px;
  background: #495057;
  border-radius: 50%;
  display: inline-block;
  animation: typing 1.4s infinite ease-in-out;
  animation-fill-mode: both;
}

.chatbot-typing span:nth-child(1) {
  animation-delay: 0s;
}

.chatbot-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.chatbot-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

/* Input Container */
.chatbot-input-container {
  display: flex;
  padding: 15px;
  background: #0a0a0a;
  border-top: 1px solid #333;
  position: relative;
}

.chatbot-input {
  flex: 1;
  padding: 14px 20px;
  border: 1px solid #333;
  border-radius: 30px;
  background: #1a1a1a;
  color: #f8f9fa;
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.chatbot-input:focus {
  border-color: #6a11cb;
  box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.3);
  background: #222;
}

.chatbot-input::placeholder {
  color: #6c757d;
}

.chatbot-send {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  border: none;
  color: white;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  margin-left: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(106, 17, 203, 0.3);
}

.chatbot-send:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 8px -1px rgba(106, 17, 203, 0.4);
}

.chatbot-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.chatbot-send i {
  font-size: 16px;
}

/* Quick Reply Options */
.chatbot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 15px;
  border-top: 1px solid #333;
  background: #0a0a0a;
}

.quick-reply-btn {
  background: #1a1a1a;
  border: 1px solid #333;
  color: #e9ecef;
  padding: 8px 12px;
  border-radius: 18px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex: 0 0 auto;
  font-weight: 500;
}

.quick-reply-btn:hover {
  background: #2a2a2a;
  border-color: #495057;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Welcome Message */
.chatbot-welcome {
  padding: 15px 20px;
  text-align: center;
  color: #adb5bd;
  font-size: 14px;
  border-bottom: 1px solid #333;
  background: #0a0a0a;
  font-weight: 500;
}

/* Scrollbar styling */
.chatbot-messages::-webkit-scrollbar {
  width: 8px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: #f1f3f5;
  border-radius: 4px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #ced4da;
  border-radius: 4px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}

/* Animations */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(106, 17, 203, 0.4);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(106, 17, 203, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(106, 17, 203, 0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-6px);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .chatbot-container {
    bottom: 20px;
    right: 20px;
  }
  
  .chatbot-widget {
    width: 340px;
    height: 450px;
    bottom: 70px;
    right: 0;
  }
  
  .chatbot-message {
    max-width: 85%;
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .chatbot-toggle {
    width: 60px;
    height: 60px;
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .chatbot-container {
    bottom: 15px;
    right: 15px;
  }
  
  .chatbot-widget {
    width: calc(100vw - 30px);
    height: 400px;
    bottom: 70px;
    right: 0;
  }
  
  .chatbot-header {
    padding: 15px 20px;
  }
  
  .chatbot-header h3 {
    font-size: 16px;
  }
  
  .chatbot-messages {
    padding: 15px;
  }
  
  .chatbot-input-container {
    padding: 12px;
  }
  
  .chatbot-quick-replies {
    padding: 12px;
  }
}