/*-----------------------------------*\
  #CHATBOT STYLES
\*-----------------------------------*/

/* Chatbot Toggle Button */
.chatbot-toggle-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: hsl(45, 100%, 72%);
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-2);
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
}

.chatbot-toggle-btn.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.chatbot-toggle-btn:hover {
  transform: scale(1.1);
  background: hsl(45, 100%, 75%);
  box-shadow: 0 8px 25px hsla(45, 100%, 72%, 0.4);
}

.chatbot-toggle-btn ion-icon {
  font-size: 24px;
  color: var(--smoky-black);
}

.chatbot-notification {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--bittersweet-shimmer);
  color: var(--white-1);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-600);
}

/* Speech Bubble */
.chatbot-speech-bubble {
  position: absolute;
  top: -60px;
  right: -5px;
  transform: translateX(0);
  background: var(--bg-gradient-yellow-1);
  color: var(--white-1);
  padding: 10px 16px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: var(--fw-500);
  white-space: nowrap;
  box-shadow: 0 4px 15px hsla(45, 100%, 72%, 0.3);
  animation: speechBubbleBounce 2s ease-in-out infinite;
  z-index: 1001;
  transition: all 0.3s ease;
  opacity: 1;
}

.chatbot-speech-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 25px;
  transform: translateX(0);
  border: 8px solid transparent;
  border-top-color: hsl(45, 100%, 71%);
}

/* Chatbot Container - Default is normal size (450px wide) */
.chatbot-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 450px;
  height: 600px;
  max-height: calc(100vh - 60px);
  background: var(--eerie-black-2);
  border: 1px solid var(--jet);
  border-radius: 20px;
  box-shadow: var(--shadow-2);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: scale(0) translateY(100px);
  transform-origin: bottom right;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-container.active {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Maximized state - full screen mode */
.chatbot-container.maximized {
  top: 50%;
  left: 50%;
  bottom: auto;
  right: auto;
  width: 90vw;
  height: 90vh;
  max-width: 1200px;
  max-height: 90vh;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center;
  border-radius: 20px;
}

/* Chatbot Header */
.chatbot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--jet);
  background: var(--bg-gradient-yellow-2);
  border-radius: 20px 20px 0 0;
  flex-shrink: 0;
}

.chatbot-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white-1);
  font-weight: var(--fw-500);
  font-size: var(--fs-5);
}

.chatbot-title ion-icon {
  font-size: 22px;
}

