/* AI Chatbot Widget Styles */

/* Base font sizes for responsive scaling */

html {
  font-size: 16px; /* Desktop default */
}

/* Tablet devices */

@media (max-width: 1024px) and (min-width: 481px) {
  html {
    font-size: 14px;
  }
}

/* Mobile devices */

@media (max-width: 480px) {
  html {
    font-size: 12px;
  }
}

.ai-chatbot-widget {
  position: fixed;

  bottom: 1.25rem;

  right: 1.25rem;

  z-index: 999999;

  font-family: "Poppins", sans-serif !important;
}

/* Toggle Button */

.ai-chatbot-toggle {
  width: 3.75rem;

  height: 3.75rem;

  border-radius: 50%;

  background-color: #ffffff;

  border: none;

  cursor: pointer;

  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 0.2rem;

  transition: all 0.3s ease;

  position: relative;

  overflow: hidden;
}

.ai-chatbot-toggle:hover {
  transform: scale(1.1);

  box-shadow: 0 0.375rem 1rem rgba(61, 128, 76, 0.3);

  border: 0.125rem solid #e6cc2c;
}

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

.ai-chatbot-toggle img {
  width: 100%;

  height: 100%;

  object-fit: contain;

  border-radius: 50%;
}

/* Popup Container */

.ai-chatbot-popup {
  position: fixed;

  bottom: 5.625rem;

  right: 1.25rem;

  width: 23.75rem;

  max-width: calc(100vw - 2.5rem);

  height: 37.5rem;

  max-height: calc(100vh - 7.5rem);

  background: #ffffff;

  border-radius: 0.75rem;

  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);

  display: flex;

  flex-direction: column;

  overflow: hidden;

  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;

    transform: translateY(1.25rem);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

/* Header */

.ai-chatbot-header-content h3 {
  color: white !important;

  font-size: 1.5rem !important;
}

input#ai-chatbot-input {
  border: solid 0.0625rem #808285;
  border-radius: 5px;
}

.ai-chatbot-header {
  background: #3d804c;

  color: #ffffff;

  padding: 1rem 1.25rem;

  display: flex;

  justify-content: space-between;

  align-items: center;

  flex-shrink: 0;
}

.ai-chatbot-header-content {
  display: flex;

  align-items: center;

  gap: 0.75rem;
}

.ai-chatbot-header-icon {
  width: 2rem;

  height: 2rem;

  border-radius: 50%;

  background: #ffffff;

  padding: 0.25rem;

  object-fit: contain;
}

.ai-chatbot-header h3 {
  margin: 0;

  font-size: 1.125rem;

  font-weight: 600;
}

.ai-chatbot-close {
  background: transparent;

  border: none;

  color: #ffffff;

  font-size: 1.75rem;

  line-height: 1;

  cursor: pointer;

  width: 2rem;

  height: 2rem;

  display: flex;

  align-items: center;

  justify-content: center;

  border-radius: 50%;

  transition: background-color 0.2s ease;

  padding: 0;
}

.ai-chatbot-close:hover {
  background-color: rgba(230, 204, 44, 0.3);
}

/* Messages Area */

.ai-chatbot-messages {
  flex: 1;

  overflow-y: auto;

  padding: 1.25rem;

  display: flex;

  flex-direction: column;

  gap: 0.75rem;

  background: #f8f9fa;
}

.ai-chatbot-messages::-webkit-scrollbar {
  width: 0.375rem;
}

.ai-chatbot-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.ai-chatbot-messages::-webkit-scrollbar-thumb {
  background: #888;

  border-radius: 0.1875rem;
}

.ai-chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Message Bubbles */

.ai-chatbot-message {
  max-width: 80%;

  padding: 0.75rem 1rem;

  border-radius: 1.125rem;

  word-wrap: break-word;

  line-height: 1.4;

  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;

    transform: translateY(0.625rem);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

.ai-chatbot-message.user {
  align-self: flex-end;

  background: #3d804c;

  color: #ffffff;

  border-bottom-right-radius: 0.25rem;
}

.ai-chatbot-message.bot {
  align-self: flex-start;

  background: #ffffff;

  color: #333333;

  border-bottom-left-radius: 0.25rem;

  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
}

/* Typing Indicator */

.ai-chatbot-typing {
  padding: 0 1.25rem 0.625rem;

  background: #f8f9fa;
}

.ai-chatbot-typing-indicator {
  display: flex;

  gap: 0.25rem;

  align-items: center;

  padding: 0.75rem 1rem;

  background: #ffffff;

  border-radius: 1.125rem;

  width: fit-content;

  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
}

.ai-chatbot-typing-indicator span {
  width: 0.5rem;

  height: 0.5rem;

  border-radius: 50%;

  background: #3d804c;

  animation: typing 1.4s infinite ease-in-out;
}

.ai-chatbot-typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.ai-chatbot-typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0.8);

    opacity: 0.5;
  }

  40% {
    transform: scale(1);

    opacity: 1;
  }
}

/* Input Container */

.ai-chatbot-input-container {
  display: flex;

  gap: 0.5rem;

  padding: 1rem 1.25rem;

  background: #ffffff;

  border-top: 0.0625rem solid #e9ecef;

  flex-shrink: 0;
}

.ai-chatbot-input {
  flex: 1;

  padding: 0.75rem 1rem;

  border: 0.125rem solid #e9ecef;

  border-radius: 1.5rem;

  font-size: 0.875rem;

  outline: none;

  transition: border-color 0.2s ease;
}

.ai-chatbot-input:focus {
  border-color: #3d804c;
}

.ai-chatbot-send {
  width: 2.75rem;

  height: 2.75rem;

  border-radius: 50%;

  background: #3d804c;

  border: none;

  color: #ffffff;

  cursor: pointer;

  display: flex;

  align-items: center;

  justify-content: center;

  transition:
    transform 0.2s ease,
    background-color 0.2s ease;

  flex-shrink: 0;

  padding: 0;
}

.ai-chatbot-send:hover {
  transform: scale(1.05);

  background: #e6cc2c;

  color: #3d804c;
}

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

.ai-chatbot-send:disabled {
  opacity: 0.6;

  cursor: not-allowed;

  transform: none;
}

/* Mobile Responsive */

@media (max-width: 480px) {
  .ai-chatbot-widget {
    bottom: 1.25rem;

    right: 1.25rem;
  }

  .ai-chatbot-popup {
    bottom: 6.666rem;

    right: 1.25rem;

    left: 1.25rem;

    width: auto;

    height: calc(100vh - 9.166rem);

    max-height: calc(100vh - 9.166rem);
  }

  .ai-chatbot-toggle {
    width: 4.666rem;

    height: 4.666rem;
  }

  .ai-chatbot-message {
    max-width: 85%;
  }
}

/* Welcome Message */

.ai-chatbot-welcome {
  text-align: center;

  color: #666;

  padding: 1.25rem;

  font-size: 0.875rem;
}
