/* ChatWise Chatbot Styles */

.chat-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1.05rem 1.6rem;
  background: linear-gradient(135deg, #db2777 0%, #be185d 100%);
  color: white;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(219, 39, 119, 0.3);
  transition: all 0.3s ease;
  z-index: 999;
}

.chat-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(219, 39, 119, 0.4);
}

.chatbot-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 400px;
  max-width: calc(100vw - 2rem);
  height: 600px;
  max-height: calc(100vh - 4rem);
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  transition: transform 0.3s ease, height 0.3s ease;
}

.chatbot-container.minimized {
  height: auto;
  max-height: none;
  bottom: 0;
  transform: translateY(calc(100vh - 100%));
}

.chatbot-container.minimized .chatbot-messages,
.chatbot-container.minimized .chatbot-input-container {
  display: none !important;
}

.chatbot-container.minimized .chatbot-header {
  cursor: pointer;
  border-radius: 16px 16px 0 0;
}

.chatbot-header {
  background: linear-gradient(135deg, #db2777 0%, #be185d 100%);
  color: white;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  min-height: 60px;
}

.chatbot-header-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

.chatbot-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
}

.chatbot-subtitle {
  font-size: 0.875rem;
  opacity: 0.9;
  margin: 0;
}

.chatbot-close {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

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

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

.chatbot-message {
  display: flex;
  animation: fadeIn 0.3s ease;
}

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

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

.chatbot-message-bot {
  justify-content: flex-start;
}

.chatbot-message-bubble {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.chatbot-message-user .chatbot-message-bubble {
  background: linear-gradient(135deg, #db2777 0%, #be185d 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.chatbot-message-bot .chatbot-message-bubble {
  background: white;
  color: #1f2937;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 0.25rem 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #9ca3af;
  border-radius: 50%;
  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.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

.chatbot-input-container {
  background: white;
  padding: 1rem;
  border-top: 1px solid #e5e7eb;
}

.chatbot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.quick-reply-btn {
  padding: 0.5rem 1rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  color: #374151;
  white-space: nowrap;
}

.quick-reply-btn:hover {
  background: #fce7f3;
  border-color: #db2777;
  color: #be185d;
}

.chatbot-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chatbot-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 24px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}

.chatbot-input:focus {
  border-color: #db2777;
}

.chatbot-send {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #db2777 0%, #be185d 100%);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chatbot-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(219, 39, 119, 0.3);
}

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

/* Mobile responsive */
@media (max-width: 768px) {
  .chat-toggle {
    bottom: 1rem;
    right: 1rem;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    min-width: 44px;
    min-height: 44px;
    border-radius: 999px;
  }

  .chatbot-container {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: calc(100vh - 60px);
    max-height: calc(100vh - 60px);
    border-radius: 16px 16px 0 0;
  }

  .chatbot-container.minimized {
    height: auto;
    transform: translateY(calc(100vh - 100%));
    border-radius: 16px 16px 0 0;
  }

  .chatbot-messages {
    padding: 1rem;
    max-height: calc(100vh - 200px);
  }

  .chatbot-message-bubble {
    max-width: 85%;
    font-size: 0.875rem;
  }

  .chatbot-input,
  .chatbot-send {
    min-height: 44px;
  }
}