.chatbot-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chatbot-maximize-btn,
.chatbot-close-btn {
  background: transparent;
  border: none;
  color: var(--white-1);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-maximize-btn:hover,
.chatbot-close-btn:hover {
  background: hsla(0, 0%, 100%, 0.15);
  transform: scale(1.1);
}

.chatbot-maximize-btn ion-icon,
.chatbot-close-btn ion-icon {
  font-size: 20px;
  color: var(--white-1);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Messages Container */
.chatbot-messages {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  scroll-behavior: smooth;
  min-height: 0;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: var(--onyx);
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: var(--orange-yellow-crayola);
  border-radius: 3px;
}

/* Message Styles */
.chatbot-message {
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.chatbot-message-user {
  justify-content: flex-end;
}

.chatbot-message-user .message-content {
  background: hsl(45, 100%, 71%);
  color: var(--smoky-black);
  max-width: 80%;
}

.chatbot-message-bot .message-content {
  background: var(--jet);
  color: var(--white-1);
  max-width: 85%;
}

.message-avatar {
  width: 30px;
  height: 30px;
  background: var(--bg-gradient-yellow-1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message-avatar ion-icon {
  font-size: 16px;
  color: var(--white-1);
}

.message-content {
  padding: 16px 20px;
  border-radius: 18px;
  font-size: var(--fs-5);
  line-height: 1.6;
  word-wrap: break-word;
  white-space: pre-line;
}

/* Input Area */
.chatbot-input-area {
  padding: 24px 30px;
  border-top: 1px solid var(--jet);
  flex-shrink: 0;
}

.chatbot-suggestions {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.suggestion-btn {
  background: var(--onyx);
  color: var(--light-gray);
  border: 1px solid var(--jet);
  padding: 10px 16px;
  border-radius: 18px;
  font-size: var(--fs-6);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.suggestion-btn:hover {
  background: var(--bg-gradient-yellow-1);
  color: var(--smoky-black);
  border-color: var(--orange-yellow-crayola);
}

.chatbot-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

#chatbot-input {
  flex: 1;
  background: var(--onyx);
  border: 1px solid var(--jet);
  color: var(--white-1);
  padding: 16px 20px;
  border-radius: 25px;
  font-size: var(--fs-5);
  outline: none;
  transition: border-color 0.2s ease;
}

#chatbot-input:focus {
  border-color: var(--orange-yellow-crayola);
}

#chatbot-input::placeholder {
  color: var(--light-gray-70);
}

#chatbot-send-btn {
  width: 48px;
  height: 48px;
  background: var(--bg-gradient-yellow-1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

#chatbot-send-btn:hover {
  transform: scale(1.1);
}

#chatbot-send-btn ion-icon {
  font-size: 20px;
  color: var(--white-1);
}

/* Typing Indicator */
.typing-indicator {
  opacity: 0.8;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--light-gray-70);
  border-radius: 50%;
  animation: typingDots 1.4s infinite ease-in-out;
}

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

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

@keyframes typingDots {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes speechBubbleBounce {
  0%, 100% {
    transform: translateX(0) translateY(0);
  }
  50% {
    transform: translateX(0) translateY(-5px);
  }
}

/* Disabled state for send button when typing */
#chatbot-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#chatbot-send-btn:disabled:hover {
  transform: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chatbot-speech-bubble {
    font-size: 12px;
    padding: 8px 12px;
    top: -55px;
  }

  .chatbot-speech-bubble::after {
    border-width: 6px;
  }

  .chatbot-toggle-btn {
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
  }

  .chatbot-container {
    width: calc(100vw - 40px);
    max-width: 400px;
    height: 70vh;
    bottom: 20px;
    right: 20px;
  }

  .chatbot-container.maximized {
    width: calc(100vw - 20px);
    height: 85vh;
    max-width: none;
    bottom: 10px;
    right: 10px;
    top: auto;
    left: auto;
    transform: scale(1) translateY(0);
  }

  .chatbot-header {
    padding: 18px 20px;
  }
  
  .chatbot-messages {
    padding: 24px;
  }
  
  .chatbot-input-area {
    padding: 20px 24px;
  }
  
  .chatbot-title {
    font-size: var(--fs-5);
  }
  
  .chatbot-title ion-icon {
    font-size: 20px;
  }
  
  .message-content {
    font-size: var(--fs-6);
    padding: 14px 18px;
  }
  
  .suggestion-btn {
    font-size: var(--fs-7);
    padding: 8px 14px;
  }
  
  #chatbot-input {
    font-size: var(--fs-6);
    padding: 14px 18px;
  }
  
  #chatbot-send-btn {
    width: 44px;
    height: 44px;
  }
  
  #chatbot-send-btn ion-icon {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .chatbot-toggle-btn {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
  }

  .chatbot-container {
    width: calc(100vw - 32px);
    max-width: 360px;
    height: 70vh;
    bottom: 16px;
    right: 16px;
  }

  .chatbot-container.maximized {
    width: calc(100vw - 16px);
    height: 90vh;
    max-width: none;
    bottom: 8px;
    right: 8px;
  }

  .chatbot-header {
    padding: 16px 18px;
  }
  
  .chatbot-messages {
    padding: 20px;
  }
  
  .chatbot-input-area {
    padding: 16px 20px;
  }
  
  .chatbot-suggestions {
    gap: 8px;
    margin-bottom: 16px;
  }
  
  .suggestion-btn {
    font-size: var(--fs-8);
    padding: 8px 12px;
  }
  
  .message-content {
    font-size: var(--fs-7);
    padding: 12px 16px;
  }
  
  #chatbot-input {
    font-size: var(--fs-7);
    padding: 12px 16px;
  }
  
  #chatbot-send-btn {
    width: 40px;
    height: 40px;
  }
  
  #chatbot-send-btn ion-icon {
    font-size: 16px;
  }
}