/* Chatbot Widget Styles */
#chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  font-family: 'Cabinet Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
}

#chatbot-button {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5a5 0%, #4e8d8d 100%);
  border: none;
  box-shadow: 0 4px 20px rgba(96, 165, 165, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

#chatbot-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(96, 165, 165, 0.5);
}

#chatbot-button svg {
  width: 32px;
  height: 32px;
  fill: white;
}

#chatbot-button .close-icon {
  display: none;
}

#chatbot-button.active .chat-icon {
  display: none;
}

#chatbot-button.active .close-icon {
  display: block;
}

/* Notification badge */
#chatbot-button .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #d97706;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

#chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  height: 580px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#chatbot-window.active {
  display: flex;
}

/* Header */
#chatbot-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a7b 100%);
  padding: 20px;
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
}

#chatbot-header .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

#chatbot-header .info h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

#chatbot-header .info p {
  margin: 0;
  font-size: 13px;
  opacity: 0.9;
}

/* Messages */
#chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #faf9f7;
}

.chat-message {
  display: flex;
  gap: 12px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-message.user {
  flex-direction: row-reverse;
}

.chat-message .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.chat-message.assistant .avatar {
  background: linear-gradient(135deg, #60a5a5 0%, #4e8d8d 100%);
  color: white;
}

.chat-message.user .avatar {
  background: #e8e7e4;
  color: #5a5a5a;
}

.chat-message .bubble {
  padding: 12px 16px;
  border-radius: 16px;
  max-width: 75%;
  line-height: 1.5;
  font-size: 15px;
}

.chat-message.assistant .bubble {
  background: white;
  color: #2a2a2a;
  border: 1px solid #e8e7e4;
}

.chat-message.user .bubble {
  background: linear-gradient(135deg, #60a5a5 0%, #4e8d8d 100%);
  color: white;
}

.chat-message.system .bubble {
  background: #fef3e8;
  color: #5a5a5a;
  border: 1px solid #fde5c5;
  font-size: 14px;
  text-align: center;
  margin: 0 auto;
  max-width: 90%;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: white;
  border: 1px solid #e8e7e4;
  border-radius: 16px;
  width: fit-content;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #60a5a5;
  animation: typing 1.4s infinite;
}

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

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

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

/* Input area */
#chatbot-input-area {
  padding: 16px 20px;
  border-top: 1px solid #e8e7e4;
  background: white;
  display: flex;
  gap: 12px;
  align-items: center;
}

#chatbot-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e8e7e4;
  border-radius: 24px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

#chatbot-input:focus {
  border-color: #60a5a5;
}

#chatbot-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5a5 0%, #4e8d8d 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

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

#chatbot-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#chatbot-send svg {
  width: 20px;
  height: 20px;
  fill: white;
}

/* Mobile responsive */
@media (max-width: 480px) {
  #chatbot-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 140px);
    bottom: 100px;
    right: 16px;
  }

  #chatbot-widget {
    bottom: 16px;
    right: 16px;
  }
}

/* Scrollbar styling */
#chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

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

#chatbot-messages::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 3px;
}

#chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #b0b0b0;
}
